/* ── Security Awareness E-Learning — white-label base theme ─────────── */
:root {
    --brand: #1d4ed8;
    --ink: #1a2233;
    --muted: #667085;
    --bg: #f4f6fb;
    --card: #ffffff;
    --border: #e4e8f0;
    --ok: #15803d;
    --ok-bg: #e7f6ec;
    --warn: #b45309;
    --warn-bg: #fdf3e3;
    --radius: 12px;
    --shadow: 0 1px 3px rgba(16,24,40,.06), 0 1px 2px rgba(16,24,40,.04);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--ink);
    background: var(--bg);
    line-height: 1.55;
}

/* topbar */
.topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: .85rem 1.25rem; background: var(--card);
    border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: .55rem; font-weight: 700;
    color: var(--ink); text-decoration: none; font-size: 1.05rem; }
.brand-dot { width: 14px; height: 14px; border-radius: 4px; background: var(--brand); }
.topnav { display: flex; align-items: center; gap: 1rem; }
.topnav a { color: var(--muted); text-decoration: none; font-weight: 500; font-size: .95rem; }
.topnav a:hover { color: var(--ink); }
.topnav a.logout { color: var(--brand); }
.langswitch { display: inline-flex; gap: .15rem; border: 1px solid var(--border);
    border-radius: 8px; overflow: hidden; }
.langswitch a { padding: .15rem .45rem; font-size: .72rem; font-weight: 600; color: var(--muted); }
.langswitch a.active { background: var(--brand); color: #fff; }

/* layout */
.container { max-width: 880px; margin: 1.75rem auto; padding: 0 1.25rem; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin-bottom: 1.1rem; }
.page-head h1 { margin: 0; font-size: 1.6rem; flex: 1 1 auto; }
.page-head .muted { width: 100%; margin: 0; }
.back { color: var(--muted); text-decoration: none; font-size: .9rem; width: 100%; }
.goal { width: 100%; background: var(--ok-bg); border-left: 3px solid var(--ok);
    padding: .6rem .85rem; border-radius: 6px; margin: .4rem 0 0; }

/* card */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 1.4rem; margin-bottom: 1.25rem; }
.card h2 { margin-top: 0; font-size: 1.15rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
@media (max-width: 680px) { .grid-2 { grid-template-columns: 1fr; } }

.muted { color: var(--muted); }
.small { font-size: .85rem; }
.ta-right { text-align: right; }

/* auth */
.auth-card { max-width: 420px; margin: 3rem auto; }
.auth-card h1 { margin-top: 0; }
label { display: block; font-weight: 600; font-size: .9rem; margin: .9rem 0 .35rem; }
input[type=email], input[type=text], input:not([type]) , .code-input {
    width: 100%; padding: .65rem .75rem; border: 1px solid var(--border);
    border-radius: 8px; font-size: 1rem; background: #fff; }
.code-input { letter-spacing: .4em; text-align: center; font-size: 1.4rem; }
.dev-hint { border-top: 1px dashed var(--border); padding-top: .6rem; }

/* buttons */
.btn { display: inline-block; padding: .55rem .95rem; border-radius: 8px; font-weight: 600;
    font-size: .92rem; text-decoration: none; border: 1px solid transparent; cursor: pointer;
    background: #eef1f7; color: var(--ink); }
.btn:hover { filter: brightness(.97); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--ink); }
.btn-sm { padding: .35rem .6rem; font-size: .85rem; }
.btn-lg { padding: .7rem 1.3rem; font-size: 1rem; }
button.btn { width: auto; }
form .btn-primary { margin-top: 1.1rem; }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin: 1rem 0; }

/* tables */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: .6rem .5rem; border-bottom: 1px solid var(--border);
    vertical-align: top; }
.table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }

/* badges */
.badge { display: inline-block; padding: .15rem .55rem; border-radius: 999px; font-size: .78rem; font-weight: 600; }
.badge-passed { background: var(--ok-bg); color: var(--ok); }
.badge-in_progress { background: var(--warn-bg); color: var(--warn); }
.badge-not_started { background: #eef1f7; color: var(--muted); }
.tag { display: inline-block; padding: .1rem .45rem; border-radius: 6px; background: #eef1f7;
    color: var(--muted); font-size: .76rem; font-weight: 600; }

/* alerts */
.alert { padding: .7rem .9rem; border-radius: 8px; margin: .6rem 0; font-size: .92rem; }
.alert-error { background: #fdecec; color: #b42318; }
.alert-info { background: #eaf1fe; color: #1d4ed8; }

/* media placeholders */
.media { width: 100%; border-radius: 8px; }
.placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; gap: .3rem; background: #f7f9fc; border: 1px dashed var(--border);
    border-radius: 8px; padding: 1.5rem 1rem; color: var(--muted); }
.placeholder-media { aspect-ratio: 16/9; }
.ph-icon { font-size: 1.8rem; opacity: .5; }

/* video "coming soon" placeholder */
.placeholder-video { background: linear-gradient(135deg, #1a2744 0%, #1d4ed8 100%);
    border: none; color: #fff; gap: .8rem; }
.placeholder-video .ph-video-icon { color: rgba(255,255,255,.7); }
.placeholder-video .ph-title { font-size: 1rem; font-weight: 600; color: #fff; margin: 0; }
.placeholder-video .muted { color: rgba(255,255,255,.65) !important; font-size: .8rem; margin: 0; }

/* prose */
.prose h2, .prose h3, .prose h4 { margin: 1.1rem 0 .4rem; }
.prose p { margin: .5rem 0; }
.prose ul { margin: .4rem 0 .4rem 1.1rem; }

/* flashcards */
.flashcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .75rem; }
.flashcard { position: relative; min-height: 110px; border: 1px solid var(--border); border-radius: 10px;
    background: #fff; padding: .9rem; cursor: pointer; text-align: left; font: inherit; }
.flashcard .fc-back { display: none; color: var(--brand); }
.flashcard.flipped .fc-front { display: none; }
.flashcard.flipped .fc-back { display: block; }
.flashcard .fc-front { font-weight: 600; }

/* quiz */
.question legend { font-weight: 600; margin-bottom: .6rem; }
.question .qnum { display: block; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em;
    color: var(--muted); margin-bottom: .25rem; }
.option { display: flex; align-items: flex-start; gap: .6rem; padding: .55rem .7rem; border: 1px solid var(--border);
    border-radius: 8px; margin: .4rem 0; font-weight: 400; cursor: pointer; }
.option:hover { background: #f7f9fc; }
.option input { margin-top: .2rem; }

/* result */
.result-card { text-align: center; max-width: 560px; margin: 2rem auto; }
.result-emoji { font-size: 3rem; line-height: 1; }
.result-card.is-pass .result-emoji { color: var(--ok); }
.result-card.is-fail .result-emoji { color: var(--warn); }
.result-score { font-size: 1.15rem; font-weight: 600; }
.result-card .cta-row { justify-content: center; }

/* footer */
.footer { max-width: 880px; margin: 1rem auto 2rem; padding: 0 1.25rem; color: var(--muted);
    font-size: .85rem; display: flex; gap: .5rem; }
.footer a { color: var(--muted); }


/* preview banner */
.preview-banner { background: #fef3c7; border-bottom: 2px solid #f59e0b; color: #92400e;
    text-align: center; padding: .6rem 1rem; font-size: .9rem; font-weight: 600;
    letter-spacing: .01em; }
