/* =============================================
   MINDTEST — MAIN STYLES
   Mobile-first · Calming Purple · Fast paint
   ============================================= */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Sophisticated Mental Wellness Palette */
    --primary: #5b7cff;         /* Calming Royal Blue */
    --primary-dark: #3a5bd9;
    --primary-light: #eef2ff;
    --accent: #14b8a6;          /* Soothing Teal */
    --accent-light: #ccfbf1;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --bg-glass: rgba(255, 255, 255, 0.85); /* Glassmorphism base */
    --bg-glass-heavy: rgba(255, 255, 255, 0.95);
    
    --border-glass: rgba(255, 255, 255, 0.5);
    --border-solid: #e5e7eb;
    
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    
    /* Elegant Shadows */
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 10px 25px -3px rgba(91, 124, 255, 0.15), 0 4px 6px -2px rgba(91, 124, 255, 0.05);
    --shadow-glow: 0 0 20px rgba(91, 124, 255, 0.3);

    /* Score colors */
    --green: #10b981;
    --yellow: #f59e0b;
    --orange: #f97316;
    --red: #ef4444;
    --white: #ffffff;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    background: linear-gradient(-45deg, #e0e7ff, #c7d2fe, #f5f3ff, #eef2ff);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Mobile frame on desktop */
.site-frame {
    max-width: 430px;
    margin: 0 auto;
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    min-height: 100vh;
    position: relative;
    box-shadow: 0 0 60px rgba(91, 124, 255, 0.15);
    border-left: 1px solid var(--border-glass);
    border-right: 1px solid var(--border-glass);
}

/* ---- HEADER ---- */
.site-header {
    background: var(--bg-glass-heavy);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border-glass);
    padding: .4rem 1rem; /* Tightened */
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

/* ---- SKELETON LOADERS (Anti-CLS) ---- */
.skeleton {
    position: relative;
    overflow: hidden;
    background-color: #f3f4f6;
}

.skeleton::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        rgba(255,255,255,0) 0%, 
        rgba(255,255,255,0.6) 50%, 
        rgba(255,255,255,0) 100%);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.ad-banner.skeleton {
    min-height: 270px;
    background: var(--bg-glass-heavy);
}

/* ---- EXIT INTENT MODAL ---- */
.exit-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.85); /* Much darker for focus */
    backdrop-filter: blur(8px);
    z-index: 3000; /* Ensure it is above EVERYTHING */
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.exit-modal-overlay.active {
    display: flex;
}

.exit-modal {
    background: var(--white); /* Solid white, no glass here */
    max-width: 380px;
    width: 100%;
    border-radius: var(--radius-lg);
    padding: 2.5rem 2rem;
    text-align: center;
    position: relative;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
    animation: modalSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid var(--border-solid);
}

@keyframes modalSlideUp {
    from { transform: translateY(40px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.exit-modal h2 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 1rem;
    font-family: 'Outfit', sans-serif;
    line-height: 1.2;
}

.exit-modal p {
    font-size: 1rem;
    color: var(--text-main); /* Darker text for visibility */
    margin-bottom: 2rem;
    line-height: 1.5;
}

.exit-modal .btn-primary {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
    font-weight: 700;
    box-shadow: 0 10px 20px rgba(91, 124, 255, 0.3);
}

.close-exit {
    margin-top: 1.2rem;
    display: inline-block;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: underline;
    cursor: pointer;
    transition: color 0.2s;
}

.close-exit:hover {
    color: var(--text-main);
}

.logo {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    font-size: 1.4rem;
    color: var(--primary);
    text-decoration: none;
    letter-spacing: -0.03em;
}

.logo-icon {
    font-size: 1.6rem;
}

.header-badge {
    font-size: .75rem;
    background: var(--accent-light);
    color: #0f766e;
    border-radius: 99px;
    padding: .3rem .8rem;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    box-shadow: 0 2px 4px rgba(20, 184, 166, 0.1);
}

/* ---- AD BANNER ---- */
.ad-banner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.6);
    border-bottom: 1px solid var(--border-glass);
    padding: .4rem 0; /* Tightened */
    min-height: 260px; /* Reduced to fit ads better */
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.ad-label {
    font-size: .58rem; /* Even more subtle */
    text-transform: uppercase;
    letter-spacing: .15em;
    color: #cbd5e1; /* Lighter color to blend in */
    margin-bottom: .3rem;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    opacity: 0.8;
}

/* ---- HERO ---- */
.hero {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    color: white;
    text-align: center;
    padding: 1.2rem 1.2rem; /* Compressed */
    position: relative;
    overflow: hidden;
}

/* Add a subtle internal glow to the hero */
.hero::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0) 60%);
    pointer-events: none;
}

.hero__eyebrow {
    font-family: 'Outfit', sans-serif;
    font-size: .75rem; /* Shrunk slightly */
    font-weight: 700;
    letter-spacing: .15em;
    text-transform: uppercase;
    opacity: .9;
    margin-bottom: .5rem; /* Tightened */
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.2rem 0.6rem; /* Tightened */
    border-radius: 99px;
}

.hero__title {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(1.6rem, 5.5vw, 2rem); /* Slightly smaller */
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: .6rem; /* Tightened */
    text-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.hero__title span {
    color: var(--accent-light);
}

.hero__sub {
    font-size: .88rem; /* Slightly smaller */
    opacity: .9;
    max-width: 32ch;
    margin: 0 auto;
    font-weight: 400;
    line-height: 1.4;
}

/* ---- TRUST BAR ---- */
.trust-bar {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: .4rem 1rem; /* Tightened */
    background: var(--bg-glass-heavy);
    border-bottom: 1px solid var(--border-glass);
    padding: .5rem 1rem; /* Tightened from .8rem */
    font-size: .72rem; /* Slightly smaller */
    color: var(--text-muted);
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
}

.trust-bar span {
    display: flex;
    align-items: center;
    gap: .4rem;
}

.trust-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: var(--primary-light);
    border-radius: 50%;
    font-size: 0.65rem;
}

/* ---- QUIZ CARD ---- */
.quiz-wrap {
    padding: .8rem 1rem 0; /* Compressed from 1.5rem */
    max-width: 500px;
    margin: 0 auto;
}

.quiz-card {
    background: var(--bg-glass-heavy);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 1.1rem 1rem; /* Even tighter */
    margin-bottom: 0.8rem; /* Even tighter */
    position: relative;
    overflow: hidden;
}

/* Subtle inner glow for the card */
.quiz-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent), var(--primary));
}

.quiz-step {
    display: none;
    animation: fadeIn 0.4s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.quiz-step.active {
    display: block;
}

.step-q {
    font-size: 1.1rem; /* Shrunk slightly */
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    color: var(--text-main);
    margin-bottom: 0.8rem; /* Tightened */
    line-height: 1.35;
}

.step-q em {
    color: var(--primary);
    font-style: normal;
    background: var(--primary-light);
    padding: 0 0.3rem;
    border-radius: 4px;
}

/* ---- OPTIONS GRID ---- */
.opt-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .6rem; /* Tightened */
    margin-bottom: .2rem; /* Tightened */
}

.opt-btn {
    border: 2px solid var(--border-solid);
    background: rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-md);
    padding: 0.7rem .4rem; /* Compressed for vertical space */
    cursor: pointer;
    font-size: .85rem; /* Shrunk slightly */
    font-weight: 600;
    color: var(--text-main);
    text-align: center;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    line-height: 1.2;
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

.opt-btn:hover {
    border-color: var(--primary-light);
    background: var(--bg-glass-heavy);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.opt-btn.selected {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary-dark);
    box-shadow: 0 0 0 2px rgba(91, 124, 255, 0.2);
    transform: scale(0.98);
}

.opt-btn:active {
    transform: scale(.95);
}

.opt-btn .opt-icon {
    font-size: 1.3rem; /* Shrunk from 1.5rem */
    display: block;
    margin-bottom: .2rem; /* Tightened */
    transition: transform 0.2s ease;
}

.opt-btn:hover .opt-icon {
    transform: scale(1.1);
}

/* ---- BUTTONS ---- */
.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    padding: .9rem 1.5rem;
    font-size: 1rem;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    transition: all .2s ease;
    white-space: nowrap;
    letter-spacing: .02em;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(rgba(255,255,255,0.2), transparent);
    pointer-events: none;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 12px 28px -4px rgba(91, 124, 255, 0.3);
}

.btn-primary:active {
    transform: translateY(1px) scale(.98);
}

.btn-full {
    width: 100%;
    margin-top: .8rem; /* Reduced from 1.2rem */
    display: block;
}

/* ---- PROGRESS BAR ---- */
.progress-wrap {
    margin-bottom: 1.2rem;
    background: var(--bg-glass-heavy);
    backdrop-filter: blur(8px);
    padding: 0.8rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-glass);
    box-shadow: var(--shadow-sm);
}

.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: .8rem;
    color: var(--text-muted);
    margin-bottom: .5rem;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
}

.progress-track {
    background: var(--border-solid);
    border-radius: 99px;
    height: 8px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    background: linear-gradient(90deg, var(--accent), var(--primary));
    height: 100%;
    border-radius: 99px;
    transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shimmer 2s infinite;
}


/* ---- MATCHING SPINNER ---- */
.matching-wrap {
    text-align: center;
    padding: 3rem 1rem;
    display: none;
    background: var(--bg-glass-heavy);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: 1.5rem;
}

.matching-wrap.active {
    display: block;
    animation: fadeIn 0.4s ease forwards;
}

.matching-spinner {
    width: 64px;
    height: 64px;
    border: 4px solid var(--primary-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin .85s linear infinite;
    margin: 0 auto 1.5rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.matching-title {
    font-size: 1.25rem;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    margin-bottom: .6rem;
    color: var(--text-main);
}

.matching-sub {
    font-size: .9rem;
    color: var(--text-muted);
}

/* ---- RESULTS CARD ---- */
.results-wrap {
    display: none;
    padding: 0;
    max-width: 500px;
    margin: 0 auto;
}

.results-wrap.active {
    display: block;
}

.result-score-card {
    background: var(--bg-glass-heavy);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 2.5rem 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
    animation: slideUpFade 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideUpFade {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Score circle */
.score-circle-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.score-circle {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 6px solid var(--primary);
    background: var(--bg-glass);
    transition: all .6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: inset 0 0 20px rgba(0,0,0,0.05), var(--shadow-glow);
}

.score-circle.green  { border-color: var(--green);  background: #ecfdf5; box-shadow: 0 0 30px rgba(16, 185, 129, 0.2); }
.score-circle.yellow { border-color: var(--yellow); background: #fffbeb; box-shadow: 0 0 30px rgba(245, 158, 11, 0.2); }
.score-circle.orange { border-color: var(--orange); background: #fff7ed; box-shadow: 0 0 30px rgba(249, 115, 22, 0.2); }
.score-circle.red    { border-color: var(--red);    background: #fef2f2; box-shadow: 0 0 30px rgba(239, 68, 68, 0.2); }

.score-number {
    font-size: 2.5rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    color: var(--text-main);
    line-height: 1;
}

.score-out {
    font-size: .85rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* Result label */
.result-label {
    font-size: 1.5rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    margin-bottom: .8rem;
    color: var(--primary);
}

.result-label.green  { color: var(--green); }
.result-label.yellow { color: var(--yellow); }
.result-label.orange { color: var(--orange); }
.result-label.red    { color: var(--red); }

.result-message {
    font-size: .95rem;
    color: var(--text-main);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    max-width: 100%;
}

/* CTA button */
.result-cta {
    display: inline-block;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    padding: 1rem 1.8rem;
    width: 100%;
    font-size: 1.05rem;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: all .2s ease;
    text-align: center;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.result-cta::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(rgba(255,255,255,0.2), transparent);
    pointer-events: none;
}

.result-cta:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 12px 28px -4px rgba(91, 124, 255, 0.3);
}

.result-cta:active {
    transform: translateY(1px) scale(.98);
}

/* ---- FOOTER ---- */
.site-footer {
    background: transparent;
    border-top: 1px solid var(--border-glass);
    text-align: center;
    padding: 1.5rem 1rem 100px; /* 100px bottom padding to clear sticky ad */
    font-size: .8rem;
    color: var(--text-muted);
}

.site-footer a {
    color: var(--text-muted);
    text-decoration: none;
    margin: 0 .5rem;
    transition: color 0.2s;
    font-weight: 600;
}

.site-footer a:hover {
    color: var(--primary);
}

/* ---- SEO CONTENT SECTION ---- */
.seo-content {
    background: var(--bg-glass-heavy);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    margin: 2rem 1.2rem;
    padding: 2.5rem 1.8rem;
    box-shadow: var(--shadow-md);
    color: var(--text-main);
}

.seo-content h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--primary);
    margin: 2rem 0 1rem;
    line-height: 1.2;
}

.seo-content h2:first-child {
    margin-top: 0;
}

.seo-content h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 1.8rem 0 0.8rem;
    border-left: 4px solid var(--accent);
    padding-left: 1rem;
}

.seo-content p {
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 1.2rem;
    color: var(--text-main);
}

.seo-content ul {
    margin: 1.5rem 0;
    padding-left: 1.5rem;
}

.seo-content li {
    font-size: 0.95rem;
    margin-bottom: 0.8rem;
    list-style-type: none;
    position: relative;
}

.seo-content li::before {
    content: "•";
    color: var(--accent);
    font-weight: bold;
    display: inline-block;
    width: 1em;
    margin-left: -1em;
}

.seo-content strong {
    color: var(--primary-dark);
    font-weight: 700;
}

.seo-content .keyword-tag {
    background: var(--primary-light);
    color: var(--primary-dark);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.9em;
}

/* Enhanced SEO Elements */
.info-callout {
    background: linear-gradient(135deg, rgba(91, 124, 255, 0.05), rgba(20, 184, 166, 0.05));
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin: 2rem 0;
    border-left: 5px solid var(--primary);
    position: relative;
}

.info-callout h4 {
    font-family: 'Outfit', sans-serif;
    color: var(--primary-dark);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.comparison-table-wrap {
    overflow-x: auto;
    margin: 2rem 0;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-glass);
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    background: white;
}

.comparison-table th {
    background: var(--primary-light);
    color: var(--primary-dark);
    font-family: 'Outfit', sans-serif;
    padding: 1rem;
    text-align: left;
    font-weight: 700;
}

.comparison-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-solid);
    color: var(--text-main);
}

.comparison-table tr:last-child td {
    border-bottom: none;
}

.comparison-table .check {
    color: var(--green);
    font-weight: bold;
}

.stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 2rem 0;
}

.stat-item {
    background: white;
    padding: 1.2rem;
    border-radius: var(--radius-md);
    text-align: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-solid);
}

.stat-number {
    display: block;
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary);
    font-family: 'Outfit', sans-serif;
    line-height: 1;
    margin-bottom: 0.3rem;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

@media (max-width: 480px) {
    .stat-grid {
        grid-template-columns: 1fr;
    }
}

/* ---- UTILITY ---- */
.hidden {
    display: none !important;
}
