/* assets/style.css */
/* Design: Clean editorial — warm cream background, deep ink headings, amber accents */

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

:root {
    --cream:   #faf7f2;
    --ink:     #1a1a2e;
    --amber:   #e8952e;
    --amber2:  #f5b655;
    --muted:   #6b6b7b;
    --border:  #e2ddd6;
    --white:   #ffffff;
    --red:     #d94f3d;
    --green:   #2d8f5e;
    --radius:  12px;
    --shadow:  0 4px 24px rgba(26,26,46,.08);
}

body {
    font-family: 'DM Sans', sans-serif;
    background: #faf7f2;
    background: var(--cream);
    color: #1a1a2e;
    color: var(--ink);
    min-height: 100vh;
    line-height: 1.6;
}

/* ── HEADER ── */
.site-header {
    background: #0d0d1f;
    padding: 0 36px;
    height: 68px;
    display: -webkit-box; display: -ms-flexbox; display: flex;
    -webkit-box-align: center; -ms-flex-align: center; align-items: center;
    -webkit-box-pack: justify; -ms-flex-pack: justify; justify-content: space-between;
    border-bottom: 1px solid rgba(255,255,255,.08);
    box-shadow: 0 2px 24px rgba(0,0,0,.4);
    position: -webkit-sticky; position: sticky;
    top: 0;
    z-index: 100;
}

/* ── LOGO ── */
.logo {
    display: -webkit-box; display: -ms-flexbox; display: flex;
    -webkit-box-align: center; -ms-flex-align: center; align-items: center;
    gap: 13px;
    text-decoration: none;
    flex-shrink: 0;
}
.logo:hover .logo-img-wrap { box-shadow: 0 0 0 2.5px #8b5cf6, 0 6px 20px rgba(139,92,246,.35); }

/* Logo image tile */
.logo-img-wrap {
    width: 46px;
    height: 46px;
    border-radius: 13px;
    overflow: hidden;
    background: #ffffff;
    -ms-flex-negative: 0;
    flex-shrink: 0;
    margin-right: 13px;
    display: -webkit-box; display: -ms-flexbox; display: flex;
    -webkit-box-align: center; -ms-flex-align: center; align-items: center;
    -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center;
    box-shadow: 0 0 0 2px rgba(139,92,246,.45),
                0 4px 16px rgba(139,92,246,.2);
    -webkit-transition: box-shadow .2s;
    transition: box-shadow .2s;
}
.logo-img {
    width: 42px;
    height: 42px;
    object-fit: contain;
    display: block;
}
/* Fallback if image missing */
.logo-img-fallback {
    background: linear-gradient(135deg, #7c3aed, #3b82f6);
    font-family: 'DM Sans', sans-serif;
    font-size: 1.4rem;
    font-weight: 900;
    color: #fff;
}

/* Logo text */
.logo-text-wrap {
    display: -webkit-box; display: -ms-flexbox; display: flex;
    -webkit-box-orient: vertical; -webkit-box-direction: normal; -ms-flex-direction: column; flex-direction: column;
    gap: 2px;
    line-height: 1;
}
.logo-name {
    font-family: 'DM Sans', sans-serif;
    font-size: 1.28rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.2px;
    line-height: 1;
}
/* "eno" in purple — solid color, no gradient trick that can break */
.logo-zeno {
    color: #a78bfa;
}
.logo-tagline {
    font-family: 'DM Sans', sans-serif;
    font-size: .6rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255,255,255,.32);
    line-height: 1;
}

/* ── SITE NAV ── */
.site-nav {
    display: -webkit-box; display: -ms-flexbox; display: flex;
    -webkit-box-align: center; -ms-flex-align: center; align-items: center;
    gap: 4px;
}
.site-nav a {
    color: rgba(255,255,255,.6);
    text-decoration: none;
    font-family: 'DM Sans', sans-serif;
    font-size: .85rem;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid transparent;
    -webkit-transition: all .15s;
    transition: all .15s;
    white-space: nowrap;
}
.site-nav a:hover {
    background: rgba(255,255,255,.08);
    border-color: rgba(255,255,255,.1);
    color: #fff;
}

/* ── LAYOUT ── */
.container {
    max-width: 780px;
    margin: 0 auto;
    padding: 48px 20px 80px;
}
.container--wide { max-width: 1100px; }

/* ── CARDS ── */
.card {
    background: #ffffff;
    background: var(--white);
    border: 1px solid #e2ddd6;
    border: 1px solid var(--border);
    border-radius: 12px;
    border-radius: var(--radius);
    padding: 36px;
    box-shadow: 0 4px 24px rgba(26,26,46,.08);
    box-shadow: var(--shadow);
}
.card + .card { margin-top: 20px; }

/* ── TYPOGRAPHY ── */
h1 {
    font-family: 'Playfair Display', serif;
    font-size: 2rem; font-size: clamp(1.8rem, 4vw, 2.6rem);
    font-weight: 900;
    line-height: 1.15;
    color: #1a1a2e;
    color: var(--ink);
    margin-bottom: 10px;
}
h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 20px;
}
h3 { font-size: 1.05rem; font-weight: 600; margin-bottom: 8px; }
p  { color: #6b6b7b;
 color: var(--muted); margin-bottom: 12px; }
p:last-child { margin-bottom: 0; }

/* ── QUIZ LIST (index.php) ── */
/* Flexbox fallback for browsers without CSS Grid */
.quiz-grid {
    display: -webkit-box;
    display: -ms-flexbox;
    display: -webkit-box; display: -ms-flexbox; display: flex;
    -ms-flex-wrap: wrap;
    -webkit-flex-wrap: wrap; -ms-flex-wrap: wrap; flex-wrap: wrap;
    margin-top: 32px;
    margin-left: -10px;
    margin-right: -10px;
}
.quiz-grid .quiz-card {
    -webkit-box-flex: 1;
    -ms-flex: 1 1 300px;
    flex: 1 1 300px;
    margin: 10px;
    max-width: calc(50% - 20px);
}
/* CSS Grid enhancement for modern browsers */
@supports (display: grid) {
    .quiz-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 20px;
        margin-left: 0;
        margin-right: 0;
    }
    .quiz-grid .quiz-card {
        margin: 0;
        max-width: none;
    }
}
.quiz-card {
    background: #ffffff;
    background: var(--white);
    border: 1px solid #e2ddd6;
    border: 1px solid var(--border);
    border-radius: 12px;
    border-radius: var(--radius);
    padding: 28px;
    text-decoration: none;
    color: #1a1a2e;
    color: var(--ink);
    display: -webkit-box; display: -ms-flexbox; display: flex;
    -webkit-box-orient: vertical; -webkit-box-direction: normal; -ms-flex-direction: column; flex-direction: column;
    gap: 10px;
    -webkit-transition: transform .18s, box-shadow .18s;
    transition: transform .18s, box-shadow .18s;
    box-shadow: 0 4px 24px rgba(26,26,46,.08);
    box-shadow: var(--shadow);
}
.quiz-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 32px rgba(26,26,46,.13);
}
.quiz-card h3 { font-family: 'Playfair Display', serif; font-size: 1.15rem; }
.quiz-card p  { font-size: .9rem; color: #6b6b7b;
 color: var(--muted); margin: 0; }
.quiz-card .pill {
    align-self: flex-start;
    background: #fff6e8;
    color: #e8952e;
    color: var(--amber);
    border: 1px solid #f5b655;
    border: 1px solid var(--amber2);
    font-size: .75rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    letter-spacing: .5px;
    text-transform: uppercase;
}
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6b6b7b;
    color: var(--muted);
}
.empty-state .icon { font-size: 3rem; margin-bottom: 12px; }

/* ── FORMS ── */
.form-group { margin-bottom: 20px; }
.form-group label {
    display: block;
    font-weight: 600;
    font-size: .9rem;
    margin-bottom: 6px;
    color: #1a1a2e;
    color: var(--ink);
}
.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="password"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid #e2ddd6;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-family: 'DM Sans', sans-serif;
    font-size: .95rem;
    color: #1a1a2e;
    color: var(--ink);
    background: #ffffff;
    background: var(--white);
    -webkit-transition: border-color .15s;
    transition: border-color .15s;
    outline: none;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: #e8952e;
    border-color: var(--amber);
}
.form-group textarea { resize: vertical; min-height: 260px; }
.form-hint { font-size: .8rem; color: #6b6b7b;
 color: var(--muted); margin-top: 5px; }

/* ── BUTTONS ── */
.btn {
    display: inline-flex;
    -webkit-box-align: center; -ms-flex-align: center; align-items: center;
    gap: 6px;
    padding: 11px 24px;
    border-radius: 8px;
    font-family: 'DM Sans', sans-serif;
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    -webkit-transition: opacity .15s, transform .1s;
    transition: opacity .15s, transform .1s;
}
.btn:active { transform: scale(.98); }
.btn-primary  { background: #e8952e;
 background: var(--amber); color: #ffffff;
 color: var(--white); }
.btn-primary:hover { opacity: .88; }
.btn-dark     { background: #1a1a2e;
 background: var(--ink);   color: #ffffff;
   color: var(--white); }
.btn-dark:hover   { opacity: .85; }
.btn-outline  { background: transparent; border: 1.5px solid #e2ddd6;
 border: 1.5px solid var(--border); color: #1a1a2e;
 color: var(--ink); }
.btn-outline:hover { border-color: #1a1a2e;
 border-color: var(--ink); }
.btn-danger   { background: #d94f3d;
 background: var(--red);   color: #ffffff;
   color: var(--white); }
.btn-danger:hover { opacity: .85; }
.btn-sm { padding: 6px 14px; font-size: .82rem; }

/* ── MCQ QUESTION CARD ── */
.question-block {
    background: #ffffff;
    background: var(--white);
    border: 1px solid #e2ddd6;
    border: 1px solid var(--border);
    border-radius: 12px;
    border-radius: var(--radius);
    padding: 28px;
    margin-bottom: 20px;
}
.question-block .q-number {
    font-size: .78rem;
    font-weight: 700;
    color: #e8952e;
    color: var(--amber);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}
.question-block .q-text {
    font-family: 'Playfair Display', serif;
    font-size: 1.08rem;
    font-weight: 700;
    color: #1a1a2e;
    color: var(--ink);
    margin-bottom: 18px;
}
.options { display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-orient: vertical; -webkit-box-direction: normal; -ms-flex-direction: column; flex-direction: column; gap: 10px; }
.option-label {
    display: -webkit-box; display: -ms-flexbox; display: flex;
    -webkit-box-align: center; -ms-flex-align: center; align-items: center;
    gap: 12px;
    padding: 11px 16px;
    border: 1.5px solid #e2ddd6;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    -webkit-transition: border-color .15s, background .15s;
    transition: border-color .15s, background .15s;
    font-size: .95rem;
}
.option-label:hover { border-color: #e8952e;
 border-color: var(--amber); background: #fff8ee; }
.option-label input[type="radio"] { accent-color: #e8952e;
 accent-color: var(--amber); width: 16px; height: 16px; }
.option-label input[type="radio"]:checked + span { font-weight: 600; }
.option-label.opted { border-color: #e8952e;
 border-color: var(--amber); background: #fff8ee; }

/* ── QUIZ HEADER / TIMER ── */
.quiz-meta {
    display: -webkit-box; display: -ms-flexbox; display: flex;
    -webkit-box-pack: justify; -ms-flex-pack: justify; justify-content: space-between;
    -webkit-box-align: center; -ms-flex-align: center; align-items: center;
    margin-bottom: 28px;
    -webkit-flex-wrap: wrap; -ms-flex-wrap: wrap; flex-wrap: wrap;
    gap: 12px;
}
.quiz-meta h1 { margin-bottom: 0; }
.timer-badge {
    background: #1a1a2e;
    background: var(--ink);
    color: #e8952e;
    color: var(--amber);
    font-family: 'DM Sans', sans-serif;
    font-weight: 700;
    font-size: 1.15rem;
    padding: 8px 20px;
    border-radius: 40px;
    letter-spacing: 1px;
    min-width: 90px;
    text-align: center;
}

/* ── RESULT PAGE ── */
.result-score {
    text-align: center;
    padding: 28px 0 20px;
}
.score-big {
    font-family: 'Playfair Display', serif;
    font-size: 5rem;
    font-weight: 900;
    color: #e8952e;
    color: var(--amber);
    line-height: 1;
}
.score-denom { font-size: 1.8rem; color: #6b6b7b;
 color: var(--muted); }
.result-meta {
    display: -webkit-box; display: -ms-flexbox; display: flex;
    -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center;
    gap: 32px;
    margin-top: 20px;
    -webkit-flex-wrap: wrap; -ms-flex-wrap: wrap; flex-wrap: wrap;
}
.result-meta .stat { text-align: center; }
.result-meta .stat-val { font-size: 1.3rem; font-weight: 700; color: #1a1a2e;
 color: var(--ink); }
.result-meta .stat-lbl { font-size: .8rem; color: #6b6b7b;
 color: var(--muted); }
.result-actions { display: -webkit-box; display: -ms-flexbox; display: flex; gap: 12px; -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center; margin-top: 28px; -webkit-flex-wrap: wrap; -ms-flex-wrap: wrap; flex-wrap: wrap; }

/* ── LEADERBOARD ── */
.leaderboard-table { width: 100%; border-collapse: collapse; }
.leaderboard-table th {
    text-align: left;
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: #6b6b7b;
    color: var(--muted);
    border-bottom: 2px solid #e2ddd6;
    border-bottom: 2px solid var(--border);
    padding: 10px 14px;
}
.leaderboard-table td { padding: 13px 14px; border-bottom: 1px solid #e2ddd6;
 border-bottom: 1px solid var(--border); font-size: .95rem; }
.leaderboard-table tr:last-child td { border-bottom: none; }
.leaderboard-table tr:nth-child(1) td { background: #fffbf0; }
.rank-medal { font-size: 1.1rem; }
.rank-num { font-weight: 700; color: #1a1a2e;
 color: var(--ink); }

/* ── ALERTS ── */
.alert {
    padding: 13px 18px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: .93rem;
    font-weight: 500;
}
.alert-success { background: #ecfaf3; color: #2d8f5e;
 color: var(--green); border: 1px solid #b7e8cf; }
.alert-error   { background: #fdf0ee; color: #d94f3d;
 color: var(--red);   border: 1px solid #f3bcb6; }
.alert-info    { background: #fff8ee; color: #e8952e;
 color: var(--amber);  border: 1px solid #f5b655;
  border: 1px solid var(--amber2); }

/* ── ADMIN STYLES ── */
.admin-body {
    font-family: 'DM Sans', sans-serif;
    background: #f0ede8;
    min-height: 100vh;
}
.admin-header {
    background: #0d0d1f;
    padding: 0 28px;
    display: -webkit-box; display: -ms-flexbox; display: flex;
    -webkit-box-align: center; -ms-flex-align: center; align-items: center;
    -webkit-box-pack: justify; -ms-flex-pack: justify; justify-content: space-between;
    height: 62px;
    border-bottom: 1px solid rgba(255,255,255,.07);
    box-shadow: 0 2px 16px rgba(0,0,0,.3);
    position: -webkit-sticky; position: sticky;
    top: 0;
    z-index: 100;
}
.admin-header .logo-img-wrap { width: 36px; height: 36px; border-radius: 9px; }
.admin-header .logo-img       { width: 32px; height: 32px; }
.admin-header .logo-name      { font-size: 1.08rem; }
.admin-header .logo-tagline   { display: none; }
.admin-header .logo-text-wrap { gap: 0; }
.admin-header nav { display: -webkit-box; display: -ms-flexbox; display: flex; gap: 4px; -webkit-box-align: center; -ms-flex-align: center; align-items: center; }
.admin-header nav a {
    color: rgba(255,255,255,.6);
    text-decoration: none;
    font-family: 'DM Sans', sans-serif;
    font-size: .83rem;
    font-weight: 500;
    padding: 6px 11px;
    border-radius: 7px;
    -webkit-transition: background .15s, color .15s;
    transition: background .15s, color .15s;
}
.admin-header nav a:hover  { background: rgba(255,255,255,.1); color: #fff; }
.admin-header nav a.active { color: #a78bfa; background: rgba(139,92,246,.12); }

.admin-container { max-width: 1100px; margin: 0 auto; padding: 36px 20px 80px; }
.admin-page-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.7rem;
    font-weight: 900;
    margin-bottom: 24px;
}
.admin-table { width: 100%; border-collapse: collapse; background: #ffffff;
 background: var(--white); border-radius: 12px;
 border-radius: var(--radius); overflow: hidden; box-shadow: 0 4px 24px rgba(26,26,46,.08);
 box-shadow: var(--shadow); }
.admin-table th {
    text-align: left;
    padding: 12px 16px;
    font-size: .78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: #6b6b7b;
    color: var(--muted);
    background: #f8f6f2;
    border-bottom: 2px solid #e2ddd6;
    border-bottom: 2px solid var(--border);
}
.admin-table td { padding: 14px 16px; border-bottom: 1px solid #e2ddd6;
 border-bottom: 1px solid var(--border); font-size: .93rem; vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: #fdfaf6; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: .75rem; font-weight: 600; }
.badge-green  { background: #ecfaf3; color: #2d8f5e;
 color: var(--green); }
.badge-gray   { background: #f0ede8; color: #6b6b7b;
 color: var(--muted); }
.admin-actions { display: -webkit-box; display: -ms-flexbox; display: flex; gap: 8px; -webkit-flex-wrap: wrap; -ms-flex-wrap: wrap; flex-wrap: wrap; }

/* Admin login card */
.login-wrap {
    display: -webkit-box; display: -ms-flexbox; display: flex;
    -webkit-box-align: center; -ms-flex-align: center; align-items: center;
    -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center;
    min-height: 100vh;
    background: #0d0d1f;
}
.login-card {
    background: #ffffff;
    background: var(--white);
    border-radius: 16px;
    padding: 44px 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,.45);
}
.login-card h1 { font-size: 1.8rem; margin-bottom: 6px; }
.login-card p { margin-bottom: 28px; }

/* ── RESPONSIVE ── */
@media (max-width: 600px) {
    .card { padding: 22px; }
    .quiz-meta { -webkit-box-orient: vertical; -webkit-box-direction: normal; -ms-flex-direction: column; flex-direction: column; -webkit-box-align: start; -ms-flex-align: start; align-items: flex-start; }
    .result-meta { gap: 18px; }
    .admin-table th, .admin-table td { padding: 10px 10px; }
    .admin-actions { -webkit-box-orient: vertical; -webkit-box-direction: normal; -ms-flex-direction: column; flex-direction: column; }
}

/* ── V2 ADDITIONS ───────────────────────────────────────────── */

/* Difficulty badges */
.diff-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .6px;
}
.diff-easy   { background: #ecfaf3; color: #2d8f5e; border: 1px solid #b7e8cf; }
.diff-medium { background: #fff8ee; color: #c97a1a; border: 1px solid #f5b655;
 border: 1px solid var(--amber2); }
.diff-hard   { background: #fdf0ee; color: #d94f3d; border: 1px solid #f3bcb6; }

/* Category badge */
.cat-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: .76rem;
    font-weight: 600;
    background: #f0ede8;
    color: #6b6b7b;
    color: var(--muted);
    border: 1px solid #e2ddd6;
    border: 1px solid var(--border);
}

/* Tag badge */
.tag-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: .75rem;
    font-weight: 500;
    background: #eef2ff;
    color: #4f5fa8;
    border: 1px solid #c7cfee;
}

/* ── FILTER BAR (index.php) ── */
.home-hero { margin-bottom: 28px; }
.home-hero h1 { margin-bottom: 6px; }

.filter-bar {
    background: #ffffff;
    background: var(--white);
    border: 1px solid #e2ddd6;
    border: 1px solid var(--border);
    border-radius: 12px;
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-bottom: 32px;
    display: -webkit-box; display: -ms-flexbox; display: flex;
    -webkit-box-orient: vertical; -webkit-box-direction: normal; -ms-flex-direction: column; flex-direction: column;
    gap: 14px;
    box-shadow: 0 4px 24px rgba(26,26,46,.08);
    box-shadow: var(--shadow);
}
.filter-section {
    display: -webkit-box; display: -ms-flexbox; display: flex;
    -webkit-box-align: center; -ms-flex-align: center; align-items: center;
    gap: 12px;
    -webkit-flex-wrap: wrap; -ms-flex-wrap: wrap; flex-wrap: wrap;
}
.filter-label {
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: #6b6b7b;
    color: var(--muted);
    min-width: 72px;
    flex-shrink: 0;
}
.filter-pills { display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-flex-wrap: wrap; -ms-flex-wrap: wrap; flex-wrap: wrap; gap: 6px; }
.fpill {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: .82rem;
    font-weight: 500;
    color: #6b6b7b;
    color: var(--muted);
    background: #f4f1ec;
    border: 1.5px solid transparent;
    text-decoration: none;
    -webkit-transition: all .15s;
    transition: all .15s;
}
.fpill:hover { border-color: #e2ddd6;
 border-color: var(--border); color: #1a1a2e;
 color: var(--ink); }
.fpill-active {
    background: #1a1a2e;
    background: var(--ink);
    color: #ffffff !important;
    color: var(--white) !important;
    border-color: #1a1a2e;
    border-color: var(--ink);
}
/* ── QUIZ CARD UPDATES ── */
.qcard-top { display: -webkit-box; display: -ms-flexbox; display: flex; gap: 6px; -webkit-flex-wrap: wrap; -ms-flex-wrap: wrap; flex-wrap: wrap; margin-bottom: 8px; }
.qcard-tags { display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-flex-wrap: wrap; -ms-flex-wrap: wrap; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.qcard-footer {
    display: -webkit-box; display: -ms-flexbox; display: flex;
    -webkit-box-align: center; -ms-flex-align: center; align-items: center;
    -webkit-box-pack: justify; -ms-flex-pack: justify; justify-content: space-between;
    margin-top: auto;
    padding-top: 12px;
}
.qcard-cta { color: #e8952e;
 color: var(--amber); font-weight: 700; font-size: .88rem; }
.quiz-card { -webkit-box-orient: vertical; -webkit-box-direction: normal; -ms-flex-direction: column; flex-direction: column; gap: 6px; }

/* ── QUIZ INTRO PAGE (quiz.php) ── */
.breadcrumb {
    display: -webkit-box; display: -ms-flexbox; display: flex;
    -webkit-box-align: center; -ms-flex-align: center; align-items: center;
    gap: 8px;
    font-size: .85rem;
    color: #6b6b7b;
    color: var(--muted);
    margin-bottom: 24px;
    -webkit-flex-wrap: wrap; -ms-flex-wrap: wrap; flex-wrap: wrap;
}
.breadcrumb a { color: #e8952e;
 color: var(--amber); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

.quiz-intro-card { max-width: 680px; margin: 0 auto; }
.intro-badges { display: -webkit-box; display: -ms-flexbox; display: flex; gap: 8px; -webkit-flex-wrap: wrap; -ms-flex-wrap: wrap; flex-wrap: wrap; margin-bottom: 16px; }
.intro-desc { font-size: 1rem; color: #6b6b7b;
 color: var(--muted); margin-bottom: 0; }

.intro-stats {
    display: -webkit-box; display: -ms-flexbox; display: flex;
    gap: 0;
    border: 1px solid #e2ddd6;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    margin: 24px 0;
}
.istat {
    flex: 1;
    display: -webkit-box; display: -ms-flexbox; display: flex;
    -webkit-box-orient: vertical; -webkit-box-direction: normal; -ms-flex-direction: column; flex-direction: column;
    -webkit-box-align: center; -ms-flex-align: center; align-items: center;
    padding: 16px;
    border-right: 1px solid #e2ddd6;
    border-right: 1px solid var(--border);
    gap: 4px;
}
.istat:last-child { border-right: none; }
.istat-val { font-size: 1.3rem; font-weight: 700; color: #1a1a2e;
 color: var(--ink); }
.istat-lbl { font-size: .75rem; color: #6b6b7b;
 color: var(--muted); text-align: center; }

.intro-divider { border: none; border-top: 1px solid #e2ddd6;
 border-top: 1px solid var(--border); margin: 24px 0; }

.name-entry h2 { font-family: 'DM Sans', sans-serif; font-size: 1.1rem; font-weight: 600; margin-bottom: 4px; }
.name-input { font-size: 1.05rem !important; padding: 14px 16px !important; }
.btn-start { padding: 14px 36px; font-size: 1rem; margin-top: 4px; }

/* ── QUESTIONS PAGE ── */
.progress-wrap {
    height: 5px;
    background: #e2ddd6;
    background: var(--border);
    border-radius: 3px;
    margin-bottom: 8px;
    overflow: hidden;
}
.progress-bar {
    height: 100%;
    background: #e8952e;
    background: var(--amber);
    border-radius: 3px;
    -webkit-transition: width .3s ease;
    transition: width .3s ease;
}

.opt-letter {
    display: inline-flex;
    -webkit-box-align: center; -ms-flex-align: center; align-items: center;
    -webkit-box-pack: center; -ms-flex-pack: center; justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #e2ddd6;
    background: var(--border);
    font-size: .75rem;
    font-weight: 700;
    flex-shrink: 0;
    color: #1a1a2e;
    color: var(--ink);
}
.option-label.opted .opt-letter {
    background: #e8952e;
    background: var(--amber);
    color: white;
}

.btn-submit-quiz {
    padding: 14px 48px;
    font-size: 1.05rem;
    opacity: 1;
    -webkit-transition: opacity .2s;
    transition: opacity .2s;
}
.btn-submit-quiz:disabled {
    opacity: .45;
    cursor: not-allowed;
    transform: none !important;
}

/* ── ADMIN TAG CHECKBOXES ── */
.tag-checkbox-grid {
    display: -webkit-box; display: -ms-flexbox; display: flex;
    -webkit-flex-wrap: wrap; -ms-flex-wrap: wrap; flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}
.tag-checkbox-label {
    display: -webkit-box; display: -ms-flexbox; display: flex;
    -webkit-box-align: center; -ms-flex-align: center; align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1.5px solid #e2ddd6;
    border: 1.5px solid var(--border);
    border-radius: 20px;
    cursor: pointer;
    font-size: .85rem;
    font-weight: 500;
    -webkit-transition: border-color .15s, background .15s;
    transition: border-color .15s, background .15s;
    color: #1a1a2e;
    color: var(--ink);
}
.tag-checkbox-label:hover { border-color: #e8952e;
 border-color: var(--amber); background: #fff8ee; }
.tag-checkbox-label input[type="checkbox"] { accent-color: #e8952e;
 accent-color: var(--amber); width: 14px; height: 14px; }
.tag-checkbox-label.opted {
    border-color: #e8952e;
    border-color: var(--amber);
    background: #fff8ee;
    color: #e8952e;
    color: var(--amber);
    font-weight: 600;
}

@media (max-width: 600px) {
    .filter-section { -webkit-box-orient: vertical; -webkit-box-direction: normal; -ms-flex-direction: column; flex-direction: column; -webkit-box-align: start; -ms-flex-align: start; align-items: flex-start; }
    .intro-stats { -webkit-box-orient: vertical; -webkit-box-direction: normal; -ms-flex-direction: column; flex-direction: column; }
    .istat { border-right: none; border-bottom: 1px solid #e2ddd6;
 border-bottom: 1px solid var(--border); }
    .istat:last-child { border-bottom: none; }
    .admin-header nav a { font-size: .78rem; padding: 4px 6px; }
}

/* ── FLEXBOX GAP FALLBACK ──────────────────────────────────────
   gap in flexbox is unsupported on Safari < 14.1 and old Android.
   For key layouts, margin fallbacks are provided below.
   Browsers that support gap will use it via @supports.
   ─────────────────────────────────────────────────────────────*/

/* Site nav spacing — margin fallback */
.site-nav a + a          { margin-left: 4px; }
.admin-header nav a + a  { margin-left: 4px; }
.filter-pills > * + *    { margin-left: 6px; margin-top: 6px; }
.intro-badges > * + *    { margin-left: 8px; }
.result-actions > * + *  { margin-left: 12px; }
.admin-actions > * + *   { margin-left: 8px; }
.options > * + *          { margin-top: 10px; }
.qcard-top > * + *        { margin-left: 6px; }
.tag-checkbox-grid > * + * { margin-left: 8px; margin-top: 8px; }
.intro-stats .istat + .istat { border-left: 1px solid #e2ddd6;
 border-left: 1px solid var(--border); }

/* Override margins for browsers that DO support gap */
@supports (gap: 1px) {
    .site-nav { gap: 4px; }
    .site-nav a + a { margin-left: 0; }
    .admin-header nav { gap: 4px; }
    .admin-header nav a + a { margin-left: 0; }
    .filter-pills { gap: 6px; }
    .filter-pills > * + * { margin-left: 0; margin-top: 0; }
    .intro-badges { gap: 8px; }
    .intro-badges > * + * { margin-left: 0; }
    .result-actions { gap: 12px; }
    .result-actions > * + * { margin-left: 0; }
    .admin-actions { gap: 8px; }
    .admin-actions > * + * { margin-left: 0; }
    .options { gap: 10px; }
    .options > * + * { margin-top: 0; }
    .qcard-top { gap: 6px; }
    .qcard-top > * + * { margin-left: 0; }
    .tag-checkbox-grid { gap: 8px; }
    .tag-checkbox-grid > * + * { margin-left: 0; margin-top: 0; }
    .logo { gap: 13px; }
    .logo-text-wrap { gap: 2px; }
    .logo-img-wrap { margin-right: 0 !important; }
}

/* ── iOS SAFARI INPUT FIXES ────────────────────────────────────
   Prevents iOS from applying native rounded styling to inputs   */
input[type="text"],
input[type="number"],
input[type="password"],
input[type="search"],
textarea,
select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}
/* Restore select arrow on Firefox — excluded for .tag-filter-select which has its own arrow */
select:not(.tag-filter-select) {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%236b6b7b' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

/* ── OBJECT-FIT FALLBACK (IE11) ─────────────────────────────── */
/* IE11 doesn't support object-fit. The logo img will just stretch slightly — acceptable. */

/* ── ANIMATION VENDOR PREFIXES ──────────────────────────────── */
@-webkit-keyframes slideInRight {
    from { opacity: 0; -webkit-transform: translateX(40px); transform: translateX(40px); }
    to   { opacity: 1; -webkit-transform: translateX(0);    transform: translateX(0); }
}
@-webkit-keyframes slideOutLeft {
    from { opacity: 1; -webkit-transform: translateX(0);     transform: translateX(0); }
    to   { opacity: 0; -webkit-transform: translateX(-40px); transform: translateX(-40px); }
}
.qz-card.animate-in  { -webkit-animation: slideInRight .25s ease forwards; animation: slideInRight .25s ease forwards; }
.qz-card.animate-out { -webkit-animation: slideOutLeft  .2s ease forwards; animation: slideOutLeft  .2s ease forwards; }

/* ── TAG FILTER DROPDOWN ── */

