:root {
    --gradient-start: #48C6EF;
    --gradient-end: #0050A0;
    --gradient-dark: #00377a;
    --accent-gold: #F5C15C;
    --accent-gold-dark: #d7a03d;
    --surface-strong: rgba(255, 255, 255, 0.98);
    --surface-medium: rgba(255, 255, 255, 0.92);
    --surface-soft: rgba(255, 255, 255, 0.85);
    --text-primary: #12202F;
    --text-secondary: rgba(18, 32, 47, 0.72);
    --text-inverse: #f7fbff;
    --border-soft: rgba(255, 255, 255, 0.35);
    --focus-ring: 0 0 0 3px rgba(245, 193, 92, 0.45);
    --shadow-soft: 0 20px 45px rgba(0, 31, 84, 0.18);
    --shadow-card: 0 14px 40px rgba(22, 64, 117, 0.22);
    --radius-lg: 28px;
    --radius-md: 20px;
    --radius-sm: 14px;
    --spacing-page: clamp(20px, 5vw, 48px);
    --font-body: 'Inter', 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-heading: 'Playfair Display', 'Times New Roman', serif;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

body.site-body {
    font-family: var(--font-body);
    color: var(--text-primary);
    min-height: 100vh;
    background: linear-gradient(180deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
    position: relative;
    overflow-x: hidden;
}

body.site-body.rtl {
    direction: rtl;
    text-align: right;
}

body.site-body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at top left, rgba(255, 255, 255, 0.32), transparent 55%),
                radial-gradient(circle at 85% 15%, rgba(255, 255, 255, 0.18), transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.site-background {
    position: fixed;
    inset: 0;
    z-index: -2;
    background: linear-gradient(180deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
}

.site-wrapper {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    padding: var(--spacing-page) clamp(16px, 4vw, 56px);
    display: flex;
    flex-direction: column;
}

main.page-shell,
.section-shell,
.main-container {
    width: min(1100px, 100%);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: clamp(32px, 6vw, 56px);
}

.surface-card,
.glass-card,
.form-card,
.notice-card,
.contact-strip,
.hero-panel {
    background: var(--surface-medium);
    backdrop-filter: blur(12px);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-soft);
    padding: clamp(24px, 4vw, 40px);
}

.surface-card.tight,
.notice-card {
    padding: clamp(20px, 3vw, 32px);
    border-radius: var(--radius-md);
}

.hero-panel {
    text-align: center;
    background: var(--surface-strong);
    padding: clamp(40px, 6vw, 64px);
    position: relative;
    overflow: hidden;
}

.hero-panel::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% -10%, rgba(72, 198, 239, 0.28), transparent 55%),
                radial-gradient(circle at 75% 0%, rgba(245, 193, 92, 0.18), transparent 60%);
    mix-blend-mode: screen;
    pointer-events: none;
}

.hero-panel h1,
.page-title,
.display-heading {
    font-family: var(--font-heading);
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    margin-bottom: clamp(16px, 3vw, 24px);
}

.hero-panel p.lead,
.page-subtitle,
.lead-text {
    font-size: clamp(1.05rem, 1.5vw, 1.2rem);
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
    margin-top: clamp(20px, 4vw, 36px);
    position: relative;
    z-index: 1;
}

.contact-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    align-items: center;
    background: rgba(255, 255, 255, 0.9);
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
}

.contact-item i {
    font-size: 1.25rem;
    color: var(--accent-gold);
}

.form-card {
    background: var(--surface-strong);
}

.form-card h2 {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: clamp(1.4rem, 2vw, 1.7rem);
    margin-bottom: clamp(16px, 3vw, 24px);
}

.form-card .form-text {
    color: var(--text-secondary);
}

.form-card .divider {
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.1), transparent);
    margin: 24px 0;
}

form label.form-label {
    font-weight: 600;
    color: var(--text-primary);
}

.form-control,
.form-select,
textarea.form-control {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 18px;
    border: 1px solid rgba(18, 32, 47, 0.18);
    padding: 14px 18px;
    font-size: 1rem;
    color: var(--text-primary);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    min-height: 52px;
}

textarea.form-control {
    min-height: 160px;
    resize: vertical;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--accent-gold);
    box-shadow: var(--focus-ring);
    outline: none;
}

.form-control.is-invalid,
.form-select.is-invalid {
    border-color: #d64545;
    box-shadow: 0 0 0 3px rgba(214, 69, 69, 0.25);
}

.form-control.is-valid,
.form-select.is-valid {
    border-color: #38a169;
    box-shadow: 0 0 0 3px rgba(56, 161, 105, 0.25);
}

.btn,
.button,
button {
    font-family: var(--font-body);
    font-weight: 600;
    letter-spacing: 0.01em;
    border-radius: 18px;
    padding: 14px 22px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: none;
}

.btn-primary,
button.btn-primary,
.button.primary {
    background: linear-gradient(100deg, var(--accent-gold) 0%, var(--accent-gold-dark) 100%);
    color: #12202f;
    box-shadow: 0 12px 30px rgba(245, 193, 92, 0.32);
}

.btn-primary:hover,
button.btn-primary:hover,
.button.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 36px rgba(245, 193, 92, 0.4);
}

.btn-primary:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

.btn-outline-light {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.65);
    color: var(--text-inverse);
}

.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.18);
}

.secondary-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px 20px;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.secondary-links a {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px solid rgba(18, 32, 47, 0.25);
    padding-bottom: 2px;
}

.secondary-links a:hover {
    color: var(--text-primary);
    border-bottom-color: var(--text-primary);
}

a {
    color: var(--accent-gold);
    text-decoration: none;
}

a:hover {
    color: var(--accent-gold-dark);
}

.notice-card strong,
.notice-card h6 {
    color: var(--text-primary);
    font-weight: 600;
}

.notice-card p,
.notice-card li {
    color: var(--text-secondary);
    line-height: 1.7;
}

.toast-success {
    background: rgba(56, 161, 105, 0.92);
    color: white;
    border-radius: 14px;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 12px 28px rgba(32, 102, 64, 0.3);
}

.toast-success i {
    font-size: 1.25rem;
}

.language-switcher {
    align-self: flex-end;
    display: flex;
    gap: 12px;
    align-items: center;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 999px;
    padding: 6px 14px;
}

.language-switcher label {
    font-size: 0.85rem;
    color: var(--text-inverse);
    margin: 0;
}

.language-switcher select {
    background: rgba(255, 255, 255, 0.85);
    border: none;
    border-radius: 999px;
    padding: 6px 18px;
    font-size: 0.9rem;
}

.language-switcher select:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

.two-column,
.layout-split {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: clamp(24px, 4vw, 40px);
}

.card-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

.card-list .surface-card {
    background: var(--surface-soft);
}

.progress-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 18px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.3);
    color: var(--text-inverse);
    font-size: 0.9rem;
}

.section-heading {
    font-family: var(--font-heading);
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.section-description {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.sticky-cta {
    position: fixed;
    inset-inline: 16px;
    bottom: 16px;
    background: var(--surface-strong);
    border-radius: 22px;
    box-shadow: 0 20px 40px rgba(7, 32, 68, 0.32);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    z-index: 999;
    transform: translateY(120%);
    transition: transform 0.3s ease;
}

.sticky-cta.visible {
    transform: translateY(0);
}

.sticky-cta button {
    flex: 1 1 auto;
}

.success-banner {
    position: sticky;
    top: 16px;
    z-index: 90;
    display: flex;
    justify-content: center;
}

.success-banner .toast-success {
    width: min(480px, 92vw);
}

/* Legacy helper classes maintained for backwards compatibility */

.main-container {
    background: transparent;
    padding: 0;
}

.main-container > * {
    position: relative;
    z-index: 1;
}

.page-title {
    font-size: clamp(2.2rem, 5vw, 2.8rem);
}

.page-subtitle + .page-subtitle {
    margin-top: 10px;
}

.contact-info {
    margin-top: clamp(16px, 3vw, 28px);
    padding: 20px 24px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-soft);
}

.contact-info h3 {
    font-family: var(--font-heading);
    margin-bottom: 12px;
}

.contact-info p {
    margin: 6px 0;
    color: var(--text-secondary);
}

/* Personalized intake flow overrides */

.intake-shell {
    display: flex;
    flex-direction: column;
    gap: clamp(24px, 5vw, 38px);
}

.intake-headline {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.intake-headline .feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
}

.feature-bubble {
    background: rgba(255, 255, 255, 0.82);
    border-radius: var(--radius-md);
    padding: 20px;
    border: 1px solid rgba(72, 198, 239, 0.22);
    box-shadow: var(--shadow-soft);
}

.feature-bubble h5 {
    font-family: var(--font-heading);
    margin-bottom: 8px;
    font-size: 1.05rem;
}

.question-card {
    background: var(--surface-strong);
    border-radius: var(--radius-md);
    border: 1px solid rgba(18, 32, 47, 0.15);
    padding: clamp(20px, 3vw, 28px);
    box-shadow: var(--shadow-soft);
}

.question-card + .question-card {
    margin-top: 16px;
}

.question-card label {
    font-weight: 600;
    color: var(--text-primary);
}

.progress-section,
.progress-shell {
    background: rgba(255, 255, 255, 0.26);
    border-radius: var(--radius-md);
    padding: clamp(20px, 3vw, 32px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: var(--text-inverse);
    box-shadow: var(--shadow-soft);
}

.progress-shell .progress {
    height: 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.35);
}

.progress-shell .progress-bar {
    background: rgba(245, 193, 92, 0.95);
    border-radius: 999px;
}

.summary-card {
    background: var(--surface-strong);
    border-radius: var(--radius-lg);
    padding: clamp(28px, 4vw, 44px);
    box-shadow: var(--shadow-card);
}

.summary-card h2 {
    font-family: var(--font-heading);
    margin-bottom: 18px;
}

.summary-card section + section {
    margin-top: 24px;
}

.summary-card h3 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.summary-card p,
.summary-card li {
    color: var(--text-secondary);
    line-height: 1.7;
}

.summary-card ul {
    padding-inline-start: 20px;
}

.badge-case-type {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.45);
    color: var(--text-primary);
    font-weight: 600;
}

.analysis-text {
    white-space: pre-wrap;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* RTL adjustments */

body.site-body.rtl .hero-panel,
body.site-body.rtl .surface-card,
body.site-body.rtl .form-card,
body.site-body.rtl .notice-card {
    text-align: right;
}

body.site-body.rtl .contact-item {
    flex-direction: row-reverse;
}

body.site-body.rtl .language-switcher {
    align-self: flex-start;
}

body.site-body.rtl .secondary-links {
    justify-content: flex-start;
}

/* Responsive tweaks */

@media (max-width: 768px) {
    .site-wrapper {
        padding: 20px 16px 88px;
    }

    .hero-panel {
        padding: 32px 20px;
    }

    .form-card {
        padding: 28px 20px;
    }

    .contact-strip {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .contact-item {
        justify-content: center;
    }

    .sticky-cta {
        bottom: 12px;
        inset-inline: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition: none !important;
        animation: none !important;
    }
}
