/* =========================================================================
   SANTRE IT — TACTICAL CONSOLE
   Security-awareness training platform. Design system.
   ========================================================================= */

:root {
    /* canvas + surface */
    --ink-900: oklch(0.13 0.015 245);      /* page */
    --ink-850: oklch(0.16 0.018 245);      /* raised surface */
    --ink-800: oklch(0.19 0.018 245);      /* card */
    --ink-700: oklch(0.24 0.016 245);      /* card hover */
    --ink-600: oklch(0.32 0.014 245);      /* strong border */
    --ink-500: oklch(0.42 0.012 245);      /* muted border */
    --ink-400: oklch(0.55 0.010 245);      /* muted text */
    --ink-300: oklch(0.72 0.008 245);      /* secondary text */
    --ink-100: oklch(0.96 0.006 95);       /* primary text */

    /* signature accent — acid emerald */
    --accent: oklch(0.83 0.19 152);
    --accent-dim: oklch(0.65 0.17 152);
    --accent-glow: oklch(0.83 0.19 152 / 0.28);

    /* semantic */
    --warn: oklch(0.82 0.17 72);
    --warn-soft: oklch(0.82 0.17 72 / 0.10);
    --warn-line: oklch(0.82 0.17 72 / 0.35);

    --danger: oklch(0.68 0.22 25);
    --danger-soft: oklch(0.68 0.22 25 / 0.10);
    --danger-line: oklch(0.68 0.22 25 / 0.35);

    --success: oklch(0.83 0.19 152);
    --success-soft: oklch(0.83 0.19 152 / 0.09);
    --success-line: oklch(0.83 0.19 152 / 0.38);

    /* fonts */
    --ff-display: "Fraunces", "Iowan Old Style", Georgia, serif;
    --ff-body: "IBM Plex Sans", "SF Pro Text", system-ui, sans-serif;
    --ff-mono: "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;

    /* scale */
    --radius-sharp: 2px;
    --radius-card: 4px;
    --radius-pill: 999px;
    --pad-card: clamp(1.25rem, 2vw, 2rem);
    --dash: 1px dashed oklch(0.32 0.014 245);
    --rule: 1px solid oklch(0.24 0.016 245);
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--ff-body);
    font-size: 15px;
    line-height: 1.55;
    color: var(--ink-100);
    background-color: var(--ink-900);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    position: relative;
    overflow-x: hidden;
}

/* atmosphere: grid + faint emerald glow on page top */
body::before {
    content: "";
    position: fixed; inset: 0;
    pointer-events: none;
    z-index: 0;
    background-image:
        linear-gradient(oklch(0.24 0.016 245 / 0.25) 1px, transparent 1px),
        linear-gradient(90deg, oklch(0.24 0.016 245 / 0.25) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 75%);
    opacity: 0.55;
}

body::after {
    content: "";
    position: fixed;
    top: -20vh; left: 50%;
    width: 120vw; height: 60vh;
    transform: translateX(-50%);
    pointer-events: none;
    z-index: 0;
    background: radial-gradient(ellipse at center, var(--accent-glow), transparent 65%);
    filter: blur(60px);
    opacity: 0.4;
}

main, nav, footer, .container { position: relative; z-index: 1; }

/* --------- typography ---------- */
h1, h2, h3, h4 {
    font-family: var(--ff-display);
    font-weight: 500;
    letter-spacing: -0.02em;
    color: var(--ink-100);
    line-height: 1.1;
}

h1 { font-size: clamp(2rem, 4vw, 3.2rem); font-variation-settings: "opsz" 144, "SOFT" 30; }
h2 { font-size: clamp(1.5rem, 2.4vw, 2rem); font-variation-settings: "opsz" 72, "SOFT" 20; }
h3 { font-size: 1.15rem; font-variation-settings: "opsz" 36, "SOFT" 10; letter-spacing: -0.01em; }
h4 { font-size: 1rem; font-family: var(--ff-body); font-weight: 500; letter-spacing: 0; }

p { color: var(--ink-300); }

a { color: var(--accent); text-decoration: none; transition: color .15s ease, opacity .15s ease; }
a:hover { color: var(--ink-100); }

::selection { background: var(--accent); color: var(--ink-900); }

/* --------- navbar ---------- */
.navbar {
    background: oklch(0.13 0.015 245 / 0.72);
    backdrop-filter: saturate(140%) blur(16px);
    -webkit-backdrop-filter: saturate(140%) blur(16px);
    padding: 0.9rem 0;
    border-bottom: var(--rule);
    position: sticky;
    top: 0;
    z-index: 20;
}

.nav-container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 clamp(1rem, 3vw, 2.25rem);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.nav-brand {
    font-family: var(--ff-mono);
    font-size: 0.98rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--ink-100);
    text-transform: uppercase;
    position: relative;
    padding: 0.35rem 0.65rem;
    border: 1px solid var(--ink-600);
    border-radius: var(--radius-sharp);
    background: linear-gradient(180deg, oklch(0.19 0.018 245), oklch(0.16 0.018 245));
}
.nav-brand::after {
    content: "";
    position: absolute;
    inset: auto 6px 5px auto;
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent);
    animation: pulse 2.2s infinite ease-in-out;
    display: none;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 0.35rem;
    align-items: center;
}

.nav-menu a {
    color: var(--ink-300);
    font-size: 0.88rem;
    font-weight: 450;
    padding: 0.5rem 0.85rem;
    border-radius: var(--radius-sharp);
    border: 1px solid transparent;
    transition: all .15s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.nav-menu a::before {
    content: "";
    width: 5px; height: 5px; border-radius: 50%;
    background: var(--ink-500);
    transition: background .15s ease, box-shadow .15s ease;
}
.nav-menu a:hover {
    color: var(--ink-100);
    border-color: var(--ink-600);
    background: oklch(0.19 0.018 245 / 0.5);
}
.nav-menu a:hover::before {
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent);
}

/* --------- container ---------- */
.container {
    max-width: 1240px;
    margin: 3rem auto 4rem;
    padding: 0 clamp(1rem, 3vw, 2.25rem);
    width: 100%;
    flex: 1;
    animation: rise 0.55s cubic-bezier(.2,.7,.2,1) both;
}

/* --------- cards ---------- */
.card {
    background: linear-gradient(180deg, var(--ink-800), var(--ink-850));
    border: 1px solid var(--ink-600);
    border-radius: var(--radius-card);
    padding: var(--pad-card);
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
}
.card::before {
    content: "";
    position: absolute; inset: 0 0 auto 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-dim), transparent);
    opacity: 0.35;
}

/* --------- hero (index) ---------- */
.hero {
    text-align: left;
    padding: clamp(3rem, 7vw, 5.5rem) 0 clamp(2rem, 4vw, 3rem);
    position: relative;
}
.hero::before {
    content: "◆ SANTRE IT · SECURITY AWARENESS PROGRAM";
    display: block;
    font-family: var(--ff-mono);
    font-size: 0.72rem;
    letter-spacing: 0.25em;
    color: var(--accent);
    margin-bottom: 1.25rem;
    font-weight: 500;
}
.hero h1 {
    max-width: 20ch;
    font-size: clamp(2.4rem, 6vw, 4.8rem);
    font-weight: 400;
    font-variation-settings: "opsz" 144, "SOFT" 50;
    margin-bottom: 1rem;
}
.hero h1 em {
    color: var(--accent);
    font-style: italic;
    font-variation-settings: "opsz" 144, "SOFT" 100;
}
.hero p {
    max-width: 56ch;
    color: var(--ink-300);
    font-size: clamp(1rem, 1.3vw, 1.2rem);
    line-height: 1.55;
    margin-bottom: 0.5rem;
}

/* --------- buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.7rem 1.25rem;
    background: transparent;
    color: var(--ink-100);
    border: 1px solid var(--ink-500);
    border-radius: var(--radius-sharp);
    text-decoration: none;
    font-family: var(--ff-body);
    font-size: 0.88rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: all .18s cubic-bezier(.3,.8,.3,1);
    position: relative;
    line-height: 1;
}
.btn::before {
    content: "";
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--ink-400);
    transition: all .2s ease;
}
.btn:hover {
    border-color: var(--accent);
    color: var(--ink-100);
    transform: translateY(-1px);
    background: oklch(0.19 0.018 245 / 0.6);
}
.btn:hover::before {
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent);
}

.btn-primary {
    background: var(--accent);
    color: oklch(0.13 0.015 245);
    border-color: var(--accent);
    font-weight: 600;
}
.btn-primary::before {
    background: oklch(0.13 0.015 245);
    box-shadow: none;
}
.btn-primary:hover {
    background: oklch(0.88 0.18 152);
    border-color: oklch(0.88 0.18 152);
    color: oklch(0.13 0.015 245);
    box-shadow: 0 8px 28px -8px var(--accent-glow), 0 0 0 1px var(--accent-glow);
}
.btn-primary:hover::before { background: oklch(0.13 0.015 245); }

.btn-danger {
    color: var(--ink-100);
    border-color: var(--danger-line);
    background: var(--danger-soft);
}
.btn-danger::before { background: var(--danger); }
.btn-danger:hover {
    border-color: var(--danger);
    background: oklch(0.68 0.22 25 / 0.18);
}

.btn-warning {
    color: var(--ink-100);
    border-color: var(--warn-line);
    background: var(--warn-soft);
}
.btn-warning::before { background: var(--warn); }
.btn-warning:hover {
    border-color: var(--warn);
    background: oklch(0.82 0.17 72 / 0.16);
}

/* --------- forms ---------- */
.form-group { margin-bottom: 1.25rem; }
.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    font-family: var(--ff-mono);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--ink-400);
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    background: var(--ink-900);
    border: 1px solid var(--ink-600);
    border-radius: var(--radius-sharp);
    font-family: var(--ff-mono);
    font-size: 0.95rem;
    color: var(--ink-100);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-group input::placeholder { color: var(--ink-500); }

/* auth cards center their form */
.card form .btn,
.card form .btn-primary { width: auto; }

/* --------- alerts (flashed messages) ---------- */
.alert {
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sharp);
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
    border: 1px solid;
    display: flex; align-items: center; gap: 0.6rem;
    font-family: var(--ff-mono);
    letter-spacing: 0.01em;
}
.alert::before {
    content: "▸"; color: inherit; opacity: 0.7; font-family: var(--ff-mono);
}
.alert-success {
    background: var(--success-soft);
    color: var(--accent);
    border-color: var(--success-line);
}
.alert-error {
    background: var(--danger-soft);
    color: oklch(0.80 0.18 25);
    border-color: var(--danger-line);
}
.alert-warning {
    background: var(--warn-soft);
    color: var(--warn);
    border-color: var(--warn-line);
}

/* --------- stat cards ---------- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: linear-gradient(180deg, var(--ink-800), var(--ink-850));
    border: 1px solid var(--ink-600);
    border-radius: var(--radius-card);
    padding: 1.25rem 1.5rem;
    position: relative;
    overflow: hidden;
}
.stat-card::before {
    content: "";
    position: absolute; left: 0; top: 0; bottom: 0;
    width: 2px;
    background: var(--accent);
    box-shadow: 0 0 14px var(--accent-glow);
}
.stat-card::after {
    content: "";
    position: absolute; top: 1rem; right: 1rem;
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent);
    animation: pulse 2.4s infinite ease-in-out;
}
.stat-card h3 {
    font-family: var(--ff-mono);
    font-size: 2.6rem;
    font-weight: 400;
    letter-spacing: -0.03em;
    color: var(--ink-100);
    margin-bottom: 0.15rem;
    font-feature-settings: "tnum" 1;
}
.stat-card p {
    font-family: var(--ff-mono);
    font-size: 0.7rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--ink-400);
}

/* --------- module / scenario grid ---------- */
.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.module-card {
    background: var(--ink-800);
    border: 1px solid var(--ink-600);
    border-radius: var(--radius-card);
    padding: 1.4rem 1.5rem;
    cursor: pointer;
    transition: all .2s cubic-bezier(.3,.8,.3,1);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 180px;
}
.module-card::before {
    content: "";
    position: absolute; left: 0; top: 0; bottom: 0; width: 0;
    background: var(--accent);
    transition: width .25s cubic-bezier(.3,.8,.3,1);
}
.module-card:hover {
    border-color: var(--accent-dim);
    background: var(--ink-700);
    transform: translateY(-3px);
    box-shadow: 0 18px 42px -18px oklch(0 0 0 / 0.6);
}
.module-card:hover::before { width: 3px; }
.module-card h3 {
    color: var(--ink-100);
    margin-bottom: 0.5rem;
    padding-right: 1.5rem;
}
.module-card p {
    color: var(--ink-300);
    font-size: 0.92rem;
    margin-bottom: 1rem;
    flex: 1;
}
.module-card .btn,
.module-card a { align-self: flex-start; }

/* --------- progress bar ---------- */
.progress-bar {
    background: var(--ink-900);
    border: 1px solid var(--ink-600);
    border-radius: var(--radius-sharp);
    overflow: hidden;
    height: 28px;
    margin: 0.75rem 0 0.25rem;
    position: relative;
}
.progress-bar::before {
    content: "";
    position: absolute; inset: 0;
    background-image: repeating-linear-gradient(
        -45deg,
        transparent 0, transparent 6px,
        oklch(0.19 0.018 245 / 0.6) 6px, oklch(0.19 0.018 245 / 0.6) 7px
    );
    pointer-events: none;
    z-index: 1;
}
.progress-fill {
    background: linear-gradient(90deg, var(--accent-dim), var(--accent));
    height: 100%;
    display: flex; align-items: center; justify-content: flex-end;
    padding-right: 0.65rem;
    color: var(--ink-900);
    font-family: var(--ff-mono);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    transition: width 1.1s cubic-bezier(.3,.7,.3,1);
    position: relative;
    z-index: 2;
    box-shadow: 0 0 18px var(--accent-glow);
}

/* --------- quiz ---------- */
.quiz-question {
    background: var(--ink-850);
    border: 1px solid var(--ink-600);
    border-left: 2px solid var(--accent);
    padding: 1.4rem 1.5rem;
    margin-bottom: 1.25rem;
    border-radius: var(--radius-card);
    position: relative;
}
.quiz-question::before {
    content: attr(data-q);
    position: absolute; top: 0.75rem; right: 1rem;
    font-family: var(--ff-mono);
    font-size: 0.72rem;
    color: var(--accent);
    letter-spacing: 0.15em;
}
.quiz-question h4 {
    color: var(--ink-100);
    margin-bottom: 1rem;
    font-size: 1.05rem;
    line-height: 1.4;
    font-weight: 500;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.quiz-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.9rem;
    border: 1px solid var(--ink-600);
    border-radius: var(--radius-sharp);
    cursor: pointer;
    transition: all .15s ease;
    background: oklch(0.16 0.018 245 / 0.5);
    color: var(--ink-300);
}
.quiz-option:hover {
    border-color: var(--accent-dim);
    color: var(--ink-100);
    background: var(--ink-800);
}
.quiz-option input[type="radio"] {
    width: 16px; height: 16px;
    accent-color: var(--accent);
    flex-shrink: 0;
    cursor: pointer;
}
.quiz-option:has(input:checked) {
    border-color: var(--accent);
    background: var(--success-soft);
    color: var(--ink-100);
}

.quiz-option.wrong {
    border-color: var(--danger-line);
    background: var(--danger-soft);
    color: oklch(0.85 0.14 25);
    cursor: not-allowed;
    pointer-events: none;
    opacity: 0.95;
    position: relative;
}
.quiz-option.wrong::after {
    content: "✕ WRONG";
    position: absolute; right: 0.85rem; top: 50%; transform: translateY(-50%);
    font-family: var(--ff-mono);
    font-size: 0.68rem;
    letter-spacing: 0.18em;
    color: oklch(0.80 0.18 25);
    font-weight: 500;
}
.quiz-option.wrong input[type="radio"] {
    accent-color: oklch(0.80 0.18 25);
    opacity: 0.6;
}

.quiz-option.correct {
    border-color: var(--accent);
    background: var(--success-soft);
    color: var(--ink-100);
    position: relative;
}
.quiz-option.correct::after {
    content: "✓ CORRECT";
    position: absolute; right: 0.85rem; top: 50%; transform: translateY(-50%);
    font-family: var(--ff-mono);
    font-size: 0.68rem;
    letter-spacing: 0.18em;
    color: var(--accent);
    font-weight: 500;
}

.quiz-question.solved {
    border-left-color: var(--accent);
    opacity: 0.92;
}
.quiz-question.solved .quiz-option:not(.correct) {
    opacity: 0.45;
    pointer-events: none;
}

.quiz-hint {
    margin-top: 0.75rem;
    font-family: var(--ff-mono);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    min-height: 1.1em;
}
.quiz-hint.is-correct { color: var(--accent); }
.quiz-hint.is-wrong   { color: oklch(0.82 0.17 25); }

#submitBtn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    background: var(--ink-800);
    color: var(--ink-400);
    border-color: var(--ink-600);
    box-shadow: none;
    transform: none;
}
#submitBtn:disabled::before { background: var(--ink-500); box-shadow: none; }

/* --------- email preview (Outlook-style) ---------- */
.email-container {
    background: #ffffff;
    color: #201f1e;
    border: 1px solid #edebe9;
    border-radius: 6px;
    padding: clamp(1.25rem, 2.5vw, 2.5rem) clamp(1.25rem, 3vw, 2.75rem) 2.25rem;
    margin: 1.25rem 0;
    font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Arial, sans-serif;
    box-shadow: 0 24px 50px -24px oklch(0 0 0 / 0.65), inset 0 0 0 1px oklch(0 0 0 / 0.03);
    position: relative;
}

.email-subject {
    font-size: clamp(1.35rem, 2vw, 1.65rem);
    line-height: 1.3;
    font-weight: 400;
    color: #201f1e;
    margin-bottom: 1.1rem;
    letter-spacing: -0.005em;
    padding-right: clamp(0rem, 20vw, 240px);
    word-break: break-word;
}

.email-header-row {
    display: flex;
    gap: 0.9rem;
    align-items: flex-start;
    padding-right: clamp(0rem, 20vw, 240px);
}

.email-avatar {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: #4b53bc;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
    flex-shrink: 0;
    font-family: "Segoe UI", Arial, sans-serif;
}

.email-sender-info { flex: 1; min-width: 0; }

.email-sender-line {
    font-size: 0.95rem;
    color: #201f1e;
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: baseline;
    line-height: 1.3;
    word-break: break-word;
}
.email-sender-line .name { font-weight: 600; color: #201f1e; }
.email-sender-line .addr { color: #605e5c; font-weight: 400; font-size: 0.88rem; }

.email-recipient {
    font-size: 0.84rem;
    color: #605e5c;
    margin-top: 0.2rem;
    display: flex;
    gap: 0.65rem;
    line-height: 1.4;
}
.email-recipient .label {
    color: #8a8886;
    min-width: 18px;
    flex-shrink: 0;
}
.email-recipient .value { color: #201f1e; }

/* action toolbar (Reply / Reply All / Forward / ...) */
.email-actions {
    position: absolute;
    top: clamp(1.25rem, 2.5vw, 2.5rem);
    right: clamp(1.25rem, 3vw, 2.75rem);
    display: flex;
    align-items: stretch;
    border: 1px solid #edebe9;
    border-radius: 4px;
    background: #ffffff;
    overflow: hidden;
    box-shadow: 0 1px 2px oklch(0 0 0 / 0.04);
}
.email-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 0.85rem;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 0.82rem;
    color: #201f1e;
    cursor: pointer;
    border-right: 1px solid #edebe9;
    white-space: nowrap;
}
.email-action-btn:last-child { border-right: none; padding: 0.55rem 0.75rem; }
.email-action-btn svg {
    width: 14px; height: 14px;
    stroke: #7a5fd8;
    fill: none;
    stroke-width: 2;
    flex-shrink: 0;
}
.email-action-btn:hover { background: #f3f2f1; }
.email-action-btn .dots { font-size: 1rem; color: #323130; letter-spacing: 0.08em; line-height: 0.5; }

.email-datetime {
    position: absolute;
    top: calc(clamp(1.25rem, 2.5vw, 2.5rem) + 44px + 10px);
    right: clamp(1.25rem, 3vw, 2.75rem);
    font-size: 0.82rem;
    color: #605e5c;
    font-family: "Segoe UI", Arial, sans-serif;
    white-space: nowrap;
}

/* attachment chip */
.email-attachment {
    display: inline-flex;
    align-items: stretch;
    border: 1px solid #edebe9;
    border-radius: 4px;
    overflow: hidden;
    background: #ffffff;
    margin: 1.25rem 0;
    box-shadow: 0 1px 0 oklch(0 0 0 / 0.04);
    max-width: 340px;
}
.email-attachment-icon {
    background: #d93025;
    color: #ffffff;
    font-family: "Segoe UI", Arial, sans-serif;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    width: 46px;
    min-height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-shrink: 0;
}
.email-attachment-icon::after {
    content: "";
    position: absolute; top: 0; right: 0;
    border-style: solid;
    border-width: 0 8px 8px 0;
    border-color: transparent #ffffff transparent transparent;
}
.email-attachment-meta {
    padding: 0.5rem 1rem;
    line-height: 1.25;
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.email-attachment-name {
    font-size: 0.88rem;
    color: #201f1e;
    font-weight: 400;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.email-attachment-size {
    font-size: 0.78rem;
    color: #605e5c;
    margin-top: 1px;
}
.email-attachment-chevron {
    padding: 0 0.65rem;
    color: #8a8886;
    font-size: 0.68rem;
    border-left: 1px solid #edebe9;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

/* body */
.email-body {
    font-size: 0.95rem;
    color: #201f1e;
    line-height: 1.7;
    white-space: pre-wrap;
    font-family: "Segoe UI", -apple-system, Arial, sans-serif;
    padding-top: 0.25rem;
}
.email-body a {
    color: #0067b8;
    text-decoration: underline;
    word-break: break-all;
}
.email-body a:hover { color: #004578; }
.email-body mark {
    background: #fff35b;
    color: #201f1e;
    padding: 2px 6px;
    font-weight: 700;
    border-radius: 1px;
}

/* responsive: stack actions below sender on narrow viewports */
@media (max-width: 720px) {
    .email-subject, .email-header-row { padding-right: 0; }
    .email-actions,
    .email-datetime {
        position: static;
        margin-top: 0.75rem;
    }
    .email-actions { width: fit-content; }
    .email-datetime { display: block; }
}

/* --------- red-flags panel ---------- */
.red-flags {
    background: var(--warn-soft);
    border: 1px solid var(--warn-line);
    border-left: 3px solid var(--warn);
    border-radius: var(--radius-card);
    padding: 1.4rem 1.5rem;
    margin-top: 1.5rem;
    position: relative;
}
.red-flags::before {
    content: "⚠ THREAT INDICATORS";
    display: block;
    font-family: var(--ff-mono);
    font-size: 0.72rem;
    letter-spacing: 0.22em;
    color: var(--warn);
    margin-bottom: 0.75rem;
}
.red-flags h3 {
    color: var(--ink-100);
    margin-bottom: 0.75rem;
    font-size: 1rem;
    font-family: var(--ff-body);
    font-weight: 500;
}
.red-flags ul { padding-left: 1.25rem; list-style: none; }
.red-flags li {
    color: var(--ink-300);
    margin-bottom: 0.5rem;
    position: relative;
    padding-left: 0.75rem;
    font-size: 0.94rem;
}
.red-flags li::before {
    content: "▸";
    position: absolute; left: -0.25rem;
    color: var(--warn);
}

/* --------- result card ---------- */
.result-card {
    text-align: center;
    padding: 3rem 2rem;
    border-radius: var(--radius-card);
    border: 1px solid;
    position: relative;
    overflow: hidden;
}
.result-card::before {
    content: "";
    position: absolute; inset: 0;
    background: radial-gradient(circle at 50% 0%, currentColor, transparent 60%);
    opacity: 0.08;
    pointer-events: none;
}
.result-card.correct { border-color: var(--success-line); color: var(--accent); background: var(--success-soft); }
.result-card.incorrect { border-color: var(--danger-line); color: oklch(0.80 0.18 25); background: var(--danger-soft); }
.result-card h1 { color: currentColor; font-variation-settings: "opsz" 144, "SOFT" 100; }
.result-card p { color: var(--ink-100); opacity: 0.9; max-width: 52ch; margin: 0.5rem auto 0; }
.result-icon { font-size: 4rem; margin-bottom: 0.5rem; filter: drop-shadow(0 0 24px currentColor); }

/* --------- table (admin) ---------- */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    font-family: var(--ff-mono);
    font-size: 0.86rem;
    background: var(--ink-850);
    border: 1px solid var(--ink-600);
    border-radius: var(--radius-card);
    overflow: hidden;
}
th, td {
    padding: 0.85rem 1rem;
    text-align: left;
    border-bottom: var(--dash);
    color: var(--ink-300);
}
th {
    background: var(--ink-900);
    color: var(--accent);
    font-weight: 500;
    font-size: 0.7rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    border-bottom: 1px solid var(--ink-600);
}
tbody tr { transition: background .15s ease; }
tbody tr:hover { background: var(--ink-800); }
tbody tr:last-child td { border-bottom: none; }
td strong { color: var(--ink-100); }

/* --------- footer ---------- */
.footer {
    border-top: var(--rule);
    background: oklch(0.13 0.015 245);
    color: var(--ink-400);
    padding: 1.75rem 2rem;
    margin-top: auto;
    text-align: center;
    font-family: var(--ff-mono);
    font-size: 0.75rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    position: relative;
    z-index: 1;
}
.footer p::before { content: "◇ "; color: var(--accent); }

/* --------- timer (fixed) ---------- */
.timer {
    position: fixed;
    top: 78px;
    right: 24px;
    background: var(--ink-800);
    color: var(--accent);
    border: 1px solid var(--accent-dim);
    padding: 0.55rem 0.9rem;
    border-radius: var(--radius-sharp);
    font-family: var(--ff-mono);
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    font-weight: 500;
    z-index: 15;
    box-shadow: 0 0 20px var(--accent-glow), inset 0 0 0 1px oklch(0 0 0 / 0.4);
}
.timer::before {
    content: "● ";
    color: var(--accent);
    animation: pulse 1.5s infinite ease-in-out;
}

/* --------- module content panels ---------- */
.module-content {
    display: block;
    max-width: 82ch;
}

.module-content h3 {
    font-family: var(--ff-display);
    font-size: clamp(1.15rem, 1.8vw, 1.45rem);
    font-weight: 500;
    color: var(--ink-100);
    font-variation-settings: "opsz" 72, "SOFT" 40;
    letter-spacing: -0.01em;
    position: relative;
    padding: 1.75rem 0 0.5rem 1.85rem;
    margin-top: 1.5rem;
    border-top: 1px dashed var(--ink-600);
}
.module-content > h3:first-child {
    border-top: none;
    margin-top: 0;
    padding-top: 0.25rem;
}

.module-content h3::before {
    content: "◆";
    position: absolute;
    left: 0;
    top: calc(1.75rem + 0.1em);
    color: var(--accent);
    font-family: var(--ff-mono);
    font-size: 0.9rem;
    text-shadow: 0 0 12px var(--accent-glow);
}
.module-content > h3:first-child::before {
    top: calc(0.25rem + 0.1em);
}

.module-content p {
    color: var(--ink-300);
    line-height: 1.65;
    margin: 0.35rem 0 0.9rem;
    max-width: 72ch;
    font-size: 0.98rem;
}

.module-content h3 + p {
    color: var(--ink-100);
    font-size: 1rem;
    line-height: 1.6;
    margin-top: 0.5rem;
    padding-left: 1.85rem;
    border-left: 1px solid var(--ink-600);
}

/* unordered lists — tactical info tiles */
.module-content ul {
    list-style: none;
    padding: 0;
    margin: 0.85rem 0 1.1rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 0.5rem;
}

.module-content ul li {
    background: var(--ink-850);
    border: 1px solid var(--ink-600);
    border-left: 2px solid var(--accent-dim);
    border-radius: var(--radius-sharp);
    padding: 0.8rem 1rem 0.8rem 2.1rem;
    color: var(--ink-300);
    font-size: 0.94rem;
    line-height: 1.5;
    position: relative;
    transition: border-left-color .18s ease, background .18s ease, transform .18s ease;
}
.module-content ul li::before {
    content: "▸";
    position: absolute;
    left: 0.9rem;
    top: 0.8rem;
    color: var(--accent);
    font-family: var(--ff-mono);
    font-size: 0.9rem;
    line-height: 1.45;
}
.module-content ul li:hover {
    border-left-color: var(--accent);
    background: var(--ink-800);
    transform: translateX(2px);
}
.module-content ul li strong {
    color: var(--accent);
    font-weight: 600;
    font-family: var(--ff-body);
    margin-right: 0.2rem;
}

/* ordered lists — numbered action steps */
.module-content ol {
    list-style: none;
    counter-reset: step;
    padding: 0;
    margin: 0.85rem 0 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.module-content ol li {
    counter-increment: step;
    background: var(--ink-850);
    border: 1px solid var(--ink-600);
    border-radius: var(--radius-sharp);
    padding: 0.9rem 1rem 0.9rem 3.75rem;
    color: var(--ink-100);
    font-size: 0.96rem;
    line-height: 1.55;
    position: relative;
    transition: border-color .18s ease, background .18s ease, transform .18s ease;
}
.module-content ol li::before {
    content: counter(step, decimal-leading-zero);
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    font-family: var(--ff-mono);
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--accent);
    background: var(--ink-900);
    border: 1px solid var(--accent-dim);
    border-radius: var(--radius-sharp);
    padding: 0.3rem 0.5rem;
    letter-spacing: 0.12em;
    line-height: 1;
    box-shadow: inset 0 0 8px oklch(0 0 0 / 0.5);
}
.module-content ol li:hover {
    border-color: var(--accent-dim);
    background: var(--ink-800);
    transform: translateX(2px);
}
.module-content ol li strong {
    color: var(--accent);
    font-weight: 600;
    margin-right: 0.2rem;
}

/* paragraph immediately after a list = closing commentary */
.module-content ul + p,
.module-content ol + p {
    color: var(--ink-300);
    font-style: italic;
    font-family: var(--ff-display);
    font-variation-settings: "opsz" 36, "SOFT" 100;
    font-size: 1rem;
    padding: 0.6rem 0 0.5rem 1.85rem;
    border-left: 1px solid var(--accent-dim);
    margin: 0.25rem 0 0.75rem;
}

/* --------- utility: section label ---------- */
.micro-label {
    display: inline-block;
    font-family: var(--ff-mono);
    font-size: 0.7rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

/* --------- scenario badge in phishing list ---------- */
.card p strong { color: var(--ink-100); font-weight: 500; font-family: var(--ff-mono); font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; }

/* --------- animations ---------- */
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.55; transform: scale(0.88); }
}

@keyframes rise {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

.card { animation: rise 0.5s cubic-bezier(.2,.7,.2,1) both; }
.card:nth-child(1) { animation-delay: 0ms; }
.card:nth-child(2) { animation-delay: 60ms; }
.card:nth-child(3) { animation-delay: 120ms; }
.card:nth-child(4) { animation-delay: 180ms; }

/* scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--ink-900); }
::-webkit-scrollbar-thumb { background: var(--ink-600); border-radius: var(--radius-sharp); }
::-webkit-scrollbar-thumb:hover { background: var(--ink-500); }

/* --------- responsive ---------- */
@media (max-width: 820px) {
    .nav-container { flex-direction: column; gap: 0.75rem; align-items: stretch; }
    .nav-menu { flex-wrap: wrap; justify-content: center; gap: 0.25rem; }
    .container { margin-top: 1.75rem; }
    .hero { padding-top: 2rem; }
    .stats-grid, .module-grid { grid-template-columns: 1fr; }
    .timer { top: auto; bottom: 20px; right: 20px; }
    table { font-size: 0.78rem; }
    th, td { padding: 0.65rem 0.65rem; }
}

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

/* ============================================================
   GUIDE PAGE
   ============================================================ */

.guide {
    max-width: 72ch;
    margin: 0 auto;
    padding: 1.5rem 0 4rem;
}

.guide-hero {
    padding: 2.5rem 0 1.75rem;
    border-bottom: 1px dashed var(--ink-700);
    margin-bottom: 2rem;
}

.guide-hero h1 {
    font-size: clamp(2.25rem, 4vw, 3.25rem);
    line-height: 1.05;
    margin: 0.5rem 0 1rem;
}

.guide-lede {
    font-size: 1.15rem;
    line-height: 1.55;
    color: var(--ink-300);
    max-width: 62ch;
}

.guide-cta {
    margin-top: 1.75rem;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.guide-section {
    margin: 2.5rem 0;
    padding-bottom: 2rem;
    border-bottom: 1px dashed var(--ink-700);
}

.guide-section:last-child { border-bottom: 0; }

.guide-section h2 {
    font-size: 1.75rem;
    margin: 0.5rem 0 1rem;
}

.guide-section h3 {
    font-size: 1.2rem;
    margin: 1.25rem 0 0.5rem;
    color: var(--accent);
    font-family: var(--ff-body);
    letter-spacing: 0;
    text-transform: none;
}

.guide-section p { line-height: 1.65; margin: 0.5rem 0; }

.guide-bullets, .guide-steps {
    margin: 0.75rem 0 1rem 1.25rem;
    padding: 0;
}

.guide-bullets li, .guide-steps li {
    margin: 0.4rem 0;
    line-height: 1.55;
}

.guide-bullets-compact li { margin: 0.3rem 0; }

.guide-module {
    border: 1px solid var(--ink-700);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin: 0.75rem 0;
    background: rgba(255, 255, 255, 0.015);
}

.guide-module h3 { margin-top: 0; color: var(--ink-50); }

.guide-keytakeaway {
    font-size: 0.95rem;
    color: var(--accent);
    margin-top: 0.5rem !important;
}

.guide-note {
    border-left: 3px solid var(--accent);
    padding: 0.5rem 0.9rem;
    background: rgba(49, 208, 139, 0.05);
    margin: 1rem 0;
    font-size: 0.95rem;
}

.guide-signoff {
    margin-top: 1.25rem !important;
    color: var(--ink-400);
    font-style: italic;
}

.badge {
    display: inline-block;
    padding: 0.08rem 0.5rem;
    border-radius: 4px;
    font-family: var(--ff-mono);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 600;
}

.badge-wrong { background: rgba(239, 68, 68, 0.18); color: #fca5a5; }
.badge-correct { background: rgba(49, 208, 139, 0.15); color: var(--accent); }

.btn-secondary {
    background: transparent;
    color: var(--ink-50);
    border: 1px solid var(--ink-600);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

/* Print layout — produces a clean PDF via browser print or headless chrome */

@media print {
    @page { margin: 18mm 16mm; size: A4; }

    html, body {
        background: #fff !important;
        color: #111 !important;
    }

    body::before, body::after { display: none !important; }

    .navbar, .footer, .no-print, .guide-cta { display: none !important; }

    main.container { padding: 0; max-width: 100%; }

    .guide { max-width: 100%; padding: 0; }

    .guide-hero, .guide-section {
        border-color: #ccc;
        page-break-inside: avoid;
    }

    .guide-hero h1, .guide-section h2, .guide-section h3 {
        color: #111 !important;
    }

    .guide-section h3 { color: #0a7d46 !important; }

    .guide-keytakeaway { color: #0a7d46 !important; }

    .guide-note {
        background: #f4f9f6 !important;
        border-left-color: #0a7d46 !important;
        color: #111 !important;
    }

    .micro-label { color: #0a7d46 !important; }

    .guide-lede, .guide-section p, .guide-bullets li, .guide-steps li {
        color: #222 !important;
    }

    .guide-module {
        background: #fafafa !important;
        border: 1px solid #ddd !important;
    }

    .badge-wrong { background: #fde2e2 !important; color: #b23535 !important; }
    .badge-correct { background: #e3f5ea !important; color: #0a7d46 !important; }

    a { color: #0a7d46 !important; text-decoration: none; }

    code {
        background: #f2f2f2 !important;
        color: #111 !important;
        padding: 0 0.3em;
        border-radius: 3px;
    }
}
