/* Egzamen Fos Akademi — tèm fonse, aksan ble + jòn, lò pou pri yo */
:root {
  --bg: #070b16; --panel: #0e1526; --panel2: #121c33; --line: #22304f;
  --blue: #2f7bff; --blue-glow: rgba(47,123,255,.45);
  --gold: #ffc400; --gold-deep: #c9a227; --text: #eef2fb; --muted: #9fb0cf;
  --bad: #ff6b6b; --good: #51e39a;
}
* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(1200px 600px at 50% -10%, #12234d 0%, var(--bg) 55%); color: var(--text); font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; min-height: 100vh; }
a { color: var(--gold); }
.wrap { max-width: 980px; margin: 0 auto; padding: 18px 14px 60px; }

.app-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: rgba(7,11,22,.85); position: sticky; top: 0; z-index: 5; backdrop-filter: blur(6px); }
.brand { display: flex; align-items: center; gap: 10px; }
.logo-chip { background: #fff; border-radius: 10px; padding: 3px 6px; display: inline-flex; }
.logo-chip img { height: 34px; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { letter-spacing: .06em; font-size: 15px; }
.brand-text small { color: var(--muted); font-size: 12px; }
.topnav { display: flex; gap: 14px; align-items: center; }
.topnav a { color: var(--text); text-decoration: none; font-weight: 600; }
.topnav a.on { color: var(--gold); }
.linkbtn { background: none; border: 0; color: var(--muted); font: inherit; cursor: pointer; }
.inline { display: inline; }
.app-footer { text-align: center; color: var(--muted); padding: 22px; font-size: 13px; }

.tagline { color: var(--gold); font-weight: 700; letter-spacing: .02em; }
.center { text-align: center; }
.muted { color: var(--muted); }
.ok-line { color: var(--good); } .err-line { color: var(--bad); }

.btn { display: inline-block; border: 0; border-radius: 10px; padding: 10px 18px; font-weight: 700; font-size: 15px; cursor: pointer; text-decoration: none; }
.btn-gold { background: linear-gradient(180deg, #ffd94d, var(--gold)); color: #241a02; box-shadow: 0 4px 18px rgba(255,196,0,.25); }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn-danger { background: #3a1620; color: #ff9a9a; border: 1px solid #6e2436; }
.btn-disabled { background: #1a2338; color: var(--muted); cursor: not-allowed; }
.btn-big { width: 100%; padding: 14px; font-size: 17px; margin-top: 14px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 10px 0; }

.panel { background: linear-gradient(180deg, var(--panel2), var(--panel)); border: 1px solid var(--line); border-radius: 16px; padding: 18px; margin: 16px 0; }
.panel h2 { margin-top: 0; }

.flash { border-radius: 10px; padding: 12px 14px; margin: 14px 0; font-weight: 600; }
.flash-ok { background: rgba(81,227,154,.12); border: 1px solid rgba(81,227,154,.5); }
.flash-err { background: rgba(255,107,107,.12); border: 1px solid rgba(255,107,107,.5); }

/* Otantifikasyon */
.auth-card { max-width: 430px; margin: 40px auto; background: linear-gradient(180deg, var(--panel2), var(--panel)); border: 1px solid var(--line); border-radius: 20px; padding: 26px; text-align: center; }
.auth-logo { width: 84px; height: 84px; object-fit: cover; border-radius: 16px; }
.auth-form { display: flex; flex-direction: column; gap: 8px; text-align: left; margin-top: 14px; }
.auth-form label { font-weight: 600; font-size: 14px; }
.auth-form input, .q-form input, .q-form textarea, .q-form select, .prop-form input, .prop-form select, .inline-form input {
  background: #0a1122; border: 1px solid var(--line); color: var(--text); border-radius: 10px; padding: 11px 12px; font: inherit; width: 100%;
}
.auth-form .btn { margin-top: 10px; }
.auth-note { color: var(--muted); font-size: 14px; }

/* Chèn pri */
.chain-wrap { margin: 10px 0 4px; }
.chain-title { text-align: center; color: var(--gold); font-size: 18px; margin: 6px 0 12px; }
.chain { position: relative; display: flex; align-items: flex-start; justify-content: space-between; gap: 4px; padding: 14px 4px 4px; }
.chain-track { position: absolute; left: 4%; right: 4%; top: 62px; height: 6px; border-radius: 3px; background: linear-gradient(90deg, #6d5510, var(--gold-deep), #6d5510); overflow: hidden; }
.chain-light { position: absolute; top: 0; height: 100%; width: 18%; border-radius: 3px; background: linear-gradient(90deg, transparent, #fff3b0, transparent); animation: travel 3.2s linear infinite; }
@keyframes travel { from { left: -20%; } to { left: 105%; } }
.chain-link { align-self: center; font-size: 15px; opacity: .75; z-index: 1; }
.prize { width: 22%; text-align: center; z-index: 1; }
.prize-media { position: relative; aspect-ratio: 1/1; border-radius: 14px; overflow: hidden; border: 2px solid var(--gold-deep); background: #000; box-shadow: 0 0 18px rgba(201,162,39,.35); }
.prize-media video { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.prize-locked .prize-media { filter: saturate(.4); }
.prize-frost { position: absolute; inset: 0; background: rgba(5,8,16,.55); display: flex; align-items: center; justify-content: center; backdrop-filter: blur(1.5px); }
.prize-label { margin-top: 8px; font-weight: 700; font-size: 13.5px; }
.mini-cert { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; background: radial-gradient(ellipse at 50% 30%, #201b10, #000); padding: 7%; }
.mini-cert-frame { border: 2px solid var(--gold-deep); outline: 1px solid #8a6d14; outline-offset: 3px; width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 4px; }
.mini-cert-title { color: var(--gold); font-weight: 800; font-size: clamp(10px, 2.6vw, 16px); text-align: center; }
.mini-cert-frame img { width: 34%; border-radius: 4px; }
.mini-cert-sub { color: #d8c78a; font-size: clamp(7px, 1.8vw, 10px); text-align: center; }
.mini-cert-seal { color: var(--gold); font-size: clamp(12px, 3vw, 20px); }

/* Pwogrè + etap */
.progress-meta { font-weight: 700; margin-bottom: 8px; }
.progress-bar { height: 12px; background: #0a1122; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--blue), #6db3ff); box-shadow: 0 0 12px var(--blue-glow); transition: width .5s; }
.stages { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; margin: 16px 0; }
.stage-card { position: relative; background: linear-gradient(180deg, var(--panel2), var(--panel)); border: 1px solid var(--line); border-radius: 16px; padding: 18px; padding-right: 74px; }
.stage-card h3 { margin: 0 0 6px; }
.stage-card p { color: var(--muted); margin: 0 0 14px; font-size: 14.5px; }
.stage-card.state-passed { border-color: rgba(81,227,154,.55); }
.stage-foot { display: flex; align-items: center; gap: 10px; }
.lock-badge { position: absolute; top: 10px; right: 10px; width: 52px; height: 52px; border-radius: 50%; background: rgba(255,196,0,.14); box-shadow: 0 0 0 3px rgba(255,196,0,.45), 0 0 18px rgba(255,196,0,.5); display: flex; align-items: center; justify-content: center; }
.pill { font-size: 12px; font-weight: 800; letter-spacing: .04em; padding: 4px 9px; border-radius: 999px; }
.pill-pass { background: rgba(81,227,154,.15); color: var(--good); }
.pill-lock { background: rgba(255,196,0,.15); color: var(--gold); }
.pill-open { background: rgba(47,123,255,.18); color: #8dbcff; }
.trophy-line, .title-line { text-align: center; font-size: 17px; margin: 10px 0; }
.code-box { font-size: 22px; font-weight: 800; letter-spacing: .08em; background: #0a1122; border: 1px dashed var(--gold-deep); border-radius: 10px; padding: 12px; text-align: center; color: var(--gold); }

/* Egzamen + rezilta */
.q-card { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin: 14px 0; background: rgba(255,255,255,.02); }
.q-card legend { font-weight: 700; padding: 0 6px; }
.q-num { color: var(--gold); }
.choice { display: flex; gap: 10px; align-items: flex-start; padding: 9px 10px; border-radius: 10px; cursor: pointer; }
.choice:hover { background: rgba(47,123,255,.08); }
.choice input { margin-top: 3px; width: auto; }
.result-panel { text-align: center; }
.result-panel .score { font-size: 52px; font-weight: 900; margin: 6px 0; }
.result-panel.is-pass { border-color: rgba(81,227,154,.6); }
.wrong-card { text-align: left; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 10px 0; }
.wrong-card .bad { color: var(--bad); } .wrong-card .good { color: var(--good); font-weight: 700; }

/* Sètifika v3 (lò & nwa) */
.cert-actions { display: flex; gap: 10px; margin: 14px 0; }
.certificate { background: radial-gradient(ellipse at 50% 26%, #201b10 0%, #0b0906 58%, #000 100%); border-radius: 18px; padding: 22px; }
.cert-frame { border: 3px solid var(--gold-deep); outline: 1px solid #8a6d14; outline-offset: 6px; padding: 26px 20px; }
.cert-inner { text-align: center; color: #f5eeda; }
.cert-logo { width: 110px; border-radius: 10px; }
.cert-eyebrow { letter-spacing: .35em; color: #d8c78a; font-size: 12px; margin-top: 10px; }
.cert-title { font-size: clamp(30px, 6vw, 52px); margin: 8px 0; background: linear-gradient(180deg, #fdf3c0, #f3d27a 30%, #c9a227 55%, #8a6d14 75%, #f9e08a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cert-name { font-size: clamp(24px, 5vw, 40px); font-weight: 800; color: #f9e08a; margin: 8px 0; }
.cert-sub { color: #e8dcbb; }
.cert-title-line { font-size: 19px; letter-spacing: .05em; }
.cert-title-line strong { color: var(--gold); }
.cert-panels { display: flex; gap: 14px; align-items: center; justify-content: center; margin: 20px 0; flex-wrap: wrap; }
.cert-panel-box { border: 1px solid var(--gold-deep); border-radius: 12px; padding: 12px 16px; background: rgba(0,0,0,.45); }
.cert-seal { width: 74px; height: 74px; border-radius: 50%; background: radial-gradient(circle at 38% 32%, #f9e08a, #a37f1c 75%); color: #241a02; font-size: 34px; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 22px rgba(201,162,39,.55); }
.cert-foot { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; border-top: 1px solid rgba(201,162,39,.4); padding-top: 14px; font-size: 14px; }
.cert-sign { font-family: cursive; font-size: 22px; color: #f9e08a; }
/* Blòk QR verifikasyon an: plak blan pou eskanè yo ka li l sou fon nwa a */
.cert-verify-row { display: flex; justify-content: flex-end; margin-top: 16px; }
.cert-qr { background: #fff; border-radius: 12px; padding: 10px 10px 7px; width: 132px; text-align: center; }
.cert-qr .qr-svg { display: block; width: 100%; height: auto; }
.cert-qr-caption { margin: 7px 0 0; color: #111; font-size: 9.5px; line-height: 1.35; }
.cert-qr-caption span { font-size: 8.5px; color: #444; word-break: break-all; }
@media print {
  .app-header, .app-footer, .cert-actions { display: none; }
  body { background: #000; }
  .cert-qr { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Paj verifikasyon piblik */
.verify-card { max-width: 460px; }
.verify-badge { width: 74px; height: 74px; border-radius: 50%; margin: 4px auto 12px; display: flex; align-items: center; justify-content: center; font-size: 38px; font-weight: 900; }
.verify-badge-ok { background: rgba(81,227,154,.16); color: var(--good); border: 2px solid rgba(81,227,154,.6); box-shadow: 0 0 20px rgba(81,227,154,.25); }
.verify-badge-bad { background: rgba(255,107,107,.12); color: var(--bad); border: 2px solid rgba(255,107,107,.5); }
.verify-valid { color: var(--good); letter-spacing: .02em; }
.verify-rows { text-align: left; margin: 16px 0; display: grid; gap: 8px; }
.verify-rows > div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.verify-rows dt { color: var(--muted); font-weight: 600; }
.verify-rows dd { margin: 0; font-weight: 800; color: var(--gold); text-align: right; }

/* Admin */
.admin-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 4px; }
.admin-tab { padding: 8px 13px; border: 1px solid var(--line); border-radius: 999px; color: var(--text); text-decoration: none; font-weight: 600; font-size: 14px; }
.admin-tab.on { background: var(--gold); color: #241a02; border-color: var(--gold); }
.tbl { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.tbl th, .tbl td { border-bottom: 1px solid var(--line); padding: 8px 6px; text-align: left; vertical-align: top; }
.stat-row { display: flex; gap: 14px; flex-wrap: wrap; }
.stat { background: #0a1122; border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; display: flex; flex-direction: column; }
.stat strong { font-size: 26px; color: var(--gold); }
.stat span { color: var(--muted); font-size: 13px; }
.bank-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.bank-chip { border: 1px solid var(--line); border-radius: 999px; padding: 7px 12px; color: var(--text); text-decoration: none; font-size: 13.5px; }
.bank-chip.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.q-admin { border-bottom: 1px solid var(--line); padding: 10px 0; }
.q-form { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.q-form .check, .prop-form .check { display: flex; gap: 8px; align-items: center; font-weight: 600; }
.q-form .check input, .prop-form .check input { width: auto; }
.prop-form { display: grid; gap: 8px; border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin: 12px 0; }
.prop-form label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: 14px; }
.inline-form { display: flex; gap: 8px; align-items: center; margin: 10px 0; flex-wrap: wrap; }
.inline-form input { flex: 1; min-width: 200px; }
.link-row { display: flex; gap: 8px; align-items: center; margin: 8px 0; }
.link-row span { min-width: 170px; font-weight: 700; }
.link-row input { flex: 1; background: #0a1122; border: 1px solid var(--line); color: var(--text); border-radius: 8px; padding: 9px; }
@media (max-width: 640px) {
  .stage-card { padding-right: 66px; }
  .prize-label { font-size: 11.5px; }
  .cert-foot { justify-content: center; text-align: center; }
}
