/* =========================================================================
   PrepSettle.com — Shared Design System
   Used by the root homepage and the CELPIP section.
   MET keeps its own stylesheet (met/css/style.css).
   Brand: neutral charcoal/indigo chrome. CELPIP accent: deep crimson.
   ========================================================================= */
:root {
    --brand: #312e81;            /* indigo — PrepSettle shared brand */
    --brand-dark: #1e1b4b;
    --charcoal: #16181b;         /* nav + footer chrome — matches preplogo.png bg */
    --charcoal-2: #111827;

    --primary: #4338ca;          /* default content accent (indigo on homepage) */
    --primary-light: #6366f1;
    --primary-dark: #312e81;

    --accent: #f59e0b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;

    --bg: #f8fafc;
    --bg-white: #ffffff;
    --card-bg: #ffffff;
    --text: #1e293b;
    --text-light: #64748b;
    --text-lighter: #94a3b8;
    --border: #e2e8f0;

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px -3px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 40px -5px rgba(0,0,0,0.15);

    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --transition: all 0.3s ease;

    --listening: #3b82f6;
    --reading: #10b981;
    --writing: #8b5cf6;
    --speaking: #f59e0b;
}

/* CELPIP section theme override — applied via class="celpip" on a wrapper */
.celpip {
    --primary: #a3232f;
    --primary-light: #c0392b;
    --primary-dark: #7a1820;
    --accent: #e0a800;
    --listening: #2563eb;
    --reading: #0d9488;
    --writing: #9333ea;
    --speaking: #d97706;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
img { max-width: 100%; height: auto; }
table { max-width: 100%; }

html { scroll-behavior: smooth; overflow-x: hidden; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; width: 100%; }

/* ── Navbar (shared chrome) ─────────────────────────────────────────── */
.navbar {
    position: fixed; top: 0; left: 0; right: 0;
    background: var(--charcoal);
    z-index: 1000; transition: var(--transition);
    box-shadow: 0 1px 0 rgba(255,255,255,0.06);
}
.nav-container { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; font-weight: 800; font-size: 1.2rem; letter-spacing: -0.01em; }
.logo-mark {
    width: 34px; height: 34px; border-radius: 9px;
    background: linear-gradient(135deg, var(--brand) 0%, #6366f1 100%);
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; color: #fff; font-size: 1rem;
}
.logo .accent { color: var(--accent); }
.nav-links { display: flex; list-style: none; gap: 26px; align-items: center; }
.nav-links a { text-decoration: none; color: rgba(255,255,255,0.78); font-weight: 500; font-size: 0.92rem; transition: var(--transition); }
.nav-links a:hover, .nav-links a.active { color: #fff; }
.nav-cta { background: var(--primary); color: #fff !important; padding: 8px 16px; border-radius: 8px; font-weight: 600; }
.nav-cta:hover { background: var(--primary-light); }
.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 5px; }
.nav-toggle span { width: 24px; height: 2px; background: #fff; transition: var(--transition); }

/* ── Buttons ────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 28px; border-radius: var(--radius-sm); font-weight: 600; font-size: 0.95rem;
    text-decoration: none; transition: var(--transition); cursor: pointer; border: 2px solid transparent;
}
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-light); border-color: var(--primary-light); transform: translateY(-2px); box-shadow: 0 8px 25px rgba(0,0,0,0.15); }
.btn-outline { background: transparent; color: #fff; border-color: rgba(255,255,255,0.35); }
.btn-outline:hover { background: rgba(255,255,255,0.1); border-color: #fff; }
.btn-white { background: #fff; color: var(--primary); border-color: #fff; }
.btn-white:hover { background: var(--bg); transform: translateY(-2px); }
.btn-lg { padding: 16px 36px; font-size: 1.05rem; }
.btn-sm { padding: 8px 16px; font-size: 0.85rem; }
.btn-block { width: 100%; }

/* ── Hero ───────────────────────────────────────────────────────────── */
.hero { position: relative; padding: 130px 0 70px; overflow: hidden; min-height: auto; display: flex; align-items: center;
    background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand) 45%, #6366f1 100%); }
.hero-bg-deco { position: absolute; inset: 0; overflow: hidden; }
.hero-bg-deco::before { content: ''; position: absolute; top: -40%; right: -15%; width: 560px; height: 560px;
    background: radial-gradient(circle, rgba(245,158,11,0.18) 0%, transparent 70%); border-radius: 50%; }
.hero-bg-deco::after { content: ''; position: absolute; bottom: -30%; left: -10%; width: 420px; height: 420px;
    background: radial-gradient(circle, rgba(99,102,241,0.25) 0%, transparent 70%); border-radius: 50%; }
.hero-content { position: relative; z-index: 1; }
.hero-badge { display: inline-block; background: rgba(245,158,11,0.18); color: #fcd34d; padding: 8px 20px; border-radius: 50px;
    font-size: 0.85rem; font-weight: 600; margin-bottom: 22px; border: 1px solid rgba(245,158,11,0.3); }
.hero h1 { font-size: 3.3rem; font-weight: 800; color: #fff; line-height: 1.12; margin-bottom: 18px; }
.hero h1 .hl { color: var(--accent); }
.hero-subtitle { font-size: 1.2rem; color: rgba(255,255,255,0.82); margin-bottom: 30px; max-width: 640px; line-height: 1.7; }
.hero-cta { display: flex; gap: 16px; margin-bottom: 44px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 40px; flex-wrap: wrap; }
.stat { display: flex; flex-direction: column; }
.stat-num { font-size: 2rem; font-weight: 800; color: #fff; }
.stat-label { font-size: 0.85rem; color: rgba(255,255,255,0.6); font-weight: 500; }

/* ── Section helpers ────────────────────────────────────────────────── */
.section { padding: 90px 0; }
.section-white { background: #fff; }
.section-header { text-align: center; margin-bottom: 48px; }
.section-header h2 { font-size: 2.1rem; font-weight: 800; color: var(--brand); margin-bottom: 12px; }
.section-header p { font-size: 1.05rem; color: var(--text-light); max-width: 620px; margin: 0 auto; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.78rem; font-weight: 700; color: var(--primary); margin-bottom: 10px; }

/* ── Test cards ─────────────────────────────────────────────────────── */
.test-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 24px; }
.test-card { background: var(--card-bg); border-radius: var(--radius-lg); padding: 30px; border: 1px solid var(--border);
    transition: var(--transition); display: flex; flex-direction: column; }
.test-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-xl); border-color: transparent; }
.test-card-icon { width: 60px; height: 60px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; margin-bottom: 18px; }
.test-card-icon svg { width: 30px; height: 30px; }
.listening-icon { background: rgba(59,130,246,0.12); color: var(--listening); }
.reading-icon { background: rgba(16,185,129,0.12); color: var(--reading); }
.writing-icon { background: rgba(139,92,246,0.12); color: var(--writing); }
.speaking-icon { background: rgba(245,158,11,0.12); color: var(--speaking); }
.test-card h3 { font-size: 1.3rem; font-weight: 700; margin-bottom: 6px; }
.test-meta { color: var(--text-light); font-size: 0.88rem; margin-bottom: 14px; }
.test-details { list-style: none; margin-bottom: 22px; flex: 1; }
.test-details li { padding: 5px 0; color: var(--text-light); font-size: 0.9rem; position: relative; padding-left: 20px; }
.test-details li::before { content: ''; position: absolute; left: 0; top: 12px; width: 7px; height: 7px; background: var(--success); border-radius: 50%; }

/* ── Two-card chooser (homepage) ────────────────────────────────────── */
.choose-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 28px; max-width: 920px; margin: 0 auto; }
.test-choose { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 36px 30px; text-align: center;
    transition: var(--transition); display: flex; flex-direction: column; }
.test-choose:hover { transform: translateY(-4px); box-shadow: var(--shadow-xl); }
.tc-badge { display: inline-block; padding: 5px 14px; border-radius: 50px; font-size: 0.8rem; font-weight: 700; margin-bottom: 16px; }
.tc-badge.met { background: rgba(15,36,64,0.08); color: #0f2440; }
.tc-badge.celpip { background: rgba(163,35,47,0.1); color: #a3232f; }
.tc-title { font-size: 1.5rem; font-weight: 800; margin-bottom: 10px; }
.tc-desc { color: var(--text-light); font-size: 0.95rem; margin-bottom: 18px; }
.tc-score { background: var(--bg); border-radius: var(--radius-sm); padding: 12px; font-size: 0.85rem; color: var(--text); margin-bottom: 18px; }
.tc-small { font-size: 0.8rem; color: var(--text-lighter); margin-top: auto; padding-top: 16px; border-top: 1px dashed var(--border); }

/* ── Path / decision blocks ─────────────────────────────────────────── */
.path-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; max-width: 940px; margin: 0 auto; }
.path-card { background: #fff; border: 2px solid var(--border); border-radius: var(--radius); padding: 30px 24px; text-align: center; text-decoration: none; color: inherit; transition: var(--transition); }
.path-card:hover { border-color: var(--primary); box-shadow: var(--shadow-lg); }
.path-card .emoji { font-size: 2.6rem; margin-bottom: 10px; }
.path-card h3 { color: var(--primary); margin-bottom: 8px; }
.path-card p { color: var(--text-light); font-size: 0.9rem; }

/* ── Visa glance ────────────────────────────────────────────────────── */
.visa-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.visa-block { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 32px; }
.visa-block h3 { font-size: 1.3rem; margin-bottom: 12px; color: var(--brand); }
.visa-block ul { margin: 0 0 16px 18px; color: var(--text-light); }
.visa-block li { margin-bottom: 6px; }

/* ── Trust strip ────────────────────────────────────────────────────── */
.trust-strip { background: var(--charcoal); color: rgba(255,255,255,0.82); }
.trust-strip .container { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; padding-top: 40px; padding-bottom: 40px; }
.trust-item { display: flex; gap: 12px; align-items: flex-start; font-size: 0.92rem; line-height: 1.5; }
.trust-item .ti-icon { color: var(--accent); font-size: 1.2rem; flex-shrink: 0; }
.trust-item strong { color: #fff; }

/* ── CTA ────────────────────────────────────────────────────────────── */
.cta-section { padding: 80px 0; background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%); text-align: center; color: #fff; }
.cta-section h2 { font-size: 2rem; margin-bottom: 12px; }
.cta-section p { color: rgba(255,255,255,0.85); margin-bottom: 30px; }
.cta-buttons { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* ── FAQ ────────────────────────────────────────────────────────────── */
.faq-list { max-width: 820px; margin: 0 auto; }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-question { width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 20px 0; background: none; border: none;
    cursor: pointer; font-size: 1.02rem; font-weight: 600; color: var(--text); text-align: left; font-family: inherit; }
.faq-question:hover { color: var(--primary); }
.faq-icon { width: 20px; height: 20px; flex-shrink: 0; transition: transform 0.3s ease; color: var(--text-light); }
.faq-item.active .faq-icon { transform: rotate(180deg); }
.faq-answer { max-height: 0; overflow: hidden; transition: max-height 0.3s ease, padding 0.3s ease; }
.faq-item.active .faq-answer { max-height: 400px; padding-bottom: 20px; }
.faq-answer p { color: var(--text-light); line-height: 1.7; }

/* ── Footer ─────────────────────────────────────────────────────────── */
.footer { background: var(--charcoal-2); color: rgba(255,255,255,0.78); padding: 60px 0 30px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.footer-col h4 { color: #fff; margin-bottom: 16px; font-size: 1rem; }
.footer-col p { font-size: 0.9rem; line-height: 1.6; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 8px; }
.footer-col ul a { color: rgba(255,255,255,0.7); text-decoration: none; font-size: 0.9rem; transition: var(--transition); }
.footer-col ul a:hover { color: var(--accent); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 24px; text-align: center; font-size: 0.85rem; color: rgba(255,255,255,0.5); }
.footer-bottom a { color: rgba(255,255,255,0.7); text-decoration: none; }
.footer-bottom a:hover { color: #fff; }

/* ── Test pages ─────────────────────────────────────────────────────── */
.test-page { padding-top: 68px; min-height: 100vh; }
.test-header { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%); color: #fff; padding: 36px 0; }
.test-header h1 { font-size: 1.9rem; margin-bottom: 6px; }
.test-header p { color: rgba(255,255,255,0.85); }
.test-container { padding: 36px 0; }
.test-layout { display: grid; grid-template-columns: 1fr 300px; gap: 28px; align-items: start; }
.test-main { background: #fff; border-radius: var(--radius); border: 1px solid var(--border); padding: 30px; min-height: 400px; }
.test-sidebar { position: sticky; top: 88px; display: flex; flex-direction: column; gap: 16px; }

.timer-card, .progress-card, .question-nav { background: #fff; border-radius: var(--radius); border: 1px solid var(--border); padding: 22px; text-align: center; }
.timer-display { font-size: 2.4rem; font-weight: 800; color: var(--primary); font-variant-numeric: tabular-nums; }
.timer-label { color: var(--text-light); font-size: 0.88rem; margin-top: 2px; }
.progress-bar-container { background: var(--border); border-radius: 50px; height: 8px; margin-top: 12px; overflow: hidden; }
.progress-bar-fill { height: 100%; background: linear-gradient(135deg, var(--primary), var(--primary-light)); border-radius: 50px; transition: width 0.3s ease; width: 0%; }
.progress-text { font-size: 0.85rem; color: var(--text-light); font-weight: 600; }
.question-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-top: 12px; }
.q-btn { width: 100%; aspect-ratio: 1; border: 1px solid var(--border); background: #fff; border-radius: var(--radius-sm); font-size: 0.82rem; font-weight: 600; cursor: pointer; transition: var(--transition); color: var(--text); }
.q-btn:hover { border-color: var(--primary); color: var(--primary); }
.q-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.q-btn.answered { background: var(--success); color: #fff; border-color: var(--success); }

.welcome h2 { margin-bottom: 14px; }
.welcome p { color: var(--text-light); margin-bottom: 20px; }
.part-list { background: var(--bg); border-radius: var(--radius-sm); padding: 18px 22px; margin-bottom: 22px; }
.part-list li { margin-bottom: 6px; color: var(--text-light); font-size: 0.92rem; }

/* Question rendering */
.part-title { font-size: 1.15rem; font-weight: 700; color: var(--brand); margin: 26px 0 14px; padding-bottom: 8px; border-bottom: 2px solid var(--border); }
.question-container { margin-bottom: 30px; }
.question-num { font-size: 0.82rem; color: var(--text-light); font-weight: 600; margin-bottom: 6px; }
.question-text { font-size: 1.05rem; font-weight: 600; margin-bottom: 16px; line-height: 1.55; }
.options-list { display: flex; flex-direction: column; gap: 10px; }
.option-btn { display: flex; align-items: flex-start; gap: 12px; padding: 14px 18px; border: 2px solid var(--border); border-radius: var(--radius-sm);
    background: #fff; cursor: pointer; transition: var(--transition); text-align: left; font-family: inherit; font-size: 0.95rem; line-height: 1.5; width: 100%; }
.option-btn:hover { border-color: var(--primary); background: rgba(67,56,202,0.03); }
.option-btn.selected { border-color: var(--primary); background: rgba(67,56,202,0.06); }
.celpip .option-btn:hover { background: rgba(163,35,47,0.03); }
.celpip .option-btn.selected { background: rgba(163,35,47,0.06); }
.option-letter { width: 30px; height: 30px; border-radius: 50%; background: var(--bg); display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.82rem; flex-shrink: 0; color: var(--text-light); }
.option-btn.selected .option-letter { background: var(--primary); color: #fff; }
.option-text { flex: 1; padding-top: 3px; }

.passage-box { background: var(--bg); border-radius: var(--radius-sm); padding: 22px; margin-bottom: 22px; border-left: 4px solid var(--primary); line-height: 1.8; font-size: 0.95rem; white-space: pre-wrap; }
.passage-title { font-weight: 700; color: var(--brand); margin-bottom: 10px; font-size: 1rem; }
.para-block { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px 20px; margin-bottom: 14px; line-height: 1.75; font-size: 0.94rem; }
.para-label { display: inline-block; font-weight: 800; color: var(--primary); margin-right: 8px; }
.reader-comment { background: #fff7ed; border: 1px solid #fed7aa; border-radius: var(--radius-sm); padding: 22px; margin-bottom: 22px; line-height: 1.8; font-size: 0.95rem; white-space: pre-wrap; }
.celpip .reader-comment { background: #fef2f2; border-color: #fecaca; }
.blank-input { display: inline-block; min-width: 90px; padding: 2px 8px; margin: 0 2px; border: 2px solid var(--primary); border-radius: 6px; background: #fff; font-family: inherit; font-size: 0.95rem; }

.audio-player { background: var(--bg); border-radius: var(--radius-sm); padding: 18px; margin-bottom: 22px; display: flex; align-items: center; gap: 14px; }
.play-btn { width: 46px; height: 46px; border-radius: 50%; background: var(--primary); color: #fff; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: var(--transition); flex-shrink: 0; }
.play-btn:hover { background: var(--primary-light); transform: scale(1.05); }
.audio-meta { font-size: 0.85rem; color: var(--text-light); }
.audio-part-label { font-weight: 700; color: var(--text); }

/* Writing / Speaking */
.task-prompt { background: var(--bg); border-radius: var(--radius-sm); padding: 22px; margin-bottom: 20px; line-height: 1.7; font-size: 0.96rem; border-left: 4px solid var(--writing); }
.writing-area { width: 100%; min-height: 240px; padding: 16px; border: 2px solid var(--border); border-radius: var(--radius-sm); font-family: inherit; font-size: 1rem; line-height: 1.7; resize: vertical; }
.writing-area:focus { outline: none; border-color: var(--primary); }
.word-count { text-align: right; font-size: 0.85rem; color: var(--text-light); margin-top: 8px; }
.record-btn { width: 76px; height: 76px; border-radius: 50%; background: var(--danger); color: #fff; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; margin: 0 auto 14px; transition: var(--transition); position: relative; }
.record-btn.recording::before { content: ''; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid var(--danger); animation: pulse 1.5s infinite; }
@keyframes pulse { 0% { transform: scale(1); opacity: 1; } 100% { transform: scale(1.3); opacity: 0; } }
.record-status { text-align: center; font-weight: 600; margin-bottom: 6px; }
.record-time { text-align: center; color: var(--text-light); font-size: 0.9rem; }
.prep-timer { font-size: 2.2rem; font-weight: 800; color: var(--primary); text-align: center; font-variant-numeric: tabular-nums; }

/* Results */
.results-screen { max-width: 720px; margin: 0 auto; padding: 40px 0; }
.results-card { background: #fff; border-radius: var(--radius-lg); border: 1px solid var(--border); padding: 44px; text-align: center; }
.score-circle { width: 150px; height: 150px; border-radius: 50%; background: conic-gradient(var(--primary) 0%, var(--primary) var(--score-pct,0%), var(--border) var(--score-pct,0%)); display: flex; align-items: center; justify-content: center; margin: 22px auto; position: relative; }
.score-circle-inner { width: 122px; height: 122px; border-radius: 50%; background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.score-value { font-size: 2.4rem; font-weight: 800; color: var(--primary); }
.score-max { font-size: 0.82rem; color: var(--text-light); }
.score-level { display: inline-block; padding: 7px 22px; background: rgba(16,185,129,0.1); color: var(--success); border-radius: 50px; font-weight: 700; font-size: 1.05rem; margin-bottom: 14px; }
.score-breakdown { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px,1fr)); gap: 14px; margin-top: 28px; }
.breakdown-item { padding: 16px; background: var(--bg); border-radius: var(--radius-sm); }
.breakdown-label { font-size: 0.78rem; color: var(--text-light); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 4px; }
.breakdown-value { font-size: 1.4rem; font-weight: 800; color: var(--primary); }
.review-item { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 14px; margin-bottom: 12px; text-align: left; }
.review-item.correct { border-color: #BBF7D0; }
.review-item.incorrect { border-color: #FECACA; }
.review-head { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; margin-bottom: 8px; }
.review-head .ok { color: #16A34A; } .review-head .bad { color: #EF4444; }
.review-q { font-size: 13px; margin-bottom: 8px; line-height: 1.4; }
.review-opt { font-size: 12px; line-height: 1.6; padding: 2px 6px; border-radius: 4px; }
.review-opt.usr-cor { background: #DCFCE7; } .review-opt.usr-bad { background: #FEE2E2; } .review-opt.cor { background: #F0FDF4; }

.test-select-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 24px; }
.test-select-bar label { font-weight: 600; font-size: 0.9rem; }
.test-select-bar select { padding: 9px 14px; border: 2px solid var(--border); border-radius: var(--radius-sm); font-family: inherit; font-size: 0.92rem; }
.test-select-bar a { color: var(--primary); text-decoration: none; font-weight: 600; }
.test-select-bar a:hover { color: var(--primary-dark); text-decoration: underline; }
.test-select-bar a.active { color: var(--primary-dark); }
.test-select-bar .subnav-sep { color: var(--text-lighter); margin: 0 2px; }

/* ── Pre-test instructions screen ──────────────────────────────────────── */
.instructions-screen { display: flex; justify-content: center; padding: 8px 0 40px; }
.instructions-card { width: 100%; max-width: 720px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 32px 36px; box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06); }
.instructions-card h2 { margin: 0 0 18px; font-size: 1.4rem; color: var(--primary-dark); }
.instructions-list { margin: 0 0 6px; padding-left: 22px; }
.instructions-list li { margin-bottom: 14px; line-height: 1.6; color: #334155; font-size: 0.98rem; }
.instructions-meta { margin-top: 20px; padding: 12px 16px; background: #F1F5FB; border-radius: var(--radius-sm); color: var(--text-light); font-size: 0.9rem; }
.instructions-meta strong { color: var(--text); }

/* Question top bar — part title + timer (replaces the old sidebar) */
.q-topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
    padding: 14px 0 16px; margin-bottom: 22px; border-bottom: 2px solid var(--border); }
.q-title { font-size: 1.15rem; font-weight: 700; color: var(--brand); }
.q-count { color: var(--text-light); font-weight: 600; }
.q-timer { display: flex; align-items: center; gap: 8px; }
.q-timer .timer-label { color: var(--text-light); font-size: 0.85rem; }
.q-timer .timer-display { font-size: 1.5rem; font-weight: 800; color: var(--primary); font-variant-numeric: tabular-nums; }

/* Sticky in-exam navigation: Exit + module switcher */
.exam-nav { position: sticky; top: 68px; z-index: 900; background: #fff; border-bottom: 1px solid var(--border); box-shadow: 0 2px 10px rgba(0,0,0,0.05); }
.exam-nav-inner { display: flex; align-items: center; gap: 18px; min-height: 56px; padding: 10px 0; flex-wrap: wrap; }
.exam-exit { display: inline-flex; align-items: center; gap: 6px; color: var(--text-light); text-decoration: none; font-weight: 600; font-size: 0.9rem; padding: 8px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); transition: var(--transition); white-space: nowrap; }
.exam-exit:hover { color: var(--danger); border-color: var(--danger); }
.exam-modules { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.exam-modules a { text-decoration: none; color: var(--text-light); font-weight: 600; font-size: 0.9rem; padding: 8px 14px; border-radius: var(--radius-sm); transition: var(--transition); white-space: nowrap; }
.exam-modules a:hover { color: var(--primary); background: rgba(0,0,0,0.04); }
.exam-modules a.active { color: #fff; background: var(--primary); }

/* Toast */
.toast { position: fixed; bottom: 24px; right: 24px; background: var(--charcoal-2); color: #fff; padding: 14px 22px; border-radius: var(--radius-sm); box-shadow: var(--shadow-xl); z-index: 3000; transform: translateY(100px); opacity: 0; transition: all 0.3s ease; max-width: 360px; font-size: 0.9rem; }
.toast.show { transform: translateY(0); opacity: 1; }

/* Feature/info grid */
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px,1fr)); gap: 22px; }
.info-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; transition: var(--transition); }
.info-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.info-card h3 { color: var(--brand); margin-bottom: 10px; font-size: 1.1rem; }
.info-card p { color: var(--text-light); font-size: 0.92rem; }
.info-card .tt { font-size: 0.78rem; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: 0.05em; }

/* ── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 968px) {
    .test-layout { grid-template-columns: 1fr; }
    .test-sidebar { position: static; flex-direction: row; flex-wrap: wrap; }
    .test-sidebar > * { flex: 1; min-width: 200px; }
    .visa-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
    .nav-links { display: none; position: absolute; top: 68px; left: 0; right: 0; width: 100%; background: var(--charcoal); flex-direction: column; padding: 14px 20px; gap: 4px; box-shadow: var(--shadow-lg); }
    .nav-links.active { display: flex; }
    .nav-links li { width: 100%; }
    .nav-links a { display: block; padding: 12px 8px; }
    .nav-toggle { display: flex; }
    .hero { padding: 110px 0 50px; }
    .hero h1 { font-size: 2rem; }
    .hero-subtitle { font-size: 1rem; }
    .hero-stats { grid-template-columns: 1fr 1fr; gap: 14px; }
    .section { padding: 60px 0; }
    .section-header h2 { font-size: 1.6rem; }
    .cta-buttons { flex-direction: column; align-items: center; }
    .footer-grid { grid-template-columns: 1fr; gap: 24px; }
    .test-main { padding: 20px; }
    .question-grid { grid-template-columns: repeat(5, 1fr); }
}
@media (max-width: 480px) {
    .hero h1 { font-size: 1.6rem; }
    .btn-lg { width: 100%; }
    .question-grid { grid-template-columns: repeat(5, 1fr); }
    .results-card { padding: 24px; }
    .score-circle { width: 120px; height: 120px; }
    .score-circle-inner { width: 96px; height: 96px; }
    .score-value { font-size: 1.8rem; }
}
@media (max-width: 768px) {
    .exam-nav-inner { gap: 10px; }
    .exam-modules { margin-left: 0; width: 100%; justify-content: flex-start; }
    .exam-modules a { padding: 6px 10px; font-size: 0.85rem; }
    .exam-exit { padding: 6px 10px; font-size: 0.85rem; }
}
/* Back-to-PrepSettle link in focused section navbars */
.nav-links a.nav-back { color: rgba(255,255,255,0.5); font-size: 0.82rem; font-weight: 500; }
.nav-links a.nav-back:hover { color: #fff; }
.logo-img { height: 40px; width: auto; display: block; }

/* CELPIP: white navbar, black menu text */
.celpip .navbar { background: #fff; box-shadow: 0 1px 0 rgba(0,0,0,0.08); }
.celpip .nav-links a { color: #111; }
.celpip .nav-links a:hover, .celpip .nav-links a.active { color: #a3232f; }
.celpip .nav-links a.nav-back { color: #777; }
.celpip .nav-links a.nav-back:hover { color: #111; }
.celpip .nav-toggle span { background: #111; }
.celpip .nav-links { background: #fff; }
.ai-badge { display: inline-block; margin-top: 6px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: #0f766e; background: #ccfbf1; border: 1px solid #99f6e4; padding: 3px 9px; border-radius: 999px; }
.ai-badge::before { content: "✨ "; }

/* PrepSettle homepage: white navbar, dark menu text */
.home .navbar { background: #fff; box-shadow: 0 1px 0 rgba(0,0,0,0.08); }
.home .nav-links a { color: #111; }
.home .nav-links a:hover, .home .nav-links a.active { color: var(--primary); }
.home .nav-links a.nav-back { color: #777; }
.home .nav-links a.nav-back:hover { color: #111; }
.home .nav-toggle span { background: #111; }
.home .nav-links { background: #fff; }
.flag { display:inline-block; width:28px; height:18px; background-size:cover; background-position:center; border-radius:2px; vertical-align:middle; margin-right:4px; box-shadow:0 1px 2px rgba(0,0,0,0.15); }
.flag-ca { background-image: url('../../icons8-canada-96.png'); }
.flag-au { background-image: url('../../icons8-australia-100.png'); }

/* ── Article / blog content (shared by CELPIP & root blog) ─────────────── */
.article-content { font-size: 1.02rem; line-height: 1.8; color: #334155; }
.article-content h2 { font-size: 1.5rem; font-weight: 700; color: var(--brand); margin: 36px 0 14px; padding-top: 6px; scroll-margin-top: 90px; }
.article-content h3 { font-size: 1.18rem; font-weight: 700; color: var(--text); margin: 22px 0 10px; scroll-margin-top: 90px; }
.article-content p { margin-bottom: 16px; }
.article-content ul, .article-content ol { margin: 0 0 18px 22px; }
.article-content li { margin-bottom: 8px; }
.article-content strong { color: var(--text); font-weight: 700; }
.article-content a { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; }
.article-content a:hover { text-decoration: none; }
.celpip .article-content h2, .celpip .article-content h3 { color: var(--primary); }
.celpip .article-content a { color: #a3232f; }

.toc-list { list-style: none; margin: 18px 0 28px; padding: 18px 22px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); }
.article-content ul.toc-list { margin-left: 0; }
.toc-list li { margin-bottom: 8px; padding-left: 0; }
.toc-list li::before { content: none; }
.toc-list a { color: var(--primary); text-decoration: none; font-weight: 600; }
.toc-list a:hover { text-decoration: underline; }
.celpip .toc-list a { color: #a3232f; }

.table-wrapper { overflow-x: auto; margin: 18px 0 24px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.article-content table { width: 100%; border-collapse: collapse; font-size: 0.92rem; margin: 0; }
.article-content th, .article-content td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.article-content thead th { background: var(--brand); color: #fff; font-weight: 700; border-bottom: none; }
.article-content tbody tr:nth-child(even) { background: var(--bg); }
.celpip .article-content thead th { background: #a3232f; }
.table-note { font-size: 0.85rem; color: var(--text-light); font-style: italic; margin: -8px 0 20px; }

.back-link { display: inline-block; color: var(--primary); text-decoration: none; font-weight: 600; font-size: 0.92rem; margin-bottom: 16px; }
.back-link:hover { text-decoration: underline; }
.celpip .back-link { color: #a3232f; }
.breadcrumb { font-size: 0.85rem; color: var(--text-light); margin-bottom: 14px; }
.breadcrumb a { color: var(--primary); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.celpip .breadcrumb a { color: #a3232f; }
.article-meta { font-size: 0.85rem; color: var(--text-light); margin-top: 4px; }
.article-faq h2 { border-top: 1px solid var(--border); padding-top: 28px; }
.article-faq h3 { color: var(--primary); }
.celpip .article-faq h3 { color: #a3232f; }
.disclaimer { background: #fffbeb; border: 1px solid #fde68a; border-radius: var(--radius-sm); padding: 14px 18px; font-size: 0.88rem; color: #92400e; margin: 24px 0; }
.internal-links { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 22px; margin: 26px 0; }
.internal-links h3 { margin-top: 0; font-size: 1rem; }
.internal-links ul { margin: 0; list-style: none; }
.internal-links li { margin-bottom: 6px; }

/* Blog listing (hub + homepage teaser) */
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; margin-top: 8px; }
.blog-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; transition: var(--transition); display: flex; flex-direction: column; text-decoration: none; color: inherit; }
.blog-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-xl); border-color: transparent; }
.blog-card-image { height: 116px; display: flex; align-items: center; justify-content: center; }
.blog-card-image .flag { width: 48px; height: 32px; margin: 0; }
.blog-card-body { padding: 22px; flex: 1; display: flex; flex-direction: column; }
.blog-card-tag { align-self: flex-start; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; padding: 4px 10px; border-radius: 999px; margin-bottom: 10px; }
.blog-card h3 { font-size: 1.12rem; font-weight: 700; margin-bottom: 8px; line-height: 1.4; }
.blog-card p { color: var(--text-light); font-size: 0.9rem; margin-bottom: 14px; }
.blog-card .read-more { margin-top: auto; color: var(--primary); font-weight: 700; font-size: 0.88rem; }
.celpip .blog-card .read-more { color: #a3232f; }
.blog-section-title { font-size: 1.3rem; font-weight: 800; color: var(--brand); margin: 30px 0 6px; }
.celpip .blog-section-title { color: var(--primary); }
.blog-section-sub { color: var(--text-light); margin-bottom: 8px; font-size: 0.95rem; }

/* CELPIP homepage: tighten nav-to-hero and hero-to-skills spacing */
.celpip .hero { padding-top: 100px; padding-bottom: 24px; }
.celpip .hero-cta { margin-bottom: 20px; }
.celpip #skills { padding-top: 48px; }

/* ── AI scoring loader (writing/speaking results) ───────────────────────── */
.ai-loader { text-align: center; padding: 24px 0 8px; }
.ai-spinner {
    width: 46px; height: 46px; margin: 0 auto 16px;
    border: 4px solid var(--border); border-top-color: var(--primary);
    border-radius: 50%; animation: ai-spin 0.8s linear infinite;
}
@keyframes ai-spin { to { transform: rotate(360deg); } }
.ai-loader-text { font-size: 1.05rem; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.ai-loader-sub { color: var(--text-light); font-size: 0.9rem; }
.ai-dots::after { content: ''; animation: ai-dots 1.4s steps(4, end) infinite; }
@keyframes ai-dots {
    0%   { content: ''; }
    25%  { content: '.'; }
    50%  { content: '..'; }
    75%  { content: '...'; }
    100% { content: ''; }
}
@media (prefers-reduced-motion: reduce) {
    .ai-spinner { animation-duration: 2s; }
    .ai-dots::after { animation: none; content: '…'; }
}

/* ── Structured AI feedback (writing/speaking results) ───────────────────── */
.ai-feedback { margin-top: 18px; display: flex; flex-direction: column; gap: 14px; }
.ai-task { background: #F8FAFC; border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; }
.ai-task-label { font-weight: 700; color: var(--text); margin-bottom: 8px; font-size: 0.98rem; }
.ai-task-block { margin-top: 6px; }
.ai-task-block p { margin: 4px 0 0; line-height: 1.65; color: #334155; font-size: 0.92rem; }
.ai-tag { display: inline-block; font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; padding: 2px 9px; border-radius: 999px; }
.ai-tag.ok { background: rgba(16, 185, 129, 0.14); color: #0f9d6b; }
.ai-tag.bad { background: rgba(220, 38, 38, 0.12); color: #dc2626; }
.ai-summary { background: #fff; border: 1px solid var(--border); border-left: 4px solid var(--primary); border-radius: 10px; padding: 14px 16px; line-height: 1.7; font-size: 0.95rem; color: #334155; }

/* ── Disabled buttons & incomplete-task modal ───────────────────────────── */
.btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
.record-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.ps-modal-overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.55); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 20px; }
.ps-modal { background: #fff; border-radius: 14px; max-width: 420px; width: 100%; padding: 26px; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25); }
.ps-modal-title { font-size: 1.2rem; font-weight: 800; margin-bottom: 10px; color: var(--text); }
.ps-modal-text { color: var(--text-light); margin-bottom: 12px; font-size: 0.95rem; }
.ps-modal-list { list-style: disc; margin: 0 0 18px 20px; }
.ps-modal-list li { margin-bottom: 6px; color: #334155; font-size: 0.92rem; }
.ps-modal .btn { width: 100%; }

/* ── Cloze inline blanks & paragraph-match dropdowns ────────────────────── */
.blank-input { display: inline-block; font-size: 0.9rem; padding: 2px 8px; margin: 0 2px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; vertical-align: middle; min-width: 140px; }
.paragraph-match-item { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; padding: 10px 12px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.paragraph-match-select { min-width: 180px; font-size: 0.9rem; padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; }
.paragraph-match-stem { flex: 1; line-height: 1.5; font-size: 0.95rem; color: #334155; }

/* Reading MCQ rendered as dropdowns (official CELPIP reading format) */
.reading-mcq-item { margin-bottom: 14px; padding: 10px 12px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.reading-mcq-item .question-text { margin-bottom: 8px; font-size: 0.95rem; color: #334155; line-height: 1.5; }
.reading-mcq-select { width: 100%; font-size: 0.92rem; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; cursor: pointer; }

/* Official CELPIP reading part instruction text */
.part-instruction { margin: 14px 0 18px; padding: 12px 16px; background: #F1F5FB; border-left: 4px solid var(--primary); border-radius: var(--radius-sm); color: #334155; font-size: 0.95rem; line-height: 1.55; font-style: italic; }
.dd-glyph { font-size: 0.8em; color: var(--primary); vertical-align: middle; padding: 0 1px; }

/* ── Diagram / table passages ──────────────────────────────────────────── */
.diagram-table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 0.92rem; }
.diagram-table th, .diagram-table td { border: 1px solid var(--border); padding: 10px 12px; text-align: left; }
.diagram-table th { background: #F8FAFC; font-weight: 700; color: var(--text); }
.diagram-table td { background: #fff; color: #334155; }
.diagram-table tr:nth-child(even) td { background: #F8FAFC; }
