/* =========================================
   Indexburg Design System
   Brand: Calm teacher, support, professional but human.
   Colors: Teal, Navy, Linen, Beige, Plum.
   Type: Norwester, Gabriel Sans / DM Sans.
   ========================================= */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,700;1,9..40,400&family=Oswald:wght@500;700&family=Inter:wght@400;500;600;700;800&display=swap');

/* Font Face for Norwester (webfont) */
@font-face {
    font-family: 'Norwester';
    src: url('../assets/fonts/norwester.woff2') format('woff2'),
         url('../assets/fonts/norwester.woff') format('woff');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    /* --- New Brand Palette (Soft Sand & Ink) --- */
    --bg-soft: #F5EEE6;
    /* Soft Sand: Warm, open background */
    --card: #FFFFFF;
    /* White: Crisp cards */
    --ink: #111827;
    /* Ink Grey: Strong, readable text */
    --teal: #006D8B;
    /* Deep Teal: Friendly & professional primary */
    --navy: #06203B;
    /* Deep Navy: Large headings / Secondary */
    --plum: #3B133B;
    /* Muted Plum: Special highlights */
    --muted: #6B7277;
    /* Warm Grey: Metadata & UI */
    --white: #FFFFFF;
    --linen: #FCF9DA;

    /* --- Semantic Maps --- */
    --bg-page: var(--bg-soft);
    --bg-surface: var(--white);
    --text-head: var(--navy);
    /* Navy for Headlines */
    --text-body: var(--ink);
    /* Ink for Body */
    --primary: var(--teal);
    --accent: var(--plum);
    --border-subtle: rgba(107, 114, 119, 0.2);
    /* derived from muted */

    /* --- Typography --- */
    /* Use Oswald as fallback for Norwester if local font fails */
    --font-display: 'Norwester', 'Oswald', sans-serif;
    --font-body: 'DM Sans', sans-serif;
    --font-mono: 'SF Mono', 'Menlo', monospace;

    /* --- Spacing --- */
    --space-1: 8px;
    --space-2: 16px;
    --space-3: 24px;
    --space-4: 32px;
    --space-6: 48px;
    --space-8: 64px;
    --section-gap: 120px;
    /* Roomy hero/sections */

    /* --- UI Tokens --- */
    --radius-card: 12px;
    --radius-btn: 8px;
    --shadow-card: 0 6px 18px rgba(42, 56, 63, 0.06);
    --shadow-hover: 0 10px 24px rgba(0, 78, 122, 0.12);
    --transition-base: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);

    /* --- Report V3 Tokens (Strict Fidelity) --- */
    --repo-bg: hsl(0, 0%, 98%);
    --repo-card-bg: hsl(0, 0%, 100%);
    --repo-border: hsl(214, 32%, 91%);
    --repo-prim: hsl(221, 83%, 53%);
    --repo-fore: hsl(222, 47%, 11%);
    --repo-muted: hsl(215, 16%, 47%);
    --repo-metric-bg: hsl(0, 0%, 100%);
    --repo-success: hsl(142, 71%, 45%);
    --repo-error: hsl(0, 84%, 60%);
    --repo-accent: hsl(262, 83%, 58%);
    --repo-progress-bg: hsl(210, 40%, 96%);
}

/* =========================================
   Reset & Base
   ========================================= */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-body);
    font-size: 16px;
    /* Base size */
    line-height: 1.6;
    color: var(--text-body);
    background-color: var(--bg-page);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

img,
svg,
video {
    max-width: 100%;
    display: block;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-display);
    color: var(--text-head);
    margin-top: 0;
    line-height: 1.1;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

h1 {
    font-size: clamp(48px, 6vw, 72px);
    margin-bottom: var(--space-3);
}

h2 {
    font-size: clamp(32px, 4vw, 48px);
    margin-bottom: var(--space-3);
}

h3 {
    font-size: 24px;
    margin-bottom: var(--space-2);
}

p {
    margin-bottom: var(--space-3);
    color: var(--text-body);
    opacity: 0.9;
}

a {
    color: var(--teal);
    text-decoration: none;
    transition: var(--transition-base);
}

a:hover {
    color: var(--navy);
}

/* =========================================
   Layout Utilities
   ========================================= */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-3);
}

.grid {
    display: grid;
    gap: var(--space-4);
    grid-template-columns: repeat(12, 1fr);
}

.col-12 {
    grid-column: span 12;
}

.col-6 {
    grid-column: span 6;
}

.col-4 {
    grid-column: span 4;
}

.col-3 {
    grid-column: span 3;
}

.col-2 {
    grid-column: span 2;
}

/* Responsive Grid */
@media (max-width: 768px) {

    .col-6,
    .col-4,
    .col-3,
    .col-2 {
        grid-column: span 12;
    }
}

header {
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 4px 0;
    background: rgba(245, 238, 230, 0.98);
    /* Soft Sand with opacity */
    border-bottom: 1px solid rgba(17, 24, 39, 0.05);
    /* Ink transparent */
}

.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-display);
    font-size: 24px;
    color: var(--navy);
    font-weight: 700;
    text-transform: uppercase;
    text-decoration: none;
    margin-left: -18px;
    /* Ensure no underline */
}

.logo img {
    height: 92px;
    width: auto;
    max-width: 460px;
    display: block;
}

.logo.logo-fallback .logo-text {
    position: static;
    width: auto;
    height: auto;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

.logo-icon {
    color: var(--teal);
    font-size: 24px;
}

.nav-links {
    display: flex;
    gap: var(--space-3);
    align-items: center;
    margin-left: auto;
    padding-right: 18px;
}

.header-login {
    display: inline-flex;
    margin-left: 31px;
    margin-right: -13px;
}

.nav-links a {
    font-weight: 500;
    color: var(--navy);
    font-size: 18px;
}

.nav-links a:hover {
    color: var(--teal);
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    /* Simplified for MVP - Mobile Menu TODO */
    .mobile-menu-btn {
        display: block;
    }
}

@media (max-width: 768px) {
    html,
    body {
        overflow-x: hidden;
        width: 100%;
    }

    body {
        padding-top: 0;
    }

    header {
        position: static;
        top: auto;
        padding: 8px 0;
    }

    .nav-wrapper {
        flex-wrap: wrap;
        gap: 10px 12px;
    }

    .logo {
        font-size: 20px;
        gap: 6px;
        flex: 1 1 auto;
        min-width: 0;
        margin-left: 0;
    }

    .logo img {
        height: 64px;
        max-width: 100%;
    }

    .logo-text {
        max-width: 60vw;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .header-login {
        padding: 10px 16px;
        font-size: 14px;
        flex-shrink: 0;
        margin: 0 auto;
    }

    body:not(.home-page) .header-login {
        display: none !important;
    }

    .home-page .header-login {
        display: inline-flex !important;
    }

    .container {
        padding: 0 20px;
    }

    section {
        padding: 72px 0;
    }

    .section-hero {
        padding-top: 72px;
    }

    .hero-tagline {
        font-size: 12px;
        letter-spacing: 0.08em;
    }

    .btn {
        width: 100%;
        max-width: 360px;
    }

    .hero-cta {
        flex-direction: column;
        align-items: center;
    }

    footer a {
        white-space: normal !important;
        word-break: break-word;
    }

    footer .grid {
        grid-template-columns: 1fr;
        row-gap: 24px;
    }

    .faq-question {
        flex-wrap: wrap;
        gap: 12px;
        align-items: flex-start;
    }

    .faq-question::after {
        margin-left: auto;
    }

    .faq-answer {
        max-width: 100%;
    }

    .about-content,
    .legal-content {
        overflow-wrap: anywhere;
    }

    .repo-table-header.repo-grid-assignments,
    .repo-table-header.repo-grid-attendance,
    .repo-row.repo-grid-assignments,
    .repo-row.repo-grid-attendance {
        grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 0.8fr);
        column-gap: 12px;
    }

    .repo-row > *,
    .repo-table-header > * {
        min-width: 0;
        word-break: break-word;
    }

    .repo-cell-status {
        justify-content: flex-end;
    }

    .repo-badge {
        white-space: normal;
        text-align: center;
        line-height: 1.2;
    }
}

@media (max-width: 520px) {
    h1 {
        font-size: clamp(34px, 11vw, 44px);
    }

    h2 {
        font-size: clamp(26px, 8vw, 34px);
    }

    p {
        font-size: 15px;
    }

    .section-hero {
        padding-top: 96px;
    }

    .report-preview-wrapper {
        margin-top: 40px;
        padding-bottom: 24px;
    }

    .report-mockup {
        padding: 16px;
    }

    .repo-metric-value {
        font-size: 22px;
    }

    .repo-th {
        font-size: 10px;
    }

    .repo-cell-main {
        font-size: 13px;
    }

    .repo-cell-date {
        font-size: 12px;
    }

    .repo-header-v3 {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .repo-badge {
        max-width: 100%;
        white-space: normal;
    }
}

footer {
    background-color: var(--navy);
    color: #FCF9DA;
    /* Linen */
    padding: var(--space-8) 0;
    font-size: 14px;
}

footer p,
footer a {
    max-width: 100%;
    overflow-wrap: anywhere;
}

@media (max-width: 520px) {
    footer {
        padding-left: 16px;
        padding-right: 16px;
    }

    footer .container {
        padding-left: 0;
        padding-right: 0;
    }
}

footer a {
    color: #FCF9DA;
    /* Full solid Linen */
    opacity: 0.8;
}

footer a:hover {
    opacity: 1;
    color: #FFFFFF;
}

footer h4 {
    color: #FCF9DA;
    font-size: 16px;
    margin-bottom: var(--space-2);
}

/* =========================================
   Components
   ========================================= */

/* Buttons */
/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: var(--radius-btn);
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition-base);
    border: 2px solid transparent;
    /* default border width for sizing */
    line-height: 1.2;
}

.btn:active {
    transform: translateY(1px);
}

/* Primary: Teal BG, White Text */
.btn-primary {
    background-color: var(--teal);
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(0, 109, 139, 0.2);
}

.btn-primary:hover {
    background-color: #005670;
    /* Darker teal */
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

/* Secondary: Card BG, Teal Border, Navy Text */
.btn-secondary {
    background-color: var(--card);
    color: var(--navy) !important;
    border-color: var(--teal);
}

.btn-secondary:hover {
    background-color: var(--teal);
    color: #ffffff !important;
}

.btn-ghost {
    background: transparent;
    color: var(--teal) !important;
}

.btn-ghost:hover {
    background: rgba(0, 109, 139, 0.05);
    /* slightly teal tint */
}

/* Cards */
/* Cards (Refined) */
.card {
    background: var(--white);
    border-radius: var(--radius-card);
    padding: var(--space-4);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    /* Softer shadow */
    transition: var(--transition-base);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 109, 139, 0.2);
    /* subtle teal hint */
}

/* Exclusive Card (Premium) */
.card-exclusive {
    background-color: var(--navy);
    color: var(--linen);
    border: 1px solid rgba(252, 249, 218, 0.1);
    box-shadow: 0 20px 40px -10px rgba(2, 32, 77, 0.4);
}

.card-exclusive h2 {
    color: var(--linen);
}

.card-exclusive p {
    color: #FFFFFF !important;
    opacity: 1 !important;
}

.card-exclusive .btn {
    background-color: var(--teal);
    color: #ffffff !important;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.card-exclusive .btn:hover {
    background-color: #0085aa;
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.card h3 {
    font-family: var(--font-display);
    color: var(--navy);
    font-size: 20px;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.card p {
    font-size: 15px;
    color: var(--ink);
    /* Stronger text */
    opacity: 1;
}

.card-icon {
    width: 48px;
    height: 48px;
    background: rgba(0, 109, 139, 0.12);
    /* Slightly stronger bg */
    color: var(--teal);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-3);
    font-size: 24px;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-plum {
    background: var(--plum);
    color: var(--linen);
}

/* Inputs */
input,
textarea,
select {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #e6e6e6;
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--warm-grey);
    background: var(--white);
    transition: var(--transition-base);
}

input:focus,
textarea:focus {
    outline: none;
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(0, 78, 122, 0.12);
}

/* =========================================
   Sections
   ========================================= */
section {
    padding: var(--section-gap) 0;
}

.section-hero {
    padding-top: 140px;
    /* Header offset */
    text-align: center;
}

.hero-tagline {
    font-family: var(--font-body);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--teal);
    font-weight: 700;
    margin-bottom: var(--space-2);
    display: block;
}

/* =========================================
   REPORT MOCKUP (V3 Fidelity)
   Do Not Edit - Backend Sync
   ========================================= */
.report-preview-wrapper {
    margin-top: 64px;
    display: flex;
    justify-content: center;
    perspective: 1200px;
    padding-bottom: 40px;
}

.report-mockup {
    width: 100%;
    max-width: 850px;
    background-color: var(--repo-bg);
    padding: 40px;
    border-radius: 2px;
    /* Paper-like */
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
    text-align: left;
    font-family: 'Inter', sans-serif;
    /* Keep Inter for reports */
    color: var(--repo-fore);
    position: relative;
    border: 1px solid #f0f0f5;
}

.repo-header-v3 {
    margin-bottom: 40px;
    padding-bottom: 24px;
    border-bottom: 2px solid var(--repo-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.repo-label-small {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
    color: var(--repo-muted);
    margin-bottom: 4px;
}

.repo-student-name {
    font-size: 32px;
    font-weight: 800;
    color: var(--repo-fore);
    line-height: 1.1;
    margin-bottom: 4px;
}

.repo-student-subtitle {
    font-size: 15px;
    font-weight: 500;
    color: var(--repo-muted);
}

.repo-metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.repo-metric-card {
    background: var(--repo-metric-bg);
    border: 1px solid var(--repo-border);
    border-radius: 12px;
    padding: 20px;
}

.repo-metric-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--repo-muted);
    margin-bottom: 8px;
}

.repo-metric-value {
    font-size: 26px;
    font-weight: 800;
    color: var(--repo-fore);
    margin-bottom: 4px;
}

.repo-text-success {
    color: var(--repo-success);
}

.repo-metric-sub {
    font-size: 12px;
    color: var(--repo-muted);
    margin-bottom: 12px;
}

.repo-prog-cont {
    height: 6px;
    background: var(--repo-progress-bg);
    border-radius: 999px;
    overflow: hidden;
    margin-top: 12px;
}

.repo-prog-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--repo-prim), var(--repo-accent));
    border-radius: 999px;
}

.repo-table-section {
    margin-bottom: 32px;
}

.repo-section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--repo-fore);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.repo-section-title::before {
    content: '';
    display: block;
    width: 4px;
    height: 18px;
    background: var(--repo-prim);
    border-radius: 2px;
}

.repo-modern-table {
    background: var(--repo-card-bg);
    border: 1px solid var(--repo-border);
    border-radius: 12px;
    overflow: hidden;
}

.repo-table-header {
    display: grid;
    padding: 12px 20px;
    background: #f1f5f9;
    border-bottom: 1px solid var(--repo-border);
}

.repo-th {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--repo-muted);
}

.repo-row {
    display: grid;
    padding: 14px 20px;
    border-bottom: 1px solid var(--repo-border);
    align-items: center;
}

.repo-row:last-child {
    border-bottom: none;
}

.repo-row-alt {
    background: #f8fafc;
}

.repo-cell-main {
    font-weight: 600;
    color: var(--repo-fore);
    font-size: 14px;
}

.repo-cell-date {
    color: var(--repo-muted);
    font-size: 13px;
}

.repo-cell-status {
    display: flex;
    justify-content: center;
}

.text-center {
    text-align: center;
}

.repo-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}

.repo-badge-success {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.repo-badge-primary {
    background: #e0e7ff;
    color: #4338ca;
    border: 1px solid #c7d2fe;
}

.repo-badge-error {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

/* Grid Specializations */
.repo-grid-assignments {
    grid-template-columns: 2fr 1fr 1fr;
}

.repo-grid-attendance {
    grid-template-columns: 2fr 1fr 1fr;
}

.repo-table-header.repo-grid-assignments {
    grid-template-columns: 2fr 1fr 1fr;
}

.repo-table-header.repo-grid-attendance {
    grid-template-columns: 2fr 1fr 1fr;
}

/* Highlight/Standout for Exams (User Request) */
.repo-section-title.repo-section-title-highlight {
    color: var(--repo-prim);
}

.repo-modern-table.repo-modern-table-highlight {
    border: 2px solid var(--repo-prim);
    box-shadow: 0 4px 12px hsla(221, 83%, 53%, 0.1);
}

.repo-modern-table-highlight .repo-table-header {
    background: hsla(221, 83%, 53%, 0.08);
    border-bottom: 1px solid hsla(221, 83%, 53%, 0.2);
}

.repo-modern-table-highlight .repo-th {
    color: var(--repo-prim);
    opacity: 1;
}

.repo-modern-table-highlight .repo-row-alt {
    background: hsla(221, 83%, 53%, 0.03);
}

@media (max-width: 768px) {
    .repo-metrics-grid {
        grid-template-columns: 1fr;
    }

    .repo-row,
    .repo-table-header {
        padding: 12px;
    }

    .report-mockup {
        padding: 20px;
    }
}
