/* ============================================================================
   Socrates Homeschool Platform - Core Styles

   DESIGN PHILOSOPHY:
   - Classical education heritage meets modern digital experience
   - Scholarly authority balanced with approachable youth engagement
   - Trust for parents, excitement for students
   - Timeless wisdom presented through contemporary design

   COLOR PALETTE RATIONALE:
   --primary (Deep Oxford Blue): Authority, wisdom, classical education
   --primary-dark (Navy): Depth, seriousness, academic tradition
   --accent-gold (Refined Gold): Classical touch, achievement, excellence
   --accent-terracotta (Warm Clay): Ancient Greece, warmth, accessibility
   --sage (Muted Green): Growth, balance, classical library
   --parchment (Warm Cream): Historical documents, classical texts
   --slate (Cool Gray): Modern sophistication, readability

   TYPOGRAPHY STRATEGY:
   - Headings: Georgia (System serif with scholarly gravitas)
   - Body: System UI (Modern sans-serif with excellent readability)
   - Balance: Tradition in headings, clarity in content

   CSS STRUCTURE:
   - style.css: Shared styles (this file)
   - home.css: Home/marketing page styles
   - dashboard.css: Dashboard/user page styles
   ============================================================================ */

/* ============================================================================
   CSS CUSTOM PROPERTIES (Design Tokens)
   ============================================================================ */

:root {
    /* Extended Primary Palette */
    --primary-50: #f0f4f8;
    --primary-100: #d9e3ee;
    --primary-200: #b3c8dd;
    --primary-300: #8daccc;
    --primary-400: #5789b3;
    --primary-500: #1e3a5f;              /* Deep Oxford Blue - Base */
    --primary-600: #182e4d;
    --primary-700: #12233a;
    --primary-800: #0c1727;
    --primary-900: #060b13;

    /* Legacy color names (for compatibility) */
    --primary: #1e3a5f;
    --primary-dark: #0f1e3a;
    --primary-light: #2c5282;
    --primary-subtle: #edf2f7;

    /* Extended Gold Palette */
    --gold-50: #faf7f2;
    --gold-100: #f0e8d9;
    --gold-200: #e8d8bb;
    --gold-300: #dec59d;
    --gold-400: #d4a574;                 /* Refined Gold - Base */
    --gold-500: #c08f5a;
    --gold-600: #a47849;

    /* Legacy */
    --accent-gold: #d4a574;
    --accent-gold-dark: #b8935f;

    /* Extended Terracotta Palette */
    --terracotta-50: #fdf5f3;
    --terracotta-100: #fae5df;
    --terracotta-200: #f4c7ba;
    --terracotta-300: #eda995;
    --terracotta-400: #d67654;           /* Warm Terracotta - Base */
    --terracotta-500: #c15a3a;

    /* Legacy */
    --accent-terracotta: #d67654;

    /* Extended Sage Palette */
    --sage-50: #f5f7f5;
    --sage-100: #e6ebe5;
    --sage-200: #cdd8cb;
    --sage-300: #a7b9a4;
    --sage-400: #7a9b76;                 /* Muted Sage - Base */
    --sage-500: #5e7d5a;

    /* Legacy */
    --accent-sage: #7a9b76;

    /* Parchment */
    --parchment: #faf8f3;
    --parchment-light: #fefdfb;

    /* Neutral Colors (Enhanced) */
    --slate-900: #0f172a;
    --slate-800: #1e293b;
    --slate-700: #334155;
    --slate-600: #3f4b5c;                /* Darkened for better contrast */
    --slate-500: #5a6777;                /* Darkened for better contrast */
    --slate-400: #94a3b8;
    --slate-300: #cbd5e1;
    --slate-200: #e2e8f0;
    --slate-100: #f1f5f9;
    --slate-50: #f8fafc;

    /* Semantic Colors */
    --success: #22c55e;
    --success-light: #dcfce7;
    --success-600: #16a34a;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;

    /* Text Colors */
    --text-display: var(--primary-dark);
    --text-primary: var(--slate-900);
    --text-secondary: var(--slate-700);
    --text-muted: var(--slate-500);
    --text-emphasis: var(--gold-600);

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, var(--primary-600), var(--primary-400));
    --gradient-primary-subtle: linear-gradient(135deg, var(--primary-50), var(--primary-100));
    --gradient-gold: linear-gradient(135deg, var(--gold-400), var(--gold-600));
    --gradient-warm: linear-gradient(135deg, var(--gold-400), var(--terracotta-400));
    --gradient-nature: linear-gradient(135deg, var(--sage-400), var(--gold-400));
    --gradient-hero: radial-gradient(ellipse at top right, var(--primary-50) 0%, var(--parchment) 50%, var(--gold-50) 100%);
    --gradient-trust: linear-gradient(135deg, var(--primary-800) 0%, var(--primary-600) 50%, var(--primary-700) 100%);

    /* Typography */
    --font-serif: Georgia, "Times New Roman", serif;
    --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --font-weight-extrabold: 800;

    /* Spacing System (Extended) */
    --spacing-xs: 0.25rem;    /* 4px */
    --spacing-sm: 0.5rem;     /* 8px */
    --spacing-md: 1rem;       /* 16px */
    --spacing-lg: 1.5rem;     /* 24px */
    --spacing-xl: 2rem;       /* 32px */
    --spacing-2xl: 3rem;      /* 48px */
    --spacing-3xl: 4rem;      /* 64px */
    --spacing-4xl: 6rem;      /* 96px */
    --spacing-5xl: 8rem;      /* 128px */

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-2xl: 32px;
    --radius-full: 9999px;

    /* Shadows - Enhanced with Premium variants */
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
    --shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
    --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.12);
    --shadow-lg: 0 8px 24px rgba(15, 23, 42, 0.15);
    --shadow-xl: 0 12px 40px rgba(15, 23, 42, 0.2);
    --shadow-premium: 0 0 0 1px rgba(30, 58, 95, 0.05), 0 2px 4px rgba(30, 58, 95, 0.05), 0 12px 24px rgba(30, 58, 95, 0.1);

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 400ms cubic-bezier(0.34, 1.56, 0.64, 1);

    /* Layout */
    --container-max: 1200px;
    --container-wide: 1400px;
    --container-reading: 900px;
}

/* ============================================================================
   RESET & BASE STYLES
   ============================================================================ */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    font-weight: var(--font-weight-normal);
    line-height: 1.7;
    font-size: clamp(1rem, 0.5vw + 0.875rem, 1.125rem);
    color: var(--text-secondary);
    background: var(--parchment);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Typography Base - Fluid Sizing */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-serif);
    font-weight: var(--font-weight-bold);
    line-height: 1.2;
    color: var(--text-display);
    margin-bottom: var(--spacing-md);
}

h1 {
    font-size: clamp(2.5rem, 5vw + 1rem, 4.5rem);
    letter-spacing: -0.02em;
    line-height: 1.1;
}

h2 {
    font-size: clamp(2rem, 3vw + 1rem, 3rem);
    letter-spacing: -0.01em;
}

h3 {
    font-size: clamp(1.5rem, 2vw + 0.5rem, 2rem);
}

h4 {
    font-size: clamp(1.25rem, 1.5vw + 0.5rem, 1.625rem);
}

h5 {
    font-size: clamp(1.125rem, 1vw + 0.5rem, 1.375rem);
}

h6 {
    font-size: 1rem;
}

p {
    margin-bottom: var(--spacing-md);
    color: var(--text-secondary);
    max-width: 75ch;
}

p + p {
    margin-top: 1.5em;
}

.lead {
    font-size: clamp(1.125rem, 1vw + 1rem, 1.375rem);
    line-height: 1.75;
    color: var(--slate-600);
    font-weight: var(--font-weight-normal);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-light);
}

strong {
    font-weight: var(--font-weight-semibold);
    color: var(--slate-900);
}

/* ============================================================================
   LAYOUT & CONTAINERS
   ============================================================================ */

.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

.container-reading {
    max-width: var(--container-reading);
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

.main-content {
    flex: 1;
}

/* ============================================================================
   NAVIGATION
   ============================================================================ */

.navbar {
    background: white;
    border-bottom: 1px solid var(--slate-200);
    padding: var(--spacing-md) 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: var(--shadow-sm);
}

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

.navbar-brand {
    font-family: var(--font-serif);
    font-size: 1.75rem;
    font-weight: var(--font-weight-bold);
    color: var(--primary);
    letter-spacing: -0.01em;
    transition: color var(--transition-fast);
}

.navbar-brand:hover {
    color: var(--accent-gold-dark);
}

.navbar-menu {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
}

.nav-link {
    color: var(--slate-600);
    font-weight: var(--font-weight-medium);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    font-size: 0.9375rem;
}

.nav-link:hover {
    color: var(--primary);
    background: var(--primary-subtle);
}

.nav-user {
    color: var(--slate-500);
    font-size: 0.875rem;
    padding: 0 var(--spacing-sm);
}

.nav-logout-form {
    display: inline;
}

/* ============================================================================
   BUTTONS
   ============================================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: 0.625rem 1.5rem;
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    font-weight: var(--font-weight-semibold);
    line-height: 1.5;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition-base);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn:hover {
    text-decoration: none;
    transform: translateY(-2px);
}

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

.btn svg {
    transition: transform var(--transition-base);
}

.btn:hover svg {
    transform: translateX(3px);
}

/* Primary Button with Shimmer Effect */
.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow:
        0 4px 14px rgba(30, 58, 95, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    transition: left 0.6s ease;
}

.btn-primary:hover {
    box-shadow:
        0 8px 24px rgba(30, 58, 95, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:active {
    background: var(--gradient-primary);
    box-shadow:
        0 4px 14px rgba(30, 58, 95, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Outline Button with Gradient Border */
.btn-outline {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    border: 2px solid var(--slate-300);
    color: var(--slate-700);
    position: relative;
}

.btn-outline::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    background: var(--gradient-warm);
    opacity: 0;
    transition: opacity var(--transition-base);
    z-index: -1;
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.95);
    border-color: transparent;
}

.btn-outline:hover::before {
    opacity: 1;
}

.btn-accent {
    background: var(--accent-gold);
    color: var(--primary-dark);
    box-shadow: var(--shadow);
}

.btn-accent:hover {
    background: var(--accent-gold-dark);
    box-shadow: var(--shadow-md);
}

.btn-success {
    background: var(--success);
    color: white;
    box-shadow: var(--shadow);
}

.btn-warning {
    background: var(--warning);
    color: white;
    box-shadow: var(--shadow);
}

.btn-danger {
    background: var(--danger);
    color: white;
    box-shadow: var(--shadow);
}

.btn-sm {
    padding: 0.375rem 1rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 0.875rem 2rem;
    font-size: 1.0625rem;
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn:disabled,
.btn.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* ============================================================================
   FOOTER
   ============================================================================ */

.footer {
    background: var(--primary-dark);
    color: rgba(255, 255, 255, 0.8);
    padding: var(--spacing-2xl) 0;
    text-align: center;
    border-top: 3px solid var(--accent-gold);
}

.footer p {
    margin: 0;
    color: rgba(255, 255, 255, 0.7);
}

/* ============================================================================
   FORMS
   ============================================================================ */

.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-group label {
    display: block;
    margin-bottom: var(--spacing-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--slate-700);
    font-size: 0.9375rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.625rem 1rem;
    border: 2px solid var(--slate-200);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: var(--font-sans);
    transition: all var(--transition-fast);
    background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-subtle);
}

.form-hint {
    display: block;
    margin-top: var(--spacing-sm);
    font-size: 0.875rem;
    color: var(--slate-500);
}

.form-error {
    display: block;
    margin-top: var(--spacing-sm);
    font-size: 0.875rem;
    color: var(--danger);
    font-weight: var(--font-weight-medium);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    cursor: pointer;
}

.checkbox-label input {
    width: auto;
}

.form-actions {
    display: flex;
    gap: var(--spacing-md);
    margin-top: var(--spacing-xl);
}

.form-container {
    max-width: 500px;
}

.form-wide {
    max-width: 800px;
}

/* Password Input with Toggle */
.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper input {
    padding-right: 2.75rem;
}

.password-toggle {
    position: absolute;
    right: 0.625rem;
    background: none;
    border: none;
    padding: 0.375rem;
    cursor: pointer;
    color: var(--slate-400);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--transition-fast);
    border-radius: var(--radius-sm);
}

.password-toggle:hover {
    color: var(--slate-600);
}

.password-toggle:focus {
    outline: none;
    color: var(--primary);
}

.password-toggle:focus-visible {
    outline: 2px solid var(--accent-gold);
    outline-offset: 1px;
}

.password-toggle svg {
    display: block;
}

.password-toggle .hidden {
    display: none;
}

.form-fieldset {
    border: 2px solid var(--slate-200);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    margin: var(--spacing-xl) 0;
}

.form-fieldset legend {
    font-weight: var(--font-weight-semibold);
    padding: 0 var(--spacing-md);
    color: var(--primary);
}

.fieldset-description {
    color: var(--slate-500);
    font-size: 0.9375rem;
    margin-bottom: var(--spacing-lg);
}

/* ============================================================================
   ALERTS & BADGES
   ============================================================================ */

.alert {
    padding: var(--spacing-lg);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-lg);
    border-left: 4px solid;
}

.alert-success {
    background: var(--success-light);
    color: #166534;
    border-left-color: var(--success);
}

.alert-error {
    background: var(--danger-light);
    color: #991b1b;
    border-left-color: var(--danger);
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: var(--font-weight-semibold);
    border-radius: var(--radius-full);
    background: var(--slate-200);
    color: var(--slate-700);
}

.badge-success {
    background: var(--success-light);
    color: #166534;
}

.badge-warning {
    background: var(--warning-light);
    color: #92400e;
}

.badge-danger {
    background: var(--danger-light);
    color: #991b1b;
}

.badge-subject {
    background: var(--primary);
    color: white;
}

.badge-lg {
    padding: 0.5rem 1rem;
    font-size: 0.9375rem;
}

/* ============================================================================
   CARDS
   ============================================================================ */

.card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    border: 1px solid var(--slate-100);
}

.card-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--slate-200);
    background: var(--slate-50);
}

.card-body {
    padding: var(--spacing-lg);
}

.card-footer {
    padding: var(--spacing-lg);
    border-top: 1px solid var(--slate-200);
    background: var(--slate-50);
}

/* ============================================================================
   TABLES
   ============================================================================ */

.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.table th,
.table td {
    padding: var(--spacing-md) var(--spacing-lg);
    text-align: left;
    border-bottom: 1px solid var(--slate-200);
}

.table th {
    background: var(--slate-50);
    font-weight: var(--font-weight-semibold);
    color: var(--slate-600);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.table tbody tr:hover {
    background: var(--slate-50);
}

.table-compact th,
.table-compact td {
    padding: var(--spacing-sm) var(--spacing-md);
}

/* ============================================================================
   AUTH PAGES
   ============================================================================ */

.auth-container {
    display: flex;
    justify-content: center;
    padding: var(--spacing-3xl) 0;
}

.auth-card {
    background: white;
    padding: var(--spacing-2xl);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 440px;
    border-top: 4px solid var(--accent-gold);
}

.auth-card h1 {
    text-align: center;
    font-size: 2rem;
}

.auth-subtitle {
    text-align: center;
    color: var(--slate-500);
    margin-bottom: var(--spacing-xl);
}

.auth-footer {
    text-align: center;
    margin-top: var(--spacing-xl);
    color: var(--slate-500);
}

/* ============================================================================
   ERROR PAGES
   ============================================================================ */

.error-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

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

.error-code {
    font-size: 8rem;
    font-weight: var(--font-weight-bold);
    color: var(--slate-300);
    margin: 0;
    font-family: var(--font-serif);
}

.error-message {
    font-size: 1.375rem;
    color: var(--slate-600);
    margin-bottom: var(--spacing-2xl);
}

/* ============================================================================
   UTILITIES
   ============================================================================ */

.text-muted {
    color: var(--slate-500);
}

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

.inline-form {
    display: inline;
}

code {
    background: var(--slate-100);
    padding: 0.1875rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    color: var(--primary-dark);
    font-family: 'Consolas', 'Monaco', monospace;
}

pre.meta-json {
    font-size: 0.8125rem;
    background: var(--slate-100);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    overflow-x: auto;
    max-width: 320px;
}

details summary {
    cursor: pointer;
    color: var(--primary);
    font-weight: var(--font-weight-medium);
}

/* ============================================================================
   RESPONSIVE DESIGN
   ============================================================================ */

@media (max-width: 768px) {
    :root {
        --spacing-3xl: 3rem;
        --spacing-4xl: 4rem;
    }

    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.375rem; }

    .navbar {
        padding: var(--spacing-sm) 0;
    }

    .navbar-content {
        flex-wrap: wrap;
        gap: var(--spacing-sm);
    }

    .navbar-brand {
        font-size: 1.5rem;
        flex-shrink: 0;
    }

    .navbar-menu {
        gap: var(--spacing-xs);
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .nav-link {
        padding: var(--spacing-xs) var(--spacing-sm);
        font-size: 0.8125rem;
    }

    .nav-user {
        font-size: 0.75rem;
        display: none;
    }

    .btn-sm {
        padding: 0.25rem 0.75rem;
        font-size: 0.75rem;
    }
}

@media (max-width: 640px) {
    .navbar-content {
        padding: 0 var(--spacing-sm);
    }

    .navbar-brand {
        font-size: 1.25rem;
    }

    .navbar-menu {
        gap: 2px;
    }

    .nav-link {
        padding: 4px 6px;
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 var(--spacing-sm);
    }

    .navbar .container {
        padding: 0 var(--spacing-sm);
    }

    .navbar-brand {
        font-size: 1.125rem;
    }

    .nav-link {
        padding: 3px 4px;
        font-size: 0.6875rem;
    }

    .btn-sm {
        padding: 0.2rem 0.5rem;
        font-size: 0.6875rem;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
    }
}

/* ============================================================================
   ACCESSIBILITY
   ============================================================================ */

/* Focus visible styles for keyboard navigation */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--accent-gold);
    outline-offset: 2px;
}

/* Reduced motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --primary: #0a2540;
        --slate-700: #1e293b;
    }

    .btn,
    .card,
    .feature-card {
        border: 2px solid currentColor;
    }
}

/* ============================================================================
   LESSON ACTIVITIES
   ============================================================================ */

.lesson-activities {
    margin: var(--space-8) 0;
    padding: var(--space-6);
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
}

.lesson-activities h2 {
    margin-bottom: var(--space-2);
    color: var(--text-primary);
}

.activities-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    margin-top: var(--space-4);
}

.activity-card {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4);
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

.activity-card:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.activity-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.activity-info {
    flex: 1;
}

.activity-info h3 {
    margin: 0 0 var(--space-1) 0;
    font-size: var(--font-size-lg);
    color: var(--text-primary);
}

.activity-card .btn {
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .activity-card {
        flex-direction: column;
        text-align: center;
    }
    
    .activity-card .btn {
        width: 100%;
    }
}

/* ============================================================================
   ASSIGNMENT PAGES
   ============================================================================ */

.assignment-header {
    margin-bottom: var(--space-6);
}

.assignment-nav-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-4);
}

.assignment-instructions {
    font-size: var(--font-size-lg);
    color: var(--text-secondary);
    margin: var(--space-4) 0;
}

.assignment-meta {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

.assignment-container {
    max-width: 900px;
    margin: 0 auto;
}

/* Question Cards */
.question-card {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    margin-bottom: var(--space-6);
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--border-color);
}

.question-number {
    font-weight: var(--font-semibold);
    color: var(--primary);
    font-size: var(--font-size-lg);
}

.question-points {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

.question-text {
    font-size: var(--font-size-lg);
    font-weight: var(--font-medium);
    margin-bottom: var(--space-5);
    color: var(--text-primary);
}

.question-activity {
    margin-top: var(--space-4);
}

/* Count and Click Activity */
.count-and-click-activity .activity-image {
    text-align: center;
    margin-bottom: var(--space-5);
}

.count-and-click-activity .activity-image img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
}

.count-and-click-activity .activity-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: var(--space-3);
    max-width: 400px;
    margin: 0 auto;
}

.count-and-click-activity .option-card {
    display: block;
    padding: var(--space-4);
    text-align: center;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.count-and-click-activity .option-card:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.count-and-click-activity .option-card input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.count-and-click-activity .option-card input[type="radio"]:checked + .option-label {
    color: var(--primary);
    font-weight: var(--font-bold);
}

.count-and-click-activity .option-card input[type="radio"]:checked ~ * {
    border-color: var(--primary);
    background: var(--primary-light);
}

.count-and-click-activity .option-label {
    font-size: 2rem;
    font-weight: var(--font-semibold);
}

/* Image Multiple Choice */
.image-multiple-choice-activity {
    display: grid;
    gap: var(--space-4);
}

.image-multiple-choice-activity.layout-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.image-option-card {
    display: block;
    cursor: pointer;
    position: relative;
}

.image-option-card input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.image-option-card .image-wrapper {
    border: 3px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--space-3);
    transition: all 0.2s ease;
    background: white;
}

.image-option-card:hover .image-wrapper {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.image-option-card input[type="radio"]:checked + .image-wrapper {
    border-color: var(--primary);
    background: var(--primary-light);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.image-option-card img {
    width: 100%;
    height: auto;
    display: block;
}

/* Drag and Drop Activities */
.drag-drop-matching-activity,
.drag-drop-sorting-activity {
    padding: var(--space-4);
}

.activity-instruction {
    font-size: var(--font-size-md);
    margin-bottom: var(--space-4);
    color: var(--text-secondary);
    text-align: center;
}

.matching-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-6);
    margin-top: var(--space-4);
}

.matching-left,
.matching-right {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.matching-item,
.matching-target {
    padding: var(--space-4);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: white;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.matching-item.draggable {
    cursor: move;
    transition: all 0.2s ease;
}

.matching-item.draggable:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.matching-item.dragging {
    opacity: 0.5;
}

.matching-target.drop-zone {
    border-style: dashed;
    background: var(--bg-secondary);
}

.matching-target.drag-over {
    border-color: var(--primary);
    background: var(--primary-light);
}

.item-content,
.target-content {
    font-size: var(--font-size-lg);
    font-weight: var(--font-medium);
}

.item-image,
.target-image {
    max-width: 100%;
    height: auto;
    max-height: 80px;
}

/* Drag and Drop Sorting */
.sorting-container {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    padding: var(--space-4);
    background: var(--bg-secondary);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    min-height: 200px;
}

.sorting-item {
    padding: var(--space-4);
    background: white;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: move;
    transition: all 0.2s ease;
}

.sorting-item:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.sorting-item.dragging {
    opacity: 0.5;
}

/* Click the Image Activity */
.click-the-image-activity {
    text-align: center;
}

.clickable-image-wrapper {
    position: relative;
    display: inline-block;
    margin-bottom: var(--space-4);
}

.clickable-image {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: var(--radius-md);
}

.clickable-region {
    position: absolute;
    background: rgba(59, 130, 246, 0.1);
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.clickable-region:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: var(--primary);
}

.clickable-region[data-clicked="true"] {
    background: rgba(34, 197, 94, 0.3);
    border-color: var(--success);
}

.click-counter {
    font-size: var(--font-size-lg);
    font-weight: var(--font-medium);
    margin-top: var(--space-4);
}

.click-count {
    color: var(--primary);
    font-weight: var(--font-bold);
}

/* Assignment Actions */
.assignment-actions {
    margin-top: var(--space-8);
    padding-top: var(--space-6);
    border-top: 2px solid var(--border-color);
    text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
    .matching-container {
        grid-template-columns: 1fr;
    }

    .assignment-meta {
        flex-wrap: wrap;
    }
}

/* Image option text labels */
.image-option-card .option-text {
    text-align: center;
    margin-top: var(--space-2);
    font-weight: var(--font-medium);
    color: var(--text-primary);
}

.activity-prompt-image {
    text-align: center;
    margin-bottom: var(--space-4);
}

/* ============================================================================
   KINDERGARTEN ACTIVITY ENHANCEMENTS
   Bright, playful, touch-friendly design for 5-6 year olds
   ============================================================================ */

/* Make question cards more playful */
.question-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8faff 100%);
    border: 3px solid var(--primary-light);
    box-shadow: 0 4px 12px rgba(30, 58, 95, 0.1);
}

.question-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    padding: var(--space-3);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    margin: calc(var(--space-3) * -1) calc(var(--space-3) * -1) var(--space-4);
}

.question-number {
    font-size: 1.25rem;
    font-weight: var(--font-bold);
}

.question-text {
    font-size: 1.5rem;
    font-weight: var(--font-semibold);
    color: var(--primary-dark);
    margin-bottom: var(--space-6);
    line-height: 1.6;
}

/* Enhanced Image Multiple Choice */
.image-multiple-choice-activity {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-6);
}

.image-option-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

.image-option-card .image-wrapper {
    border: 4px solid #e0e7ff;
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    background: white;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.image-option-card .image-wrapper::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(59, 130, 246, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-option-card:hover .image-wrapper {
    border-color: #60a5fa;
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.2);
}

.image-option-card:hover .image-wrapper::before {
    opacity: 1;
}

.image-option-card input[type="radio"]:checked + .image-wrapper {
    border-color: #3b82f6;
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2), 0 8px 24px rgba(59, 130, 246, 0.3);
    transform: scale(1.05);
}

.image-option-card.selected .image-wrapper {
    border-color: #3b82f6;
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
}

.image-option-card img {
    max-width: 150px;
    max-height: 150px;
    object-fit: contain;
}

.image-option-card .option-text {
    font-size: 1.125rem;
    font-weight: var(--font-semibold);
    color: var(--primary);
    margin-top: var(--space-3);
    text-transform: capitalize;
}

/* Enhanced Click the Image */
.clickable-region {
    background: rgba(251, 191, 36, 0.15);
    border: 3px solid rgba(251, 191, 36, 0.3);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
}

.clickable-region:hover {
    background: rgba(251, 191, 36, 0.3);
    border-color: #fbbf24;
    transform: scale(1.05);
}

.clickable-region.clicked,
.clickable-region[data-clicked="true"] {
    background: rgba(34, 197, 94, 0.4);
    border-color: #22c55e;
    border-width: 4px;
}

.click-counter {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 3px solid #3b82f6;
    border-radius: var(--radius-xl);
    padding: var(--space-4) var(--space-6);
    font-size: 1.75rem;
    font-weight: var(--font-bold);
    color: var(--primary);
    display: inline-block;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.click-count {
    font-size: 2.5rem;
    color: #2563eb;
}

/* Enhanced Drag and Drop Matching */
.matching-container {
    gap: var(--space-8);
    padding: var(--space-4);
}

.matching-item {
    background: linear-gradient(135deg, #ffffff 0%, #fef3c7 100%);
    border: 4px solid #fbbf24;
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    min-height: 100px;
    font-size: 1.25rem;
    font-weight: var(--font-semibold);
    color: var(--primary-dark);
    box-shadow: 0 4px 8px rgba(251, 191, 36, 0.2);
}

.matching-item.draggable {
    cursor: grab;
}

.matching-item.draggable:active {
    cursor: grabbing;
}

.matching-item.dragging {
    opacity: 0.6;
    transform: rotate(3deg) scale(1.05);
}

.matching-target {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 4px dashed #94a3b8;
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    min-height: 100px;
    font-size: 1.25rem;
    font-weight: var(--font-semibold);
    color: var(--slate-600);
    transition: all 0.3s ease;
}

.matching-target.drag-over {
    border-color: #22c55e;
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    border-style: solid;
    transform: scale(1.05);
}

.matching-item img,
.matching-target img {
    max-width: 120px;
    max-height: 120px;
    object-fit: contain;
}

/* Enhanced Drag and Drop Sorting */
.sorting-container {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 4px dashed #fbbf24;
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    gap: var(--space-4);
}

.sorting-item {
    background: white;
    border: 4px solid #60a5fa;
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    font-size: 1.25rem;
    font-weight: var(--font-semibold);
    color: var(--primary-dark);
    box-shadow: 0 4px 8px rgba(96, 165, 250, 0.2);
}

.sorting-item.draggable {
    cursor: grab;
}

.sorting-item.draggable:active {
    cursor: grabbing;
}

.activity-instruction {
    font-size: 1.375rem;
    font-weight: var(--font-semibold);
    color: var(--primary);
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    border-left: 6px solid #3b82f6;
}

/* Large touch targets for mobile */
@media (max-width: 768px) {
    .image-option-card .image-wrapper {
        min-height: 180px;
        padding: var(--space-6);
    }

    .clickable-region {
        min-width: 80px;
        min-height: 80px;
    }

    .matching-item,
    .matching-target,
    .sorting-item {
        min-height: 120px;
        padding: var(--space-6);
        font-size: 1.5rem;
    }

    .question-text {
        font-size: 1.75rem;
    }
}

/* ============================================================================
   KINDERGARTEN ANIMATIONS
   ============================================================================ */

@keyframes bounce {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.15);
    }
}

@keyframes drop-bounce {
    0% {
        transform: translateY(-10px);
    }
    50% {
        transform: translateY(5px);
    }
    100% {
        transform: translateY(0);
    }
}

@keyframes celebrate {
    0% {
        transform: translate(-50%, -50%) scale(0) rotate(0deg);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2) rotate(180deg);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1) rotate(360deg);
        opacity: 0;
    }
}

@keyframes wiggle {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(-5deg);
    }
    75% {
        transform: rotate(5deg);
    }
}

/* Celebration overlay */
.celebration-message {
    pointer-events: none;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}
/* ============================================================================
   NEW COMPONENT SYSTEMS FOR HOME PAGE REDESIGN
   ============================================================================ */

/* ============================================================================
   UTILITY CLASSES
   ============================================================================ */

/* Text Gradient */
.text-gradient {
    background: var(--gradient-warm);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Spacing Utilities */
.space-y-sm > * + * { margin-top: 1rem; }
.space-y-md > * + * { margin-top: 1.5rem; }
.space-y-lg > * + * { margin-top: 2rem; }
.space-y-xl > * + * { margin-top: 3rem; }

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

/* Container Variants */
.container-wide {
    max-width: var(--container-wide);
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

/* ============================================================================
   BADGE SYSTEM
   ============================================================================ */

.badge-v2 {
    --badge-bg: var(--slate-100);
    --badge-color: var(--slate-700);
    --badge-radius: var(--radius-full);

    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.875rem;
    background: var(--badge-bg);
    color: var(--badge-color);
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--badge-radius);
}

.badge-v2 svg {
    width: 14px;
    height: 14px;
}

.badge-primary {
    --badge-bg: var(--gradient-primary);
    --badge-color: white;
}

.badge-gold {
    --badge-bg: var(--gradient-gold);
    --badge-color: var(--primary-dark);
}

.badge-live {
    animation: badge-pulse 2s ease infinite;
}

.badge-live::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background: var(--success);
    border-radius: 50%;
    margin-right: -0.25rem;
    animation: pulse-dot 2s ease infinite;
}

@keyframes badge-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ============================================================================
   SECTION HEADER PATTERN
   ============================================================================ */

.section-header {
    text-align: center;
    max-width: 800px;
    margin: 0 auto var(--spacing-3xl);
}

.section-eyebrow {
    display: inline-block;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--gold-600);
    margin-bottom: var(--spacing-sm);
    padding: 0.25rem 0.75rem;
    background: rgba(212, 165, 116, 0.1);
    border-radius: var(--radius-full);
}

.section-header h2 {
    margin-bottom: var(--spacing-md);
}

.section-header::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: var(--gradient-warm);
    margin: var(--spacing-lg) auto 0;
    border-radius: var(--radius-full);
}

.section-subtitle {
    font-size: 1.125rem;
    color: var(--slate-600);
    text-align: center;
    max-width: 720px;
    margin: 0 auto var(--spacing-2xl);
}

/* ============================================================================
   CARD SYSTEM V2
   ============================================================================ */

.card-v2 {
    --card-bg: white;
    --card-border: var(--slate-200);
    --card-shadow: var(--shadow);
    --card-radius: var(--radius-xl);
    --card-padding: var(--spacing-xl);

    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--card-radius);
    padding: var(--card-padding);
    box-shadow: var(--card-shadow);
    position: relative;
    overflow: hidden;
}

.card-glass {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.card-gradient-border {
    border: none;
}

.card-gradient-border::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 2px;
    background: var(--gradient-warm);
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
}

.card-premium {
    box-shadow: var(--shadow-premium);
}

/* ============================================================================
   ICON WRAPPER SYSTEM
   ============================================================================ */

.icon-wrapper {
    --icon-size: 56px;
    --icon-bg: var(--primary-subtle);
    --icon-color: var(--primary);

    width: var(--icon-size);
    height: var(--icon-size);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--icon-bg);
    color: var(--icon-color);
    border-radius: var(--radius-md);
    position: relative;
}

.icon-animated-bg {
    background: linear-gradient(135deg, var(--primary-subtle), var(--parchment));
    background-size: 200% 200%;
    animation: gradient-shift 3s ease infinite;
}

@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.icon-ring {
    box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.2);
}

.icon-sm { --icon-size: 40px; }
.icon-lg { --icon-size: 72px; }

/* ============================================================================
   TESTIMONIAL COMPONENT
   ============================================================================ */

.testimonial-card {
    background: white;
    padding: var(--spacing-2xl);
    border-radius: var(--radius-xl);
    border-left: 4px solid var(--gold-400);
    box-shadow: var(--shadow-lg);
    position: relative;
    transition: all var(--transition-base);
}

.testimonial-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-left-color: var(--gold-600);
}

.testimonial-card::before {
    content: '"';
    position: absolute;
    top: var(--spacing-lg);
    left: var(--spacing-lg);
    font-size: 4rem;
    font-family: var(--font-serif);
    color: var(--gold-400);
    opacity: 0.2;
    line-height: 1;
}

.testimonial-text {
    font-size: 1.125rem;
    font-style: italic;
    color: var(--slate-700);
    margin-bottom: var(--spacing-lg);
    position: relative;
    z-index: 1;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.author-image {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    object-fit: cover;
    border: 2px solid var(--gold-400);
}

.author-info {
    display: flex;
    flex-direction: column;
}

.author-name {
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 0.125rem;
}

.author-role {
    font-size: 0.875rem;
    color: var(--slate-500);
}

/* ============================================================================
   SCROLL ANIMATIONS
   ============================================================================ */

[data-animate] {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-animate].is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger delays */
[data-animate] {
    transition-delay: calc(var(--animation-order, 0) * 100ms);
}

/* ============================================================================
   ENHANCED FOCUS STATES (WCAG AAA)
   ============================================================================ */

:focus-visible {
    outline: 3px solid var(--gold-400);
    outline-offset: 4px;
    border-radius: 2px;
}

.btn:focus-visible {
    outline-offset: 4px;
    box-shadow:
        var(--shadow-md),
        0 0 0 4px rgba(212, 165, 116, 0.3);
}

.feature-card:focus-within,
.card-v2:focus-within {
    box-shadow:
        var(--shadow-lg),
        0 0 0 3px var(--gold-400);
}

/* ============================================================================
   ANIMATION UTILITIES
   ============================================================================ */

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slide-in-right {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes counter-pop {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================================================
   LOADING STATES
   ============================================================================ */

.btn.loading {
    pointer-events: none;
    position: relative;
    color: transparent;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin: -8px 0 0 -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.6s linear infinite;
}

/* ============================================================================
   RESPONSIVE TOUCH TARGETS (Mobile)
   ============================================================================ */

@media (max-width: 768px) {
    .btn {
        min-height: 48px;
        padding: 0.875rem 1.5rem;
    }

    .btn-sm {
        min-height: 44px;
        padding: 0.625rem 1.25rem;
    }

    .feature-card,
    .audience-card,
    .testimonial-card {
        cursor: pointer;
        -webkit-tap-highlight-color: rgba(212, 165, 116, 0.2);
    }

    .nav-link {
        min-height: 44px;
        display: flex;
        align-items: center;
        padding: 0.5rem 1rem;
    }
}

/* ============================================================================
   REDUCED MOTION
   ============================================================================ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .feature-card:hover,
    .testimonial-card:hover,
    .btn:hover {
        transform: none;
    }
}

/* ============================================================================
   HIGH CONTRAST MODE
   ============================================================================ */

@media (prefers-contrast: high) {
    :root {
        --primary: #0a2540;
        --slate-700: #1e293b;
    }

    .btn,
    .card,
    .feature-card,
    .card-v2 {
        border: 2px solid currentColor;
    }
}
