:root {
    --bg: #f8fafc;
    --surface: #ffffff;
    --surface-soft: #f1f5f9;
    --text: #0f172a;
    --muted: #64748b;
    --primary: #4f46e5;
    --primary-strong: #4338ca;
    --accent: #06b6d4;
    --border: #e2e8f0;
    --shadow: 0 14px 40px -24px rgba(15, 23, 42, 0.35);
    --font-body: "Vazirmatn", "Segoe UI", Tahoma, sans-serif;
    --font-display: "Noto Serif Arabic", "Playfair Display", Georgia, serif;
    --font-brand: "Playfair Display", "Noto Serif Arabic", Georgia, serif;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    background: radial-gradient(circle at top right, #e0e7ff 0, #f8fafc 38%, #f8fafc 100%);
    color: var(--text);
    font-family: var(--font-body);
    font-weight: 400;
    line-height: 1.8;
    font-size: 16px;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
    font-kerning: normal;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-display);
    letter-spacing: -0.015em;
    line-height: 1.3;
    font-weight: 700;
    font-feature-settings: "kern" 1, "liga" 1;
}

h1 {
    font-size: clamp(2rem, 4vw, 3.2rem);
    font-weight: 700;
    letter-spacing: -0.02em;
}

h2 {
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    font-weight: 700;
}

h3 {
    font-size: clamp(1.15rem, 2vw, 1.5rem);
    font-weight: 600;
}

h4 {
    font-size: 1.1rem;
    font-weight: 600;
}

p {
    line-height: 1.85;
    letter-spacing: 0.005em;
}

a {
    color: inherit;
    text-decoration: none;
}

.container {
    width: min(1120px, 92vw);
    margin: 0 auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 60;
    background: rgba(248, 250, 252, 0.92);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(148, 163, 184, 0.24);
    box-shadow: 0 20px 36px -30px rgba(15, 23, 42, 0.55);
}

.header-utility-wrap {
    background: linear-gradient(90deg, #0f172a 0%, #312e81 42%, #164e63 100%);
    border-bottom: 1px solid rgba(148, 163, 184, 0.26);
}

.header-utility {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.45rem 0;
}

.utility-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.38rem 0.82rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: #fff;
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.01em;
    box-shadow: 0 6px 18px -10px rgba(15, 23, 42, 0.7);
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.utility-pill:hover {
    transform: translateY(-2px);
    filter: brightness(1.04);
    box-shadow: 0 14px 22px -14px rgba(15, 23, 42, 0.9);
}

.utility-pill--placement {
    background: linear-gradient(135deg, #f97316 0%, #f43f5e 100%);
}

.utility-pill--portal {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
}

.utility-pill--classes {
    background: linear-gradient(135deg, #0891b2 0%, #06b6d4 100%);
}

.utility-pill--phone {
    background: linear-gradient(135deg, #0f766e 0%, #10b981 100%);
}

.utility-pill--login {
    background: linear-gradient(135deg, #4338ca 0%, #2563eb 100%);
}

.utility-pill--chat {
    background: linear-gradient(135deg, #be123c 0%, #db2777 100%);
}

.navbar {
    min-height: 78px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.9rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    font-family: var(--font-brand);
    font-weight: 700;
    font-size: 1.55rem;
    letter-spacing: 0.04em;
    font-style: italic;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.brand-logo {
    display: block;
    width: auto;
    height: 46px;
    max-width: 220px;
    object-fit: contain;
}

.nav-links {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0;
    padding: 0;
    flex-wrap: nowrap;
    flex: 1;
    justify-content: center;
}

.nav-links > li {
    position: relative;
}

.nav-links > li > a,
.nav-dropdown__trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.55rem 0.82rem;
    color: #0f172a;
    border-radius: 0.78rem;
    border: 1px solid transparent;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.nav-links > li > a:hover,
.nav-dropdown__trigger:hover,
.nav-dropdown__details[open] .nav-dropdown__trigger {
    background: rgba(224, 231, 255, 0.75);
    border-color: #c7d2fe;
    color: #312e81;
    transform: translateY(-1px);
}

/* ---------- Dropdown & Mega Menu ---------- */

.nav-dropdown {
    position: relative;
}

.nav-dropdown__details {
    position: relative;
}

.nav-dropdown__trigger::-webkit-details-marker {
    display: none;
}

.nav-arrow {
    font-size: 0.62rem;
    opacity: 0.62;
    transition: transform 0.24s ease, opacity 0.24s ease;
}

.nav-dropdown__details[open] .nav-arrow {
    transform: rotate(180deg);
    opacity: 0.9;
}

.mega-menu {
    position: absolute;
    top: calc(100% + 0.75rem);
    right: 0;
    width: min(860px, 82vw);
    min-width: 620px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border: 1px solid #dbe4ff;
    border-radius: 1.1rem;
    box-shadow: 0 24px 56px -20px rgba(30, 41, 59, 0.46);
    padding: 1.05rem;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.8rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(9px) scale(0.985);
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s;
    z-index: 120;
}

.mega-menu::before {
    content: "";
    position: absolute;
    top: -2px;
    right: 1.4rem;
    width: 84px;
    height: 2px;
    background: linear-gradient(90deg, rgba(79, 70, 229, 0) 0%, #4f46e5 50%, rgba(79, 70, 229, 0) 100%);
    border-radius: 999px;
}

.nav-dropdown__details[open] .mega-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.mega-menu__group {
    min-width: 0;
    border: 1px solid #e7eefc;
    border-radius: 0.9rem;
    background: #fff;
    padding: 0.72rem;
}

.mega-menu__group--primary-link {
    grid-column: 1 / -1;
    border: 1px solid #c7d2fe;
    background: linear-gradient(135deg, #eef2ff 0%, #e0f2fe 100%);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0.62rem 0.72rem;
}

.mega-menu__top-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.36rem 0.62rem;
    background: rgba(255, 255, 255, 0.8);
    color: var(--primary);
    border-radius: 0.65rem;
    font-weight: 700;
    font-size: 0.84rem;
}

.mega-menu__heading {
    font-family: var(--font-display);
    font-size: 0.83rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0 0 0.52rem;
    padding-bottom: 0.34rem;
    border-bottom: 1px solid #dde5ff;
    letter-spacing: 0.01em;
}

.mega-menu__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.16rem;
}

.mega-menu__list li a {
    display: block;
    padding: 0.36rem 0.5rem;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text);
    border-radius: 0.58rem;
    transition: background 0.16s ease, color 0.16s ease, padding-right 0.16s ease;
}

.mega-menu__list li a:hover {
    background: #eef2ff;
    color: var(--primary);
    padding-right: 0.78rem;
}

.auth-actions {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.welcome {
    font-size: 0.9rem;
    color: var(--muted);
}

/* ---------- Video Hero ---------- */

.video-hero {
    position: relative;
    width: 100%;
    height: 100vh;
    height: 100svh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.video-hero__bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.video-hero__video {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    object-fit: cover;
    display: block;
}

.video-hero__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        180deg,
        rgba(15, 23, 42, 0.55) 0%,
        rgba(15, 23, 42, 0.35) 40%,
        rgba(15, 23, 42, 0.65) 100%
    );
    z-index: 1;
}

.video-hero__center {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 0 1.5rem;
}

.video-hero__title {
    font-family: var(--font-display);
    font-size: clamp(2.8rem, 7vw, 5.5rem);
    line-height: 1.15;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.02em;
    margin: 0 0 2rem;
    text-shadow: 0 4px 40px rgba(0, 0, 0, 0.3);
}

.video-hero__brand {
    font-family: var(--font-brand);
    font-style: italic;
    background: linear-gradient(135deg, #c7d2fe 0%, #67e8f9 50%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 2px 12px rgba(99, 102, 241, 0.4));
}

.video-hero__separator {
    color: rgba(255, 255, 255, 0.4);
    font-weight: 400;
    margin: 0 0.1em;
}

.video-hero__buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.9rem;
}

.btn-hero-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #6366f1 100%);
    color: #fff;
    padding: 0.8rem 2rem;
    font-size: 1.05rem;
    border-radius: 0.9rem;
    box-shadow: 0 4px 24px -6px rgba(99, 102, 241, 0.55);
}

.btn-hero-primary:hover {
    background: linear-gradient(135deg, var(--primary-strong) 0%, #4f46e5 100%);
    box-shadow: 0 6px 32px -6px rgba(99, 102, 241, 0.7);
    transform: translateY(-2px);
}

.btn-hero-outline {
    border: 1.5px solid rgba(255, 255, 255, 0.4);
    color: #fff;
    padding: 0.8rem 2rem;
    font-size: 1.05rem;
    border-radius: 0.9rem;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.btn-hero-outline:hover {
    border-color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

/* ---------- Legacy Hero (keep for other pages) ---------- */

.hero {
    padding: 4.5rem 0 2rem;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 1.5rem;
}

.hero-copy h1 {
    font-size: clamp(2.2rem, 4.2vw, 3.5rem);
    line-height: 1.2;
    margin: 0.5rem 0 1.2rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.hero-copy p {
    color: #334155;
    line-height: 2;
    max-width: 58ch;
    font-size: 1.05rem;
    font-weight: 400;
}

.hero-panel {
    background: linear-gradient(145deg, #1e1b4b 0%, #4338ca 55%, #0891b2 100%);
    color: #f8fafc;
    border-radius: 1.25rem;
    padding: 1.25rem;
    box-shadow: var(--shadow);
    display: grid;
    gap: 0.9rem;
}

.metric {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 0.45rem;
}

.metric strong {
    font-size: 1.5rem;
    font-family: var(--font-display);
    font-weight: 700;
}

.section {
    padding: 1.6rem 0 2.5rem;
}

.section-muted {
    background: linear-gradient(180deg, rgba(224, 231, 255, 0.35), rgba(241, 245, 249, 0.2));
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 1rem;
    margin-bottom: 1rem;
}

.section-head h1,
.section-head h2 {
    margin: 0;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.card,
.panel {
    background: var(--surface);
    border-radius: 1.15rem;
    border: 1px solid var(--border);
    padding: 1.1rem;
    box-shadow: var(--shadow);
}

.card h3 {
    margin-top: 0.35rem;
    margin-bottom: 0.4rem;
}

.chip {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    background: #e0e7ff;
    color: #312e81;
    padding: 0.25rem 0.7rem;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.eyebrow {
    color: #4f46e5;
    font-family: var(--font-body);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.78rem;
}

.lead {
    color: #334155;
    line-height: 2;
    font-size: 1.05rem;
    font-weight: 400;
}

.muted {
    color: var(--muted);
}

.detail-grid {
    margin: 1rem 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.detail-grid > div {
    background: var(--surface-soft);
    border-radius: 0.9rem;
    border: 1px solid var(--border);
    padding: 0.8rem;
}

.meta-list {
    margin: 0.8rem 0 0.9rem;
    padding: 0 1rem 0 0;
    color: #334155;
}

.split-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.3rem;
    align-items: start;
}

.feature-list {
    display: grid;
    gap: 0.75rem;
}

.feature-list div {
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 0.85rem;
    padding: 0.8rem;
}

.btn {
    border-radius: 0.8rem;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 0.6rem 1.15rem;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.25s ease;
    font: inherit;
    font-weight: 600;
    font-size: 0.92rem;
    letter-spacing: 0.015em;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-strong);
}

.btn-soft {
    background: #e0f2fe;
    color: #0c4a6e;
}

.btn-soft:hover {
    background: #bae6fd;
}

.btn-outline {
    border-color: #94a3b8;
    color: #1e293b;
    background: transparent;
}

.btn-outline:hover {
    background: #f1f5f9;
}

.btn-block {
    width: 100%;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 0.8rem;
}

.text-link {
    color: #3730a3;
    font-weight: 600;
    letter-spacing: 0.01em;
    border-bottom: 1.5px solid rgba(55, 48, 163, 0.2);
    transition: border-color 0.2s ease;
}

.text-link:hover {
    border-bottom-color: #3730a3;
}

.site-footer {
    margin-top: 2rem;
    background: #0f172a;
    color: #cbd5e1;
    padding-top: 2rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.footer-grid h4 {
    color: #fff;
    margin-top: 0;
    font-family: var(--font-display);
    letter-spacing: 0.01em;
}

.footer-grid a {
    display: block;
    margin-bottom: 0.35rem;
    color: #cbd5e1;
}

.copyright {
    border-top: 1px solid rgba(148, 163, 184, 0.3);
    text-align: center;
    margin: 1.2rem 0 0;
    padding: 1rem 0;
    font-size: 0.85rem;
    color: #94a3b8;
    letter-spacing: 0.03em;
    font-weight: 300;
}

.auth-panel {
    max-width: 560px;
    margin: 0 auto;
}

.auth-form {
    display: grid;
    gap: 0.55rem;
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 0.68rem 0.9rem;
    font: inherit;
    font-size: 0.95rem;
    background: #fff;
    letter-spacing: 0.01em;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.error-text {
    color: #dc2626;
}

.flash-wrapper {
    margin-top: 1rem;
}

.flash-message {
    background: #dbeafe;
    color: #1e3a8a;
    border: 1px solid #93c5fd;
    border-radius: 0.8rem;
    padding: 0.7rem 0.9rem;
}

.placement-app h2 {
    margin: 0.7rem 0;
}

.progress-row {
    display: grid;
    gap: 0.35rem;
}

.progress-bar {
    height: 10px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
}

#progress-fill {
    display: block;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #06b6d4);
    transition: width 0.25s ease;
}

.choices-grid {
    margin: 0.9rem 0 0.6rem;
    display: grid;
    gap: 0.6rem;
}

.choice-button {
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 0.75rem;
    padding: 0.75rem;
    text-align: right;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.choice-button:hover {
    border-color: #818cf8;
}

.choice-button.active {
    border-color: #4f46e5;
    background: #eef2ff;
}

.hidden {
    display: none !important;
}

.rich-text p {
    line-height: 2.1;
    font-weight: 400;
    letter-spacing: 0.005em;
}

.rich-text h2,
.rich-text h3 {
    margin-top: 1.5em;
}

::selection {
    background: rgba(79, 70, 229, 0.15);
    color: #1e1b4b;
}

.fade-in-up {
    animation: fadeInUp 0.55s ease both;
}

.delay-1 {
    animation-delay: 0.1s;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 980px) {
    .hero-grid,
    .split-grid,
    .footer-grid,
    .detail-grid {
        grid-template-columns: 1fr;
    }

    .navbar {
        flex-direction: column;
        align-items: stretch;
        padding: 0.72rem 0;
        min-height: auto;
        gap: 0.58rem;
    }

    .header-utility {
        justify-content: flex-start;
        gap: 0.45rem;
    }

    .utility-pill {
        font-size: 0.74rem;
    }

    .nav-links {
        justify-content: start;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 0.35rem;
    }

    .nav-links > li > a,
    .nav-dropdown__trigger {
        width: 100%;
        justify-content: space-between;
        border-color: #d9e2f1;
        background: rgba(248, 250, 252, 0.85);
    }

    .auth-actions {
        justify-content: flex-start;
    }

    .card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .mega-menu {
        position: static;
        top: auto;
        right: auto;
        width: 100%;
        min-width: 0;
        box-shadow: none;
        border: 1px solid #dce6f7;
        border-radius: 0.92rem;
        padding: 0.65rem;
        background: var(--surface-soft);
        opacity: 1;
        visibility: visible;
        transform: none;
        display: none;
        grid-template-columns: 1fr;
        gap: 0.58rem;
        margin-top: 0.42rem;
    }

    .mega-menu::before {
        display: none;
    }

    .nav-dropdown__details[open] .mega-menu {
        display: grid;
    }
}

@media (max-width: 640px) {
    .brand-logo {
        height: 38px;
        max-width: 180px;
    }

    .header-utility {
        padding: 0.35rem 0 0.45rem;
    }

    .utility-pill {
        width: 100%;
    }

    .card-grid {
        grid-template-columns: 1fr;
    }

    .hero {
        padding-top: 3.2rem;
    }

    .video-hero__title {
        font-size: clamp(2rem, 9vw, 3rem);
    }

    .video-hero__buttons {
        flex-direction: column;
        align-items: center;
    }

    .btn-hero-primary,
    .btn-hero-outline {
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }
}
