@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Newsreader:opsz,wght@6..72,500;6..72,600&display=swap');

:root {
    --tx-ink: #161a18;
    --tx-muted: #66716c;
    --tx-canvas: #f1f5f3;
    --tx-paper: #fbfaf7;
    --tx-white: #ffffff;
    --tx-line: rgba(22, 26, 24, 0.13);
    --tx-pine: #07523d;
    --tx-pine-deep: #043b2d;
    --tx-mint: #d8f4e9;
    --tx-acid: #dfff8d;
    --tx-lilac: #d9d1ff;
    --tx-sky: #bcdfff;
    --tx-peach: #ffc9aa;
    --tx-gold: #d6ad5c;
    --tx-danger: #b42318;
    --tx-warning: #a15c00;
    --tx-success: #087443;
    --tx-radius-xs: 8px;
    --tx-radius-sm: 12px;
    --tx-radius-md: 18px;
    --tx-radius-lg: 28px;
    --tx-shadow-sm: 0 1px 2px rgba(18, 32, 27, 0.04), 0 8px 24px rgba(18, 32, 27, 0.05);
    --tx-shadow-lg: 0 30px 80px rgba(16, 40, 31, 0.14);
    --tx-container: 1240px;
    --tx-ease: cubic-bezier(.22, 1, .36, 1);
}

html {
    color-scheme: light;
    scroll-behavior: smooth;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

body.tx-design {
    margin: 0;
    color: var(--tx-ink);
    background:
        radial-gradient(circle at var(--tx-pointer-x, 86%) var(--tx-pointer-y, 4%), rgba(217, 209, 255, .28), transparent 30rem),
        var(--tx-canvas);
    font-family: "Manrope", "Inter", "Segoe UI", Arial, sans-serif;
    letter-spacing: -.012em;
}

body.tx-design *,
body.tx-design *::before,
body.tx-design *::after {
    box-sizing: border-box;
}

body.tx-design ::selection {
    color: var(--tx-pine-deep);
    background: var(--tx-acid);
}

body.tx-design :where(h1, h2) {
    color: var(--tx-ink);
    font-family: "Newsreader", Georgia, serif;
    font-weight: 600;
    letter-spacing: -.045em;
    text-wrap: balance;
}

body.tx-design :where(h3, h4, h5, h6) {
    color: var(--tx-ink);
    letter-spacing: -.028em;
    text-wrap: balance;
}

body.tx-design :where(p, li, label, input, select, textarea, button) {
    line-height: 1.55;
}

body.tx-design :where(a) {
    text-underline-offset: .18em;
    text-decoration-thickness: 1px;
}

body.tx-design :where(a, button, input, select, textarea, summary):focus-visible {
    outline: 3px solid rgba(7, 82, 61, .28) !important;
    outline-offset: 3px;
}

body.tx-design :where(input, select, textarea) {
    border-color: var(--tx-line);
    border-radius: var(--tx-radius-xs);
    background-color: rgba(255, 255, 255, .94);
    color: var(--tx-ink);
    font-family: inherit;
    box-shadow: 0 1px 0 rgba(255, 255, 255, .8) inset;
    transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}

body.tx-design :where(input, select, textarea):focus {
    border-color: var(--tx-pine) !important;
    background-color: #fff;
    box-shadow: 0 0 0 4px rgba(7, 82, 61, .09) !important;
}

body.tx-design :where(input, select, textarea)::placeholder {
    color: #89928e;
}

body.tx-design :where(.dashboard-container, .main-container, .content-container, .page-container) {
    width: min(var(--tx-container), calc(100% - 40px));
    margin-inline: auto;
}

body.tx-design :where(.card, [class$="-card"], [class*="-card "], .panel, .current-plan, .form-container, .auth-card) {
    border-color: var(--tx-line);
    border-radius: var(--tx-radius-md);
    box-shadow: var(--tx-shadow-sm);
}

body.tx-design :where(.btn, button[class*="btn-"], a[class*="btn-"], button[class$="-btn"], a[class$="-btn"], input[type="submit"]) {
    border-radius: 999px;
    font-family: inherit;
    font-weight: 750;
    letter-spacing: -.01em;
    transition: transform .2s var(--tx-ease), box-shadow .2s ease, background-color .2s ease, color .2s ease;
}

body.tx-design :where(.btn, button[class*="btn-"], a[class*="btn-"], button[class$="-btn"], a[class$="-btn"], input[type="submit"]):not(:disabled):hover {
    transform: translateY(-2px);
}

body.tx-design :where(.btn-primary, .primary-btn, .submit-btn, .login-btn, .register-btn, .btn-upgrade.primary, input[type="submit"]) {
    border-color: var(--tx-pine);
    background: var(--tx-pine);
    color: #fff;
    box-shadow: 0 8px 20px rgba(7, 82, 61, .18);
}

body.tx-design :where(.btn-secondary, .secondary-btn, .back-btn) {
    border-color: var(--tx-line);
    background: rgba(255, 255, 255, .82);
    color: var(--tx-ink);
}

body.tx-design :where(table) {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    background: rgba(255, 255, 255, .9);
    border: 1px solid var(--tx-line);
    border-radius: var(--tx-radius-sm);
    overflow: hidden;
}

body.tx-design :where(th) {
    color: #4d5954;
    background: #e9efec;
    font-size: .74rem;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
}

body.tx-design :where(th, td) {
    border-color: rgba(22, 26, 24, .09);
}

body.tx-design :where(tbody tr) {
    transition: background-color .18s ease;
}

body.tx-design :where(tbody tr):hover {
    background: rgba(216, 244, 233, .42);
}

body.tx-design :where(.badge, [class*="badge-"], [class$="-badge"], .status-badge) {
    border-radius: 999px;
    font-weight: 800;
    letter-spacing: .02em;
}

/* Shared editorial navigation */
body.tx-design :where(.professional-header, .app-header, .dashboard-header, .admin-header, header.top-bar, .top-bar) {
    border-bottom: 1px solid rgba(22, 26, 24, .1);
    background: rgba(251, 250, 247, .88);
    color: var(--tx-ink);
    box-shadow: none;
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
}

body.tx-design :where(.professional-header, .app-header, .dashboard-header, .admin-header).tx-scrolled {
    box-shadow: 0 12px 35px rgba(18, 32, 27, .08);
}

body.tx-design :where(.professional-header, .app-header, .dashboard-header, .admin-header, .top-bar) a {
    color: inherit;
}

body.tx-design :where(.brand-name, .logo-text, .logo, .app-brand) {
    color: var(--tx-pine);
    font-family: "Newsreader", Georgia, serif;
    font-weight: 600;
    letter-spacing: -.035em;
}

body.tx-design :where(.header, .top-bar, .sidebar, .side-nav, .admin-header, .app-header, footer) :where(h1, h2, h3, h4) {
    color: inherit;
}

/* Public and marketing routes */
body.tx-public {
    --tx-container: 1320px;
    background:
        linear-gradient(90deg, transparent 0 49.94%, rgba(22, 26, 24, .045) 50%, transparent 50.06%),
        radial-gradient(circle at 84% 8%, rgba(217, 209, 255, .62), transparent 31rem),
        radial-gradient(circle at 8% 32%, rgba(216, 244, 233, .75), transparent 35rem),
        var(--tx-paper);
}

body.tx-public :where(.container) {
    width: min(var(--tx-container), calc(100% - 40px));
    margin-inline: auto;
}

body.tx-public :where(.hero-section, .professional-hero, .hero) {
    position: relative;
    min-height: min(820px, 90vh);
    overflow: hidden;
    background: transparent;
}

body.tx-public :where(.hero-title, .hero h1, .hero-section h1, .professional-hero h1) {
    max-width: 940px;
    font-size: clamp(3.25rem, 7.5vw, 7.6rem);
    line-height: .93;
}

body.tx-public :where(.section-title, section > h2, .section-header h2) {
    font-size: clamp(2.2rem, 4.8vw, 5rem);
    line-height: .98;
}

body.tx-public :where(section) {
    position: relative;
    padding-block: clamp(68px, 9vw, 138px);
}

body.tx-public :where(.section-description, .hero-description, .hero-subtitle) {
    max-width: 720px;
    color: #59645f;
    font-size: clamp(1rem, 1.45vw, 1.2rem);
    line-height: 1.7;
}

body.tx-public :where(.features-grid, .services-grid, .solutions-grid, .pricing-grid, .trust-grid, .credibility-grid) {
    gap: clamp(14px, 2.2vw, 28px);
}

body.tx-public :where(.feature-card, .service-card, .solution-card, .pricing-card, .trust-card, .credibility-card) {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--tx-line);
    border-radius: var(--tx-radius-lg);
    background: rgba(255, 255, 255, .78);
    box-shadow: none;
    transition: transform .35s var(--tx-ease), box-shadow .35s ease, background-color .35s ease;
}

body.tx-public :where(.feature-card, .service-card, .solution-card, .pricing-card, .trust-card, .credibility-card):hover {
    transform: translateY(-8px);
    background: #fff;
    box-shadow: var(--tx-shadow-lg);
}

body.tx-public :where(.feature-card, .service-card):nth-child(4n + 1) { background: rgba(216, 244, 233, .82); }
body.tx-public :where(.feature-card, .service-card):nth-child(4n + 2) { background: rgba(217, 209, 255, .62); }
body.tx-public :where(.feature-card, .service-card):nth-child(4n + 3) { background: rgba(188, 223, 255, .62); }
body.tx-public :where(.feature-card, .service-card):nth-child(4n + 4) { background: rgba(255, 201, 170, .58); }

body.tx-public :where(.professional-footer, footer) {
    border-top: 1px solid rgba(255, 255, 255, .14);
    background: var(--tx-ink);
    color: rgba(255, 255, 255, .75);
}

/* Main landing page hero: retain the dark product canvas under light copy. */
body.tx-public.landing-page .hero-section {
    min-height: min(820px, calc(100svh - 92px));
    padding: clamp(104px, 8vw, 138px) 0 clamp(76px, 7vw, 108px);
    background:
        radial-gradient(circle at 82% 15%, rgba(224, 255, 145, .16), transparent 27rem),
        radial-gradient(circle at 8% 92%, rgba(217, 209, 255, .14), transparent 32rem),
        linear-gradient(135deg, #043b2d 0%, #07523d 55%, #096d50 100%);
}

body.tx-public.landing-page .hero-section::before {
    opacity: .72;
}

body.tx-public.landing-page .hero-content {
    grid-template-columns: minmax(0, 1.12fr) minmax(420px, .88fr);
    gap: clamp(34px, 5vw, 82px);
}

body.tx-public.landing-page .hero-text {
    max-width: 760px;
}

body.tx-public.landing-page .hero-title {
    max-width: 760px;
    margin: 0 0 28px;
    color: #fff;
    font-size: clamp(3.5rem, 5.25vw, 5.85rem);
    line-height: .96;
}

body.tx-public.landing-page .hero-title .title-primary {
    color: #fff;
}

body.tx-public.landing-page .hero-text > p {
    color: rgba(255, 255, 255, .84) !important;
}

body.tx-public.landing-page .hero-visual {
    width: 100%;
    max-width: 650px;
    justify-self: end;
}

@media (max-width: 1100px) {
    body.tx-public.landing-page .hero-section {
        min-height: auto;
        padding: 104px 0 76px;
    }

    body.tx-public.landing-page .hero-content {
        display: flex;
        flex-direction: column;
        gap: 52px;
        text-align: center;
    }

    body.tx-public.landing-page .hero-text {
        display: block;
        max-width: 820px;
        margin-inline: auto;
    }

    body.tx-public.landing-page .hero-title {
        max-width: 820px;
        margin-inline: auto;
    }

    body.tx-public.landing-page .hero-actions {
        justify-content: center;
    }

    body.tx-public.landing-page .hero-visual {
        max-width: 760px;
        margin-inline: auto;
    }
}

@media (max-width: 720px) {
    body.tx-public.landing-page .hero-section {
        padding: 86px 0 62px;
    }

    body.tx-public.landing-page .hero-content {
        gap: 38px;
        text-align: left;
    }

    body.tx-public.landing-page .hero-title {
        font-size: clamp(2.65rem, 12vw, 3.8rem);
        line-height: .98;
    }

    body.tx-public.landing-page .hero-actions {
        justify-content: flex-start;
    }
}

/* Authentication routes */
body.tx-auth {
    min-height: 100vh;
    background:
        radial-gradient(circle at 12% 8%, rgba(223, 255, 141, .68), transparent 27rem),
        radial-gradient(circle at 90% 88%, rgba(217, 209, 255, .72), transparent 34rem),
        var(--tx-paper);
}

body.tx-auth::before {
    background:
        linear-gradient(135deg, rgba(223, 255, 141, .82), rgba(216, 244, 233, .92) 43%, rgba(217, 209, 255, .86)) !important;
}

body.tx-auth :where(.container, .login-container, .register-container, .auth-container, .form-container, .login-card, .register-card, .auth-card) {
    border: 1px solid var(--tx-line);
    border-radius: var(--tx-radius-lg);
    background: rgba(255, 255, 255, .86);
    box-shadow: var(--tx-shadow-lg);
    backdrop-filter: blur(16px);
}

body.tx-auth :where(h1, h2, .form-title, .login-title) {
    font-size: clamp(2rem, 5vw, 3.6rem);
    line-height: 1;
}

/* Teacher and student application routes */
body.tx-dashboard {
    background:
        linear-gradient(180deg, rgba(216, 244, 233, .48), transparent 440px),
        var(--tx-canvas);
}

body.tx-dashboard :where(.sidebar, .side-nav) {
    border-right: 1px solid var(--tx-line);
    background: var(--tx-ink);
    color: rgba(255, 255, 255, .82);
}

body.tx-dashboard :where(.sidebar, .side-nav) a {
    border-radius: var(--tx-radius-xs);
    color: inherit;
}

body.tx-dashboard :where(.sidebar, .side-nav) a:hover,
body.tx-dashboard :where(.sidebar, .side-nav) a.active {
    background: rgba(223, 255, 141, .14);
    color: var(--tx-acid);
}

body.tx-dashboard :where(.stat-card, .metric-card, .dashboard-card, .course-card, .exam-card, .class-card) {
    border: 1px solid var(--tx-line);
    background: rgba(255, 255, 255, .9);
}

body.tx-dashboard :where(.stat-card, .metric-card):nth-child(4n + 1) { background: var(--tx-mint); }
body.tx-dashboard :where(.stat-card, .metric-card):nth-child(4n + 2) { background: var(--tx-lilac); }
body.tx-dashboard :where(.stat-card, .metric-card):nth-child(4n + 3) { background: var(--tx-sky); }
body.tx-dashboard :where(.stat-card, .metric-card):nth-child(4n + 4) { background: var(--tx-peach); }

/* Exam and classroom routes: polished but operationally conservative */
body.tx-exam,
body.tx-classroom {
    background: #edf2ef;
}

body.tx-exam :where(.exam-container, .question-card, .exam-card, .content-card, .main-card),
body.tx-classroom :where(.class-container, .room-panel, .participants-panel, .chat-panel, .control-panel, .main-card) {
    border: 1px solid var(--tx-line);
    border-radius: var(--tx-radius-md);
    background: rgba(255, 255, 255, .94);
    box-shadow: var(--tx-shadow-sm);
}

body.tx-exam :where(.exam-header, .question-header),
body.tx-classroom :where(.class-header, .room-header) {
    background: var(--tx-ink);
    color: #fff;
}

body.tx-exam :where(.exam-header, .question-header) :where(h1, h2, h3),
body.tx-classroom :where(.class-header, .room-header) :where(h1, h2, h3) {
    color: #fff;
}

body.tx-exam :where(.timer, .exam-timer) {
    border: 1px solid rgba(180, 35, 24, .16);
    border-radius: 999px;
    background: #fff1ef;
    color: var(--tx-danger);
    font-variant-numeric: tabular-nums;
}

/* Admin routes */
body.tx-admin {
    --tx-container: 1440px;
    background:
        linear-gradient(180deg, rgba(217, 209, 255, .4), transparent 420px),
        var(--tx-canvas);
}

body.tx-admin :where(.admin-header, .top) {
    background: var(--tx-ink);
    color: #fff;
}

body.tx-admin :where(.admin-menu) {
    border-bottom: 1px solid var(--tx-line);
    background: rgba(255, 255, 255, .86);
    backdrop-filter: blur(16px);
}

body.tx-admin :where(.menu-item) {
    border-radius: 999px;
    color: #4e5954;
}

body.tx-admin :where(.menu-item.active, .menu-item:hover) {
    background: var(--tx-pine);
    color: #fff;
}

body.tx-admin :where(.stat-card, .action-card, .card) {
    border: 1px solid var(--tx-line);
    background: rgba(255, 255, 255, .92);
}

/* Payment and subscription routes */
body.tx-payment :where(.card, .current-plan, .plan-card-sm, .sd-pcard) {
    border: 1px solid var(--tx-line);
    background: rgba(255, 255, 255, .94);
}

body.tx-payment :where(.current-plan) {
    background:
        radial-gradient(circle at 92% 8%, rgba(223, 255, 141, .8), transparent 18rem),
        #fff;
}

/* Progressive reveal only after JS has opted a page in */
body.tx-motion [data-tx-reveal] {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity .7s var(--tx-ease), transform .7s var(--tx-ease);
    transition-delay: var(--tx-delay, 0ms);
}

body.tx-motion [data-tx-reveal].tx-visible {
    opacity: 1;
    transform: none;
}

@media (max-width: 980px) {
    body.tx-design :where(.dashboard-container, .main-container, .content-container, .page-container),
    body.tx-public :where(.container) {
        width: min(100% - 28px, var(--tx-container));
    }

    body.tx-public :where(.hero-title, .hero h1, .hero-section h1, .professional-hero h1) {
        font-size: clamp(2.85rem, 11vw, 5.8rem);
    }
}

@media (max-width: 720px) {
    :root {
        --tx-radius-lg: 22px;
        --tx-radius-md: 15px;
    }

    body.tx-design {
        font-size: 15px;
    }

    body.tx-public :where(section) {
        padding-block: 68px;
    }

    body.tx-public :where(.hero-section, .professional-hero, .hero) {
        min-height: auto;
    }

    body.tx-design :where(.table-responsive, .table-container, .table-wrapper) table {
        min-width: 680px;
    }

    body.tx-design :where(.table-responsive, .table-container, .table-wrapper) {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    body.tx-design *,
    body.tx-design *::before,
    body.tx-design *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
    body.tx-motion [data-tx-reveal] {
        opacity: 1;
        transform: none;
    }
}

@media print {
    body.tx-design {
        background: #fff !important;
    }
    body.tx-design :where(.sidebar, .admin-menu, .professional-header, .app-header, .no-print) {
        display: none !important;
    }
    body.tx-design :where(.card, [class$="-card"], table) {
        box-shadow: none !important;
    }
}
