/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Modern Color Palette (Indigo Theme) */
    --primary-color: #4f46e5;
    /* Indigo 600 */
    --primary-dark: #3730a3;
    /* Indigo 800 */
    --primary-light: #e0e7ff;
    /* Indigo 100 */

    --secondary-color: #64748b;
    /* Slate 500 */
    --secondary-dark: #334155;
    /* Slate 700 */

    --success-color: #10b981;
    /* Emerald 500 */
    --success-bg: #d1fae5;

    --warning-color: #f59e0b;
    /* Amber 500 */
    --warning-bg: #fef3c7;

    --danger-color: #ef4444;
    /* Red 500 */
    --danger-bg: #fee2e2;

    --info-color: #3b82f6;
    /* Blue 500 */
    --info-bg: #eff6ff;

    /* Neutral Colors */
    --bg-body: #f1f5f9;
    /* Slate 100 - Slightly darker for contrast */
    --bg-surface: #ffffff;
    /* White surface */
    --text-main: #0f172a;
    /* Slate 900 */
    --text-secondary: #475569;
    /* Slate 600 */
    --text-muted: #94a3b8;
    /* Slate 400 */
    --border-color: #e2e8f0;
    /* Slate 200 */

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;

    /* Typography */
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

    /* Modern Border Radius */
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-full: 9999px;

    /* Soft Modern Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.05), 0 4px 6px -4px rgb(0 0 0 / 0.05);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.05), 0 8px 10px -6px rgb(0 0 0 / 0.01);
}

body {
    font-family: var(--font-sans);
    line-height: 1.6;
    color: var(--text-main);
    background-color: var(--bg-body);
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Container */
.container {
    max-width: 800px;
    /* Slightly narrower for better reading measure */
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* Header */
header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 4rem 0 3rem;
    /* More breathing room */
    text-align: center;
    box-shadow: var(--shadow-lg);
    margin-bottom: -2rem;
    /* Overlap effect */
    position: relative;
    z-index: 10;
}

header h1 {
    font-size: 2.75rem;
    font-weight: 800;
    margin-bottom: var(--spacing-xs);
    letter-spacing: -0.025em;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Header Link Styles - High Specificity */
header h1 .header-title-link,
header h1 .header-title-link:visited,
header h1 .header-title-link:active {
    color: #ffffff;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

header h1 .header-title-link:hover {
    opacity: 0.9;
    color: #ffffff;
    text-decoration: none;
}

header .subtitle {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 400;
    max-width: 600px;
    margin: 0 auto;
}

/* Main Content */
main {
    padding-top: 0;
    /* Accommodate overlap */
    position: relative;
    z-index: 20;
}

/* Sections */
.section {
    display: none;
    animation: slideUpFade 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.section.active {
    display: block;
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Content Cards */
.content-card {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
    box-shadow: var(--shadow-xl);
    /* Floating effect */
    border: 1px solid rgba(255, 255, 255, 0.5);
}

/* Typography */
h2 {
    font-size: 1.875rem;
    color: var(--text-main);
    margin-bottom: var(--spacing-md);
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.2;
}

h3 {
    font-size: 1.5rem;
    color: var(--text-main);
    margin-top: var(--spacing-lg);
    margin-bottom: var(--spacing-sm);
    font-weight: 600;
    letter-spacing: -0.015em;
}

h4 {
    font-size: 1.125rem;
    color: var(--text-main);
    margin-top: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
    font-weight: 600;
}

p {
    margin-bottom: var(--spacing-sm);
    color: var(--text-secondary);
}

ul,
ol {
    margin-left: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    color: var(--text-secondary);
}

li {
    margin-bottom: 0.5rem;
    padding-left: 0.25rem;
}

li::marker {
    color: var(--primary-color);
    font-weight: bold;
}

strong {
    color: var(--text-main);
    font-weight: 600;
}

/* Special Boxes */
.disclaimer-box,
.info-box,
.warning-box {
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    border-left: 4px solid;
    background-color: var(--bg-surface);
}

.disclaimer-box.alert {
    background-color: var(--danger-bg);
    border-color: var(--danger-color);
}

.disclaimer-box h2,
.disclaimer-box h3 {
    color: var(--danger-color);
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-box {
    background-color: var(--info-bg);
    border-color: var(--info-color);
}

.info-box h3,
.info-box h4 {
    color: var(--info-color);
    margin-top: 0;
}

.warning-box {
    background-color: var(--warning-bg);
    border-color: var(--warning-color);
}

.warning-box h3 {
    color: #b45309;
    /* Darker amber for text */
    margin-top: 0;
}

/* Test Grid */
.test-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--spacing-md);
    margin: var(--spacing-lg) 0;
}

.test-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    background: white;
    box-shadow: var(--shadow-sm);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.test-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.icon-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1.5rem;
    height: 100px;
}

.test-icon {
    max-width: 100%;
    height: auto;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

.test-card h3 {
    color: var(--primary-color);
    margin: 0 0 var(--spacing-xs) 0;
    font-size: 1.25rem;
}

.test-card p {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.test-card .accuracy {
    font-weight: 600;
    color: var(--success-color);
    font-size: 0.875rem;
    background: var(--success-bg);
    display: inline-block;
    padding: 0.25rem 0.75rem;
}

/* Link Highlight */
.link-highlight {
    color: var(--primary-color);
    text-decoration: underline;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 10px;
    background-color: #e2e8f0;
    border-radius: var(--radius-full);
    margin-bottom: var(--spacing-xs);
    overflow: hidden;
}

.progress {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), #818cf8);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-step-1 {
    width: 33.33%;
}

.progress-step-2 {
    width: 66.66%;
}

.progress-step-3 {
    width: 100%;
}

.progress-text {
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: var(--spacing-lg);
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Instructions List */
.instructions {
    background: #f8fafc;
    border-radius: var(--radius-lg);
    padding: var(--spacing-md) var(--spacing-md) var(--spacing-md) 2.5rem;
    margin: var(--spacing-md) 0;
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary-color);
}

.instructions li {
    margin-bottom: 0.75rem;
    color: var(--text-main);
}

/* Forms */
.test-form {
    margin: var(--spacing-lg) 0;
}

.test-form h4 {
    margin-top: var(--spacing-lg);
    margin-bottom: var(--spacing-sm);
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-light);
    padding-bottom: 0.5rem;
}

/* Custom Checkboxes */
.checkbox-label {
    display: flex;
    align-items: flex-start;
    padding: 1rem;
    margin-bottom: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: var(--bg-surface);
}

.checkbox-label:hover {
    border-color: var(--primary-color);
    background-color: #f5f3ff;
    /* Very light indigo */
    transform: translateX(4px);
}

.checkbox-label input[type="checkbox"] {
    margin-right: 1rem;
    margin-top: 0.2rem;
    width: 1.25rem;
    height: 1.25rem;
    cursor: pointer;
    flex-shrink: 0;
    accent-color: var(--primary-color);
}

.checkbox-label:has(input:checked) {
    border-color: var(--primary-color);
    background-color: #e0e7ff;
    /* Indigo 100 */
    box-shadow: 0 0 0 1px var(--primary-color);
}

/* Buttons */
.button-group {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: space-between;
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border-color);
}

.button-center {
    text-align: center;
    margin: var(--spacing-lg) 0;
}

.intro-actions {
    margin-bottom: 2rem;
}

.btn {
    padding: 0.875rem 2rem;
    border: none;
    border-radius: var(--radius-full);
    /* Pill shape */
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: var(--font-sans);
    text-align: center;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-width: 120px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.3);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.4);
}

.btn-secondary {
    background-color: white;
    color: var(--text-secondary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--bg-body);
    color: var(--text-main);
    border-color: var(--text-secondary);
    transform: translateY(-2px);
}

.btn:active {
    transform: translateY(0);
}

/* Timer Styles */
.timer-container {
    text-align: center;
    margin: var(--spacing-lg) 0;
    padding: var(--spacing-lg);
    background: white;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
}

.timer-display {
    font-size: 4rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: var(--primary-color);
    margin: var(--spacing-sm) 0;
    line-height: 1;
    text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.05);
}

.timer-controls {
    display: flex;
    justify-content: center;
    gap: var(--spacing-sm);
}

.btn-timer {
    padding: 0.5rem 1.5rem;
    background: white;
    border: 2px solid var(--border-color);
    color: var(--text-main);
    border-radius: var(--radius-md);
    font-weight: 600;
}

/* FAQ Styles */
.faq-container {
    margin-top: var(--spacing-lg);
}

.faq-section {
    margin-top: 4rem;
}

.faq-item {
    border-bottom: 1px solid var(--border-color);
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-question {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 1.25rem 0;
    background: none;
    border: none;
    text-align: left;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    transition: color 0.2s ease;
}

.faq-question:hover {
    color: var(--primary-color);
}

.faq-icon {
    font-size: 1.5rem;
    color: var(--primary-color);
    transition: transform 0.3s ease;
    font-weight: 400;
}

.faq-question.active .faq-icon {
    transform: rotate(45deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.faq-answer p {
    padding-bottom: 1.25rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 0;
}

/* Results Box */
.results-box {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
    box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.05);
}

.result-item {
    background: white;
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    border-left: 6px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.result-item h3 {
    margin-top: 0;
    font-size: 1.25rem;
}

.result-score {
    font-size: 2rem;
    font-weight: 800;
    margin: 0.5rem 0;
}

.result-low {
    background-color: #f0fdf4;
    border-left-color: var(--success-color);
    color: #166534;
}

.result-moderate {
    background-color: #fffbeb;
    border-left-color: var(--warning-color);
    color: #92400e;
}

.result-high {
    background-color: #fef2f2;
    border-left-color: var(--danger-color);
    color: #991b1b;
}

.overall-result {
    background: linear-gradient(to bottom right, #ffffff, #f8fafc);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl) var(--spacing-lg);
    text-align: center;
    border: 4px solid var(--primary-color);
    margin-top: var(--spacing-lg);
    box-shadow: var(--shadow-xl);
}

.overall-result h3 {
    margin-top: 0;
    font-size: 1.75rem;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.overall-score {
    font-size: 3.5rem;
    font-weight: 800;
    margin: var(--spacing-sm) 0;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Video Embed */
.video-container {
    position: relative;
    padding-bottom: 56.25%;
    /* 16:9 ratio */
    height: 0;
    overflow: hidden;
    border-radius: var(--radius-md);
    margin: var(--spacing-md) 0;
    box-shadow: var(--shadow-md);
    background: #000;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Footer */
footer {
    background-color: var(--secondary-dark);
    color: white;
    text-align: center;
    padding: 4rem 2rem;
    margin-top: 4rem;
}

footer p {
    color: var(--text-muted);
}

.footer-note {
    margin-top: 1rem;
    font-size: 0.8rem;
    opacity: 0.7;
}

.footer-links {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-links h4 {
    color: white;
    font-size: 1rem;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.footer-links ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
}

.footer-links li {
    margin: 0;
    padding: 0;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s ease;
    border-bottom: 1px dotted rgba(255, 255, 255, 0.3);
}

.footer-links a:hover {
    color: white;
    border-bottom-style: solid;
}

/* Responsive */
@media (max-width: 768px) {
    header {
        padding: 3rem 0;
    }

    header h1 {
        font-size: 2rem;
    }

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

    .button-group {
        flex-direction: column-reverse;
    }

    .btn {
        width: 100%;
    }
}