/* ==========================================================================
   tests.com — Main Stylesheet
   Vanilla CSS, mobile-first, CSS custom properties for theming.
   ========================================================================== */

/* === CUSTOM PROPERTIES === */
:root {
    /* Colors */
    --color-primary:     #1a365d;
    --color-primary-light: #2d4a7a;
    --color-secondary:   #b4bef8;
    --color-secondary-light: #a5b1f6;
    --color-accent:      #f59e0b;
    --color-bg:          #f8fafc;
    --color-bg-white:    #ffffff;
    --color-text:        #1e293b;
    --color-text-muted:  #64748b;
    --color-text-light:  #94a3b8;
    --color-border:      #e2e8f0;
    --color-border-light:#f1f5f9;
    --color-success:     #10b981;
    --color-success-bg:  #ecfdf5;
    --color-warning:     #f97316;
    --color-warning-bg:  #fff7ed;
    --color-error:       #ef4444;
    --color-error-bg:    #fef2f2;
    --color-info:        #3b82f6;
    --color-info-bg:     #eff6ff;

    /* Score colors */
    --score-high:        #10b981;
    --score-medium:      #f59e0b;
    --score-low:         #f97316;
    --score-very-low:    #ef4444;

    /* Typography */
    --font-sans: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: "SF Mono", "Fira Code", "Fira Mono", "Roboto Mono", monospace;

    /* Spacing */
    --space-xs:  4px;
    --space-sm:  8px;
    --space-md:  16px;
    --space-lg:  24px;
    --space-xl:  32px;
    --space-2xl: 48px;
    --space-3xl: 64px;

    /* Borders */
    --radius-sm:  6px;
    --radius-md:  8px;
    --radius-lg:  12px;
    --radius-xl:  16px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm:  0 1px 2px rgba(0,0,0,0.05);
    --shadow-md:  0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
    --shadow-lg:  0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.05);
    --shadow-xl:  0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.05);

    /* Layout */
    --max-width: 1200px;
    --nav-height: 64px;
}

/* === RESET & BASE === */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    overflow-x: hidden;
}

body {
    font-family: var(--font-sans);
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

img { max-width: 100%; height: auto; }
a { color: #6366f1; text-decoration: none; transition: color 0.2s; }
a:hover { color: #4f46e5; }
strong { font-weight: 600; }

/* === TYPOGRAPHY === */
h1, h2, h3, h4 { color: var(--color-primary); line-height: 1.3; font-weight: 700; }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.125rem; }

.text-muted { color: var(--color-text-muted); }
.text-warning { color: var(--color-warning); }
.text-center { text-align: center; }
.text-large { font-size: 1.125rem; }
.required { color: var(--color-error); }

/* === CONTAINER === */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

/* === NAVIGATION === */
.main-nav {
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(226,232,240,0.6);
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--nav-height);
}

.nav-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--color-primary);
}
.nav-logo:hover { color: var(--color-primary); }
.logo-icon { font-size: 1.5rem; }

.nav-links {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.nav-links a {
    color: var(--color-text);
    font-weight: 500;
    font-size: 0.9375rem;
    transition: color 0.2s;
    padding: var(--space-xs) 0;
    border-bottom: 2px solid transparent;
}
.nav-links a:hover,
.nav-links a.active {
    color: var(--color-primary);
    border-bottom-color: #6366f1;
}
.nav-links .btn {
    border-bottom: none;
    padding: 8px 18px;
    font-size: 0.875rem;
    color: #fff;
}
.nav-logout { color: var(--color-text-light) !important; }

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-sm);
}
.nav-toggle span {
    width: 24px;
    height: 2px;
    background: var(--color-text);
    border-radius: 1px;
    transition: transform 0.2s;
}

/* === MAIN CONTENT === */
.main-content {
    flex: 1;
}

/* === FLASH MESSAGES === */
.flash-container {
    position: fixed;
    top: calc(var(--nav-height) + var(--space-md));
    right: var(--space-lg);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    max-width: 400px;
}

.flash {
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    font-size: 0.9375rem;
    animation: slideIn 0.3s ease;
    box-shadow: var(--shadow-lg);
}

.flash-success { background: var(--color-success-bg); color: #065f46; border-left: 4px solid var(--color-success); }
.flash-error   { background: var(--color-error-bg);   color: #991b1b; border-left: 4px solid var(--color-error); }
.flash-warning { background: var(--color-warning-bg); color: #9a3412; border-left: 4px solid var(--color-warning); }
.flash-info    { background: var(--color-info-bg);    color: #1e40af; border-left: 4px solid var(--color-info); }

.flash-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    opacity: 0.6;
    color: inherit;
}
.flash-close:hover { opacity: 1; }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}

/* === BUTTONS === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    line-height: 1.4;
    gap: var(--space-sm);
}
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: #6366f1;
    color: #ffffff;
    border: none;
    box-shadow: 0 6px 24px rgba(99,102,241,0.35), 0 2px 8px rgba(99,102,241,0.15);
}
.btn-primary:hover:not(:disabled) {
    background: #4f46e5;
    color: #ffffff;
    box-shadow: 0 10px 32px rgba(99,102,241,0.42), 0 4px 12px rgba(99,102,241,0.2);
    transform: translateY(-2px);
}

.btn-outline {
    background: rgba(255,255,255,0.55);
    color: #334155;
    border: none;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.04);
}
.btn-outline:hover:not(:disabled) {
    background: rgba(255,255,255,0.75);
    color: #1e293b;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.05);
    transform: translateY(-1px);
}

.btn-ghost {
    background: transparent;
    color: var(--color-text-muted);
    border-color: transparent;
    padding: 6px 12px;
}
.btn-ghost:hover { color: var(--color-text); background: var(--color-border-light); }

.btn-sm { padding: 6px 14px; font-size: 0.8125rem; }
.btn-lg { padding: 14px 28px; font-size: 1.0625rem; border-radius: var(--radius-lg); }
.btn-block { width: 100%; }

/* === FORMS === */
.form-group {
    margin-bottom: var(--space-lg);
}

.form-group label {
    display: block;
    margin-bottom: var(--space-xs);
    font-weight: 500;
    font-size: 0.9375rem;
    color: var(--color-text);
}

.form-control,
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    font-family: var(--font-sans);
    color: var(--color-text);
    background: var(--color-bg-white);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-control:focus,
.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

.form-control::placeholder,
.form-group input::placeholder {
    color: var(--color-text-light);
}

.form-check label {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    cursor: pointer;
    font-weight: 400;
}

.form-check input[type="checkbox"] {
    margin-top: 3px;
    accent-color: #6366f1;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

.form-stack {
    display: flex;
    flex-direction: column;
}

.form-info {
    background: var(--color-info-bg);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-lg);
    font-size: 0.875rem;
    color: #1e40af;
}

.search-form {
    display: flex;
    gap: var(--space-sm);
}
.search-form .form-control { flex: 1; }

/* === CARDS === */
.card {
    background: var(--color-bg-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-lg);
    box-shadow: var(--shadow-sm);
}

.card-header {
    padding: var(--space-lg);
    border-bottom: 1px solid var(--color-border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.card-header h2 { font-size: 1.125rem; margin: 0; }

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

/* === TABLES === */
.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}
.data-table th,
.data-table td {
    padding: var(--space-md);
    text-align: left;
    border-bottom: 1px solid var(--color-border-light);
    font-size: 0.9375rem;
}
.data-table th {
    font-weight: 600;
    color: var(--color-text-muted);
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.data-table tbody tr:hover {
    background: var(--color-border-light);
}

/* === AUTH PAGES === */
.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - var(--nav-height) - 80px);
    padding: var(--space-2xl) var(--space-lg);
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--color-bg-white);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    box-shadow: var(--shadow-lg);
}

.auth-title {
    font-size: 1.75rem;
    margin-bottom: var(--space-xs);
}

.auth-subtitle {
    color: var(--color-text-muted);
    margin-bottom: var(--space-xl);
}

.auth-form { margin-top: var(--space-lg); }

.auth-switch {
    text-align: center;
    margin-top: var(--space-lg);
    color: var(--color-text-muted);
    font-size: 0.9375rem;
}

/* Auth divider ("or") */
.auth-divider {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin: var(--space-lg) 0;
    color: var(--color-text-muted);
    font-size: 0.875rem;
}
.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--color-border);
}

/* Google Sign-In button wrapper */
.google-btn-wrapper {
    display: flex;
    justify-content: center;
}

/* Fallback Google button (shown when GIS can't render) */
.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 11px 16px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-bg-white);
    color: var(--color-text);
    font-size: 0.9375rem;
    font-weight: 500;
    font-family: inherit;
    cursor: not-allowed;
    opacity: 0.65;
    transition: opacity 0.2s;
}

/* === DASHBOARD === */
.dashboard-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--space-xl) var(--space-lg);
}

.dashboard-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: var(--space-xl);
    flex-wrap: wrap;
    gap: var(--space-md);
}
.dashboard-header h1 { margin-bottom: var(--space-xs); }

.tier-banner {
    background: var(--color-info-bg);
    border: 1px solid #bfdbfe;
    border-radius: var(--radius-md);
    padding: var(--space-md) var(--space-lg);
    margin-bottom: var(--space-xl);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    font-size: 0.9375rem;
    color: #1e40af;
    flex-wrap: wrap;
}

/* === STATS GRID === */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.stat-card {
    background: var(--color-bg-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: var(--space-xs);
}

.stat-card-warning { border-color: var(--color-warning); }
.stat-card-warning .stat-value { color: var(--color-warning); }

/* === SHARE LINK === */
.share-link-box {
    display: flex;
    gap: var(--space-sm);
}
.share-link-box input {
    flex: 1;
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    background: var(--color-border-light);
}

/* === SCORE & STATUS BADGES === */
.score-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.875rem;
}
.score-high     { background: #ecfdf5; color: #065f46; }
.score-medium   { background: #fef3c7; color: #92400e; }
.score-low      { background: #fff7ed; color: #9a3412; }
.score-very-low { background: #fef2f2; color: #991b1b; }
.score-none     { background: var(--color-border-light); color: var(--color-text-muted); }

.status-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-size: 0.8125rem;
    font-weight: 500;
}
.status-completed  { background: #ecfdf5; color: #065f46; }
.status-flagged    { background: #fef2f2; color: #991b1b; }
.status-pending    { background: #fef3c7; color: #92400e; }
.status-started    { background: var(--color-info-bg); color: #1e40af; }
.status-in_progress { background: var(--color-info-bg); color: #1e40af; }
.status-expired    { background: var(--color-border-light); color: var(--color-text-muted); }
.status-timed_out  { background: #fff7ed; color: #9a3412; }

.ai-flag { font-size: 0.875rem; font-weight: 500; }
.ai-flag-warning { color: var(--color-warning); }
.ai-flag-clear   { color: var(--color-success); }

/* === RESULTS PAGE === */
.result-overview {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: var(--space-2xl);
    align-items: center;
    background: var(--color-bg-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-2xl);
    margin-bottom: var(--space-xl);
}

.result-score-main { text-align: center; }

.score-circle {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-md);
    border: 6px solid;
}
.score-circle-high     { border-color: var(--score-high);     background: #ecfdf5; }
.score-circle-medium   { border-color: var(--score-medium);   background: #fef3c7; }
.score-circle-low      { border-color: var(--score-low);      background: #fff7ed; }
.score-circle-very-low { border-color: var(--score-very-low); background: #fef2f2; }
.score-circle-none     { border-color: var(--color-border);   background: var(--color-border-light); }

.score-value { font-size: 2.5rem; font-weight: 700; color: var(--color-primary); }
.score-unit  { font-size: 1.25rem; color: var(--color-text-muted); }
.score-label { font-size: 0.875rem; color: var(--color-text-muted); }

.result-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
}

.meta-item { display: flex; flex-direction: column; gap: var(--space-xs); }
.meta-label { font-size: 0.8125rem; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.05em; }

/* Category bars */
.category-bars { display: flex; flex-direction: column; gap: var(--space-lg); }
.category-bar-header { display: flex; justify-content: space-between; margin-bottom: var(--space-xs); font-size: 0.9375rem; }
.category-bar-label  { font-weight: 500; }
.category-bar-value  { font-weight: 600; }

.progress-bar {
    height: 12px;
    background: var(--color-border-light);
    border-radius: var(--radius-full);
    overflow: hidden;
}
.progress-bar-fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 0.8s ease;
}
.progress-high     { background: var(--score-high); }
.progress-medium   { background: var(--score-medium); }
.progress-low      { background: var(--score-low); }
.progress-very-low { background: var(--score-very-low); }
.progress-none     { background: var(--color-border); }

/* Flag list */
.flag-list { list-style: none; }
.flag-item { padding: var(--space-md); border-radius: var(--radius-md); margin-bottom: var(--space-sm); }
.flag-item-warning { background: var(--color-warning-bg); color: #9a3412; }

/* Monitoring grid */
.monitoring-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-lg);
}
.monitoring-item { display: flex; flex-direction: column; gap: var(--space-xs); }
.monitoring-label { font-size: 0.8125rem; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.monitoring-value { font-size: 1.25rem; font-weight: 600; }

/* Premium teaser */
.card-premium-teaser { border-style: dashed; }
.premium-teaser { text-align: center; padding: var(--space-xl); }
.premium-teaser h3 { color: var(--color-text-muted); margin-bottom: var(--space-md); }

/* Alert */
.alert {
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-xl);
    font-size: 0.9375rem;
}
.alert-warning { background: var(--color-warning-bg); color: #9a3412; border-left: 4px solid var(--color-warning); }

/* Plan badge */
.plan-badge { display: inline-block; padding: 4px 12px; border-radius: var(--radius-full); font-weight: 600; font-size: 0.875rem; }
.plan-free    { background: var(--color-info-bg); color: #1e40af; }
.plan-premium { background: #ecfdf5; color: #065f46; }
.plan-info    { margin-bottom: var(--space-md); }

/* === HERO SECTION === */
.hero {
    display: block;
    overflow: visible;
    background: transparent;
    padding: 0;
    min-height: auto;
    color: var(--color-text);
}
.hero-wrapper {
    max-width: var(--max-width);
    margin: 24px auto 0;
    padding: 0 var(--space-lg);
}
.hero-card {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 480px;
    border-radius: 24px;
    overflow: hidden;
    background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
    box-shadow: 0 4px 30px rgba(0,0,0,0.08);
}
.hero-img {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 55%;
    z-index: 0;
}
.hero-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    clip-path: polygon(18% 0, 100% 0, 100% 100%, 0% 100%);
    border-radius: 0 24px 24px 0;
}
.hero-inner {
    flex: 0 0 45%;
    max-width: 460px;
    padding: 48px 0 48px 48px;
    position: relative;
    z-index: 1;
}
.hero-eyebrow {
    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 20px;
    color: #6366f1;
}
.hero h1 {
    font-size: 2.75rem;
    color: #0f172a;
    margin-bottom: var(--space-lg);
    line-height: 1.1;
    font-weight: 700;
    overflow-wrap: break-word;
    word-wrap: break-word;
}
.text-gradient {
    background: linear-gradient(135deg, #7c3aed, #06b6d4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero-subtitle {
    font-size: 1.0625rem;
    color: #64748b;
    margin-bottom: 36px;
    line-height: 1.7;
    max-width: 480px;
}
.hero-actions {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 8px;
    align-items: center;
}
.hero-actions .btn {
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.hero-actions .btn-primary {
    font-size: 1rem;
    font-weight: 700;
    padding: 16px 36px;
    border-radius: 12px;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: #fff;
    box-shadow: 0 4px 14px rgba(99,102,241,0.35);
}
.hero-actions .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(99,102,241,0.45);
}
.hero-actions .btn-outline {
    background: rgba(255,255,255,0.8);
    color: #1e293b;
    border: 1.5px solid rgba(15, 23, 42, 0.15);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.04);
    font-weight: 600;
    padding: 14px 28px;
    border-radius: var(--radius-md);
}
.hero-actions .btn-outline:hover {
    background: rgba(255,255,255,0.95);
    color: #1e293b;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.05);
    transform: translateY(-1px);
}
.hero-actions .btn:focus-visible {
    outline: 3px solid rgba(99,102,241,0.55);
    outline-offset: 2px;
}
.hero-note {
    margin-top: var(--space-lg);
    font-size: 0.875rem;
    color: #94a3b8;
    line-height: 1.4;
}

/* === FEATURES SECTION === */
.features {
    padding: 48px var(--space-lg) 80px;
    background: var(--color-bg);
    overflow: visible;
}
.section-title {
    text-align: center;
    margin-bottom: 36px;
    font-size: 2rem;
}
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 28px;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
    align-items: stretch;
}
.feature-card {
    background: var(--color-bg-white);
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 14px;
    padding: 28px 26px 32px;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
    height: auto;
    min-height: 260px;
    overflow: visible;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.09);
    display: flex;
    flex-direction: column;
    align-items: center;
}
.feature-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
}
.feature-icon { font-size: 2.75rem; margin-bottom: var(--space-md); display: block; height: 48px; line-height: 48px; }
.feature-card h3 { margin: 16px 0 12px; font-size: 1.1875rem; font-weight: 700; color: var(--color-primary); letter-spacing: -0.01em; }
.feature-card p { color: rgba(15, 35, 66, 0.72); font-size: 0.9375rem; line-height: 1.6; overflow: visible; max-height: none; }

/* === HOW IT WORKS === */
.how-it-works {
    background: var(--color-bg-white);
    padding: var(--space-3xl) var(--space-lg);
}
.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-xl);
    max-width: var(--max-width);
    margin: 0 auto;
}
.step { text-align: center; }
.step-number {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #6366f1;
    color: #fff;
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-md);
}
.step h3 { margin-bottom: var(--space-sm); }
.step p { color: var(--color-text-muted); font-size: 0.9375rem; }

/* === PRICING === */
.pricing {
    padding: var(--space-3xl) var(--space-lg);
}
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-xl);
    max-width: 1100px;
    margin: 0 auto;
}
.pricing-card {
    background: var(--color-bg-white);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    text-align: center;
    position: relative;
    display: flex;
    flex-direction: column;
}
.pricing-card-featured {
    border-color: #6366f1;
    box-shadow: var(--shadow-lg);
}
.pricing-badge {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    background: #6366f1;
    color: #fff;
    padding: 4px 16px;
    border-radius: var(--radius-full);
    font-size: 0.8125rem;
    font-weight: 600;
}
.pricing-tier {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: var(--space-md);
}
.pricing-price {
    font-size: 3rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: var(--space-xl);
}
.pricing-price span {
    font-size: 1rem;
    color: var(--color-text-muted);
    font-weight: 400;
}
.pricing-features {
    list-style: none;
    text-align: left;
    margin-bottom: var(--space-xl);
    flex: 1;
}
.pricing-card > .btn {
    margin-top: auto;
}
.pricing-features li {
    padding: var(--space-sm) 0;
    font-size: 0.9375rem;
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
}
.pricing-features li::before { font-size: 1rem; }
.pricing-features .included::before { content: "✓"; color: var(--color-success); font-weight: 700; }
.pricing-features .excluded::before { content: "—"; color: var(--color-text-light); }
.pricing-features .excluded { color: var(--color-text-light); }

/* === CTA SECTION === */
.cta-section {
    background: linear-gradient(135deg, #eef2ff 0%, #f5f3ff 50%, #f0f9ff 100%);
    color: var(--color-text);
    padding: var(--space-3xl) var(--space-lg);
    text-align: center;
}
.cta-section h2 { color: #0f172a; font-size: 2rem; margin-bottom: var(--space-md); }
.cta-section p { color: var(--color-text-muted); font-size: 1.125rem; margin-bottom: var(--space-xl); }

/* === TEST WELCOME PAGE === */
.test-welcome-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - var(--nav-height) - 80px);
    padding: var(--space-2xl) var(--space-lg);
}

.test-welcome-card {
    width: 100%;
    max-width: 600px;
    background: var(--color-bg-white);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    box-shadow: var(--shadow-lg);
}

.test-welcome-header {
    text-align: center;
    margin-bottom: var(--space-xl);
}
.test-icon { font-size: 3rem; display: block; margin-bottom: var(--space-md); }
.test-welcome-header h1 { margin-bottom: var(--space-sm); }

.test-instructions h2 { font-size: 1.125rem; margin-bottom: var(--space-md); }
.test-instructions ul {
    margin-bottom: var(--space-lg);
    padding-left: var(--space-lg);
}
.test-instructions li {
    padding: var(--space-xs) 0;
    font-size: 0.9375rem;
}

.test-warning {
    background: var(--color-warning-bg);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    margin-bottom: var(--space-xl);
    font-size: 0.875rem;
    color: #9a3412;
}
.test-warning ul { margin-top: var(--space-sm); padding-left: var(--space-lg); }

.test-start-form { margin-top: var(--space-xl); }
.welcome-name { font-size: 1.125rem; margin-bottom: var(--space-lg); }

/* === TEST TAKING PAGE === */
.test-container {
    max-width: 800px;
    margin: 0 auto;
    padding: var(--space-lg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.test-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: var(--space-lg);
}

.test-brand {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-weight: 600;
    color: var(--color-primary);
}

.test-timer {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--color-border-light);
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 1.125rem;
    font-family: var(--font-mono);
    color: var(--color-primary);
}
.test-timer.timer-warning { background: var(--color-warning-bg); color: var(--color-warning); }
.test-timer.timer-danger  { background: var(--color-error-bg); color: var(--color-error); animation: pulse 1s infinite; }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.6; }
}

/* Progress */
.test-progress {
    position: relative;
    height: 8px;
    background: var(--color-border-light);
    border-radius: var(--radius-full);
    margin-bottom: var(--space-xl);
    overflow: visible;
}
.test-progress-bar {
    height: 100%;
    background: #6366f1;
    border-radius: var(--radius-full);
    transition: width 0.3s;
}
.test-progress-text {
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

/* Question area */
.test-question-area {
    flex: 1;
    margin-bottom: var(--space-xl);
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
}
.question-number {
    font-weight: 600;
    color: var(--color-primary);
    font-size: 0.9375rem;
}
.question-category {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    padding: 2px 10px;
    background: var(--color-border-light);
    border-radius: var(--radius-full);
}

.question-text {
    font-size: 1.125rem;
    line-height: 1.7;
    margin-bottom: var(--space-xl);
    padding: var(--space-lg);
    background: var(--color-border-light);
    border-radius: var(--radius-lg);
}

.question-options {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.option-label {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.15s;
    font-size: 0.9375rem;
}
.option-label:hover {
    border-color: #6366f1;
    background: rgba(99,102,241,0.03);
}
.option-label.selected {
    border-color: #6366f1;
    background: rgba(99,102,241,0.08);
}

.option-label input[type="radio"] {
    display: none;
}

.option-letter {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--color-border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--color-text-muted);
    transition: all 0.15s;
}
.option-label.selected .option-letter {
    background: #6366f1;
    color: #fff;
}

.option-text { padding-top: 4px; }

/* Question nav dots */
.question-nav-dots {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    justify-content: center;
    margin-bottom: var(--space-xl);
    padding: var(--space-md);
    background: var(--color-bg-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
}

.dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--color-border-light);
    color: var(--color-text-muted);
    text-decoration: none;
    transition: all 0.15s;
}
.dot:hover { background: var(--color-border); color: var(--color-text); }
.dot-current { background: #6366f1; color: #fff; }
.dot-current:hover { background: #6366f1; color: #fff; }
.dot-answered { background: #d1fae5; color: #065f46; }
.dot-answered.dot-current { background: #6366f1; color: #fff; }

/* Test navigation */
.test-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--space-lg);
    border-top: 1px solid var(--color-border);
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: var(--space-lg);
}

.modal-card {
    background: var(--color-bg-white);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    max-width: 480px;
    width: 100%;
    box-shadow: var(--shadow-xl);
}
.modal-card h2 { margin-bottom: var(--space-md); }
.modal-actions {
    display: flex;
    gap: var(--space-md);
    margin-top: var(--space-xl);
    justify-content: flex-end;
}

/* === TEST COMPLETE === */
.test-complete-card { text-align: center; }
.test-complete-icon { font-size: 4rem; margin-bottom: var(--space-md); }
.test-complete-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
    margin: var(--space-xl) 0;
    padding: var(--space-lg);
    background: var(--color-border-light);
    border-radius: var(--radius-md);
}
.summary-item { text-align: center; }
.summary-label { font-size: 0.8125rem; color: var(--color-text-muted); display: block; margin-bottom: var(--space-xs); }
.summary-value { font-size: 1.5rem; font-weight: 700; color: var(--color-primary); }
.test-complete-note {
    background: var(--color-info-bg);
    padding: var(--space-lg);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-xl);
    text-align: left;
    font-size: 0.9375rem;
    color: #1e40af;
}

/* === LEGAL PAGES === */
.legal-container {
    max-width: 720px;
    margin: 0 auto;
    padding: var(--space-2xl) var(--space-lg);
}
.legal-container h1 { margin-bottom: var(--space-sm); }
.legal-container h2 { margin-top: var(--space-xl); margin-bottom: var(--space-md); font-size: 1.25rem; }
.legal-container h3 { margin-top: var(--space-lg); margin-bottom: var(--space-sm); }
.legal-container ul { padding-left: var(--space-lg); margin-bottom: var(--space-md); }
.legal-container li { padding: var(--space-xs) 0; }
.legal-container p { margin-bottom: var(--space-md); }
.legal-updated { color: var(--color-text-muted); margin-bottom: var(--space-xl); }

/* === ERROR PAGE === */
.error-container {
    text-align: center;
    padding: var(--space-3xl) var(--space-lg);
}
.error-code {
    font-size: 8rem;
    font-weight: 700;
    color: var(--color-border);
    line-height: 1;
}
.error-container h1 { margin: var(--space-md) 0; }
.error-container p { color: var(--color-text-muted); margin-bottom: var(--space-xl); }

/* === EMPTY STATE === */
.empty-state {
    text-align: center;
    padding: var(--space-2xl);
    color: var(--color-text-muted);
}

/* === PAGINATION === */
.pagination {
    display: flex;
    gap: var(--space-xs);
    justify-content: center;
    margin-top: var(--space-lg);
}

/* === FOOTER === */
.main-footer {
    background: var(--color-bg-white);
    border-top: 1px solid var(--color-border);
    padding: var(--space-lg);
    margin-top: auto;
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-md);
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-weight: 600;
    color: var(--color-primary);
}
.footer-copy { color: var(--color-text-muted); font-weight: 400; margin-left: var(--space-sm); }

.footer-links {
    display: flex;
    gap: var(--space-lg);
}
.footer-links a {
    color: var(--color-text-muted);
    font-size: 0.875rem;
}
.footer-links a:hover { color: #6366f1; }

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .nav-links { display: none; }
    .nav-links.open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: var(--nav-height);
        left: 0;
        right: 0;
        background: var(--color-bg-white);
        border-bottom: 1px solid var(--color-border);
        padding: var(--space-lg);
        box-shadow: var(--shadow-lg);
    }
    .nav-toggle { display: flex; }

    .hero { padding: 0; }
    .hero-wrapper { margin-top: 16px; padding: 0 var(--space-md); }
    .hero-card { flex-direction: column; min-height: auto; border-radius: 20px; }
    .hero-img { display: none; }
    .hero-inner { max-width: 100%; text-align: center; flex: none; padding: 40px 24px; }
    .hero h1 { font-size: clamp(1.5rem, 5.5vw, 2rem); line-height: 1.25; hyphens: none; white-space: normal; overflow: visible; word-break: normal; margin-bottom: 12px; }
    .hero-subtitle { font-size: 1rem; max-width: 34ch; line-height: 1.55; margin-bottom: 24px; margin-left: auto; margin-right: auto; }
    .hero-actions { flex-direction: column; align-items: center; gap: 12px; justify-content: center; }
    .hero-actions .btn { width: min(280px, 90%); padding: 12px 18px; font-size: 0.9375rem; }
    .hero-actions .btn-outline { border-color: rgba(255,255,255,0.55); font-weight: 500; }
    .hero-note { font-size: 0.8125rem; margin-top: 16px; }

    .features { padding: 48px var(--space-lg) 56px; }
    .features-grid { grid-template-columns: 1fr; gap: 20px; }

    .form-row { grid-template-columns: 1fr; }

    .result-overview { grid-template-columns: 1fr; text-align: center; }
    .result-meta { grid-template-columns: 1fr; }

    .dashboard-header { flex-direction: column; }

    .section-title { font-size: 1.5rem; }

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

    .flash-container { left: var(--space-md); right: var(--space-md); max-width: none; }

    .test-complete-summary { grid-template-columns: 1fr; }

    .footer-inner { flex-direction: column; text-align: center; }

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

@media (max-width: 900px) and (min-width: 769px) {
    .features-grid { grid-template-columns: repeat(2, 1fr); gap: 24px; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .question-nav-dots { gap: 2px; }
    .dot { width: 28px; height: 28px; font-size: 0.6875rem; }
}
