/* ============================================================
   MARKETTISTI ANONIMI — style.css
   ============================================================ */

/* ── TOKENS ── */
:root {
  --bg:        #0a0a0f;
  --surface:   #12121a;
  --surface2:  #1a1a28;
  --border:    rgba(255,255,255,0.08);
  --accent:    #ff4d6d;
  --accent2:   #ff9a3c;
  --accent3:   #4ade80;
  --gold:      #fbbf24;
  --text:      #f0f0f8;
  --muted:     #888899;
  --radius:    16px;
  --radius-sm: 10px;
  --shadow:    0 8px 40px rgba(0,0,0,.5);
  --glow:      0 0 28px rgba(255,77,109,.22);
  --circ:      169.65; /* 2π×27 */
}

/* ── RESET ── */
*,*::before,*::after { box-sizing:border-box; margin:0; padding:0; }
html { scroll-behavior:smooth; -webkit-text-size-adjust:100%; }
body { font-family:'DM Sans',sans-serif; background:var(--bg); color:var(--text); min-height:100vh; overflow-x:hidden; line-height:1.5; }
h1,h2,h3,h4 { font-family:'Syne',sans-serif; line-height:1.2; }
button { cursor:pointer; font-family:inherit; }
a { color:var(--accent); text-decoration:none; }
a:hover { text-decoration:underline; }
img { max-width:100%; display:block; }

/* ── HIDDEN ── */
.hidden { display:none !important; }

/* ── LAYOUT ── */
#app { min-height:100vh; display:flex; flex-direction:column; }
.screen { display:none; flex:1; flex-direction:column; animation:fadeUp .32s ease both; }
.screen.active { display:flex; }
@keyframes fadeUp { from{opacity:0;transform:translateY(16px)} to{opacity:1;transform:translateY(0)} }

.page-wrap { max-width:860px; width:100%; margin:0 auto; padding:22px 16px 72px; }

/* ── LOADER ── */
#global-loader { position:fixed; inset:0; z-index:9999; background:var(--bg); display:flex; align-items:center; justify-content:center; flex-direction:column; gap:18px; transition:opacity .4s; }
.loader-logo { width:84px; height:84px; border-radius:50%; border:3px solid var(--accent); object-fit:cover; box-shadow:var(--glow); }
.loader-text { font-size:14px; color:var(--muted); }
.spinner { width:36px; height:36px; border:3px solid var(--border); border-top-color:var(--accent); border-radius:50%; animation:spin .7s linear infinite; }
@keyframes spin { to { transform:rotate(360deg); } }

/* ── NAVBAR ── */
#navbar { position:sticky; top:0; z-index:100; background:rgba(10,10,15,.9); backdrop-filter:blur(18px); -webkit-backdrop-filter:blur(18px); border-bottom:1px solid var(--border); padding:11px 20px; display:flex; align-items:center; justify-content:space-between; gap:12px; }
.nav-logo { display:flex; align-items:center; gap:10px; cursor:pointer; user-select:none; }
.nav-logo-img { width:40px; height:40px; border-radius:50%; border:2px solid var(--accent); object-fit:cover; box-shadow:var(--glow); }
.nav-brand { font-family:'Syne',sans-serif; font-weight:800; font-size:14px; line-height:1.25; }
.nav-brand span { color:var(--accent); }
.nav-links { display:flex; gap:5px; align-items:center; flex-wrap:wrap; }
.nav-btn { background:transparent; border:1px solid var(--border); color:var(--muted); font-size:12px; padding:5px 12px; border-radius:20px; transition:all .2s; white-space:nowrap; }
.nav-btn:hover { border-color:var(--accent); color:var(--accent); }
.nav-btn.primary { background:var(--accent); border-color:var(--accent); color:#fff; font-weight:600; }
.nav-btn.primary:hover { background:#e0324f; }
.nav-btn.danger { border-color:transparent; color:var(--muted); }
.nav-btn.danger:hover { border-color:var(--accent); color:var(--accent); }

/* ── BUTTONS ── */
.btn { display:inline-flex; align-items:center; justify-content:center; gap:8px; padding:12px 26px; border-radius:var(--radius-sm); font-family:'Syne',sans-serif; font-weight:600; font-size:15px; cursor:pointer; border:none; transition:all .2s; text-decoration:none; white-space:nowrap; user-select:none; }
.btn-primary { background:var(--accent); color:#fff; }
.btn-primary:hover { background:#e0324f; transform:translateY(-1px); box-shadow:var(--glow); }
.btn-outline { background:transparent; color:var(--text); border:1px solid var(--border); }
.btn-outline:hover { border-color:var(--accent); color:var(--accent); }
.btn-ghost { background:transparent; color:var(--muted); border:none; }
.btn-ghost:hover { color:var(--text); }
.btn-danger { background:rgba(255,77,109,.12); color:var(--accent); border:1px solid rgba(255,77,109,.28); }
.btn-danger:hover { background:var(--accent); color:#fff; }
.btn-lg { padding:15px 34px; font-size:17px; border-radius:var(--radius); }
.btn-sm { padding:7px 14px; font-size:13px; }
.btn-full { width:100%; }
.btn:disabled { opacity:.45; cursor:not-allowed; transform:none !important; box-shadow:none !important; }

/* ── CARDS ── */
.card { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:24px; }

/* ── FORMS ── */
.form-group { display:flex; flex-direction:column; gap:6px; }
label { font-size:12px; font-weight:600; color:var(--muted); text-transform:uppercase; letter-spacing:.06em; }
input,select,textarea { background:var(--surface2); border:1px solid var(--border); border-radius:var(--radius-sm); color:var(--text); font-family:'DM Sans',sans-serif; font-size:15px; padding:11px 14px; outline:none; transition:border-color .2s,box-shadow .2s; width:100%; appearance:none; -webkit-appearance:none; }
input:focus,select:focus,textarea:focus { border-color:var(--accent); box-shadow:0 0 0 3px rgba(255,77,109,.1); }
input::placeholder,textarea::placeholder { color:var(--muted); }
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 fill='%23888899' d='M1 1l5 5 5-5'/%3E%3C/svg%3E"); background-repeat:no-repeat; background-position:right 13px center; padding-right:34px; }
select option { background:var(--surface2); color:var(--text); }
textarea { resize:vertical; min-height:80px; }

.form-grid-2 { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
@media(max-width:560px){ .form-grid-2 { grid-template-columns:1fr; } }
.form-note { font-size:12px; color:var(--muted); margin-top:4px; }

/* Checkbox pills */
.checkbox-group { display:flex; flex-wrap:wrap; gap:7px; margin-top:4px; }
.checkbox-pill { padding:6px 13px; border-radius:20px; border:1px solid var(--border); font-size:13px; color:var(--muted); cursor:pointer; transition:all .2s; user-select:none; }
.checkbox-pill:hover { border-color:rgba(255,77,109,.4); color:var(--text); }
.checkbox-pill.selected { border-color:var(--accent); color:var(--accent); background:rgba(255,77,109,.1); }

/* Consent */
.consent-group { display:flex; flex-direction:column; gap:13px; }
.consent-label { display:flex; gap:12px; align-items:flex-start; cursor:pointer; font-size:14px; color:var(--text); text-transform:none; letter-spacing:0; font-weight:400; }
.consent-label input[type="checkbox"] { width:18px; height:18px; min-width:18px; accent-color:var(--accent); margin-top:2px; cursor:pointer; opacity:1 !important; visibility:visible !important; position:relative !important; -webkit-appearance:checkbox !important; appearance:checkbox !important; }

/* Messages */
.error-msg { color:#ff6b85; font-size:13px; padding:10px 14px; background:rgba(255,77,109,.08); border-radius:var(--radius-sm); border:1px solid rgba(255,77,109,.22); }
.success-msg { color:var(--accent3); font-size:13px; padding:10px 14px; background:rgba(74,222,128,.08); border-radius:var(--radius-sm); border:1px solid rgba(74,222,128,.22); }

/* ── STEPS BAR ── */
.steps-bar { display:flex; align-items:center; gap:7px; margin-bottom:22px; }
.step-dot { width:8px; height:8px; border-radius:50%; background:var(--border); transition:all .3s; }
.step-dot.active { background:var(--accent); width:22px; border-radius:4px; }
.step-dot.done { background:var(--accent3); }
.steps-label { margin-left:auto; font-size:12px; color:var(--muted); }
.step-title { font-size:16px; font-weight:700; margin-bottom:14px; }
.step-btn-row { display:flex; gap:10px; margin-top:4px; }
.step-btn-row .btn-outline { flex:1; }
.step-btn-row .btn-primary  { flex:2; }
.reg-step-panel { display:flex; flex-direction:column; gap:14px; }

/* ── AUTH ── */
.auth-wrap { max-width:480px; width:100%; margin:0 auto; padding:32px 16px 48px; }
.auth-logo { width:60px; height:60px; border-radius:50%; border:2px solid var(--accent); object-fit:cover; box-shadow:var(--glow); margin:0 auto 16px; }
.auth-title { font-size:26px; font-weight:800; text-align:center; margin-bottom:6px; }
.auth-sub { font-size:14px; color:var(--muted); text-align:center; margin-bottom:22px; }
.auth-switch { text-align:center; font-size:13px; color:var(--muted); margin-top:4px; }

/* ── LANDING ── */
#screen-landing { background:radial-gradient(ellipse at 15% 55%,rgba(255,77,109,.13) 0%,transparent 55%),radial-gradient(ellipse at 82% 18%,rgba(255,154,60,.09) 0%,transparent 50%),var(--bg); align-items:center; justify-content:center; min-height:100vh; padding:40px 20px; }
.landing-inner { max-width:700px; text-align:center; }
.landing-logo { width:100px; height:100px; border-radius:50%; border:3px solid var(--accent); object-fit:cover; box-shadow:var(--glow); margin:0 auto 20px; }
.landing-eyebrow { font-size:12px; letter-spacing:.15em; text-transform:uppercase; color:var(--accent); margin-bottom:12px; }
.landing-title { font-size:clamp(34px,6vw,62px); font-weight:800; line-height:1.06; margin-bottom:16px; }
.landing-title span { color:var(--accent); }
.landing-sub { font-size:17px; color:var(--muted); max-width:500px; margin:0 auto 32px; line-height:1.65; }
.landing-cta-row { display:flex; gap:12px; justify-content:center; flex-wrap:wrap; margin-bottom:52px; }
.landing-features { display:grid; grid-template-columns:repeat(auto-fit,minmax(148px,1fr)); gap:13px; text-align:left; }
.feature-card { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:17px; }
.feature-icon { font-size:24px; margin-bottom:9px; }
.feature-title { font-family:'Syne',sans-serif; font-weight:700; font-size:13px; margin-bottom:4px; }
.feature-desc { font-size:12px; color:var(--muted); line-height:1.5; }

/* ── PROGRESS BAR ── */
.progress-bar-wrap { background:var(--surface2); border-radius:8px; height:6px; overflow:hidden; width:100%; margin-bottom:6px; }
.progress-bar-fill { height:100%; background:linear-gradient(90deg,var(--accent),var(--accent2)); border-radius:8px; transition:width .4s ease; }

/* ── DASHBOARD ── */
.dash-hero { background:linear-gradient(135deg,var(--surface) 0%,var(--surface2) 100%); border:1px solid var(--border); border-radius:var(--radius); padding:24px; margin-bottom:20px; display:flex; align-items:center; gap:16px; }
.dash-avatar { width:56px; height:56px; border-radius:50%; flex-shrink:0; background:linear-gradient(135deg,var(--accent),var(--accent2)); display:flex; align-items:center; justify-content:center; font-family:'Syne',sans-serif; font-size:20px; font-weight:800; color:#fff; }
.dash-greeting { font-size:20px; font-weight:800; }
.dash-sub { font-size:13px; color:var(--muted); margin-top:3px; }
.stats-row { display:grid; grid-template-columns:repeat(3,1fr); gap:11px; margin-bottom:20px; }
@media(max-width:480px){ .stats-row { grid-template-columns:1fr; } }
.stat-card { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:16px 18px; }
.stat-num { font-family:'Syne',sans-serif; font-size:26px; font-weight:800; }
.stat-lbl { font-size:12px; color:var(--muted); margin-top:2px; }
.section-title { font-size:17px; font-weight:700; margin-bottom:14px; }

/* Quick links row */
.quick-links { display:flex; gap:10px; margin-bottom:22px; flex-wrap:wrap; }
.quick-link-btn { flex:1; min-width:120px; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-sm); padding:10px 14px; font-family:'DM Sans',sans-serif; font-size:13px; color:var(--muted); cursor:pointer; transition:all .2s; display:flex; align-items:center; gap:6px; justify-content:center; }
.quick-link-btn:hover { border-color:var(--accent); color:var(--accent); }

.cat-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(188px,1fr)); gap:12px; }
.cat-card { background:var(--surface); border:1px solid var(--border); border-left-width:4px; border-radius:var(--radius); padding:20px; cursor:pointer; transition:all .22s; }
.cat-card:hover { transform:translateY(-3px); box-shadow:var(--glow); }
.cat-icon { font-size:32px; margin-bottom:10px; }
.cat-name { font-family:'Syne',sans-serif; font-weight:700; font-size:15px; }
.cat-topics { font-size:12px; color:var(--muted); margin-top:4px; line-height:1.4; }

/* ── LEVEL ── */
.screen-title { font-size:24px; font-weight:800; margin-bottom:6px; margin-top:4px; }
.screen-sub { font-size:14px; color:var(--muted); margin-bottom:24px; }
.back-btn { margin-bottom:12px; padding-left:0; }
.level-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(178px,1fr)); gap:13px; }
.level-card { background:var(--surface); border:2px solid var(--border); border-radius:var(--radius); padding:22px; cursor:pointer; text-align:center; transition:all .22s; }
.level-card.beginner:hover    { border-color:var(--accent3); box-shadow:0 0 22px rgba(74,222,128,.18); transform:translateY(-3px); }
.level-card.intermediate:hover{ border-color:var(--accent2); box-shadow:0 0 22px rgba(255,154,60,.18); transform:translateY(-3px); }
.level-card.advanced:hover    { border-color:var(--accent);  box-shadow:var(--glow); transform:translateY(-3px); }
.level-icon { font-size:36px; margin-bottom:11px; }
.level-name { font-family:'Syne',sans-serif; font-weight:700; font-size:17px; }
.level-desc { font-size:13px; color:var(--muted); margin-top:5px; line-height:1.45; }
.level-pass-note { font-size:11px; color:var(--muted); margin-top:9px; border-top:1px solid var(--border); padding-top:9px; }

/* ── QUIZ ── */
.quiz-wrap { max-width:680px; }
.quiz-header { display:flex; align-items:center; gap:14px; margin-bottom:12px; }
.quiz-meta { flex:1; min-width:0; }
.quiz-cat-badge { font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.08em; color:var(--accent); margin-bottom:3px; }
.quiz-question-counter { font-size:12px; color:var(--muted); }

/* Timer */
.timer-ring-wrap { position:relative; width:64px; height:64px; flex-shrink:0; }
.timer-ring-wrap svg { transform:rotate(-90deg); display:block; }
.timer-ring-bg   { fill:none; stroke:var(--surface2); stroke-width:5; }
.timer-ring-fill { fill:none; stroke:var(--accent3); stroke-width:5; stroke-linecap:round; stroke-dasharray:169.65; stroke-dashoffset:0; transition:stroke-dashoffset 1s linear,stroke .4s; }
.timer-number { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; font-family:'Syne',sans-serif; font-size:17px; font-weight:800; pointer-events:none; }

/* Questions */
.question-text { font-family:'Syne',sans-serif; font-size:clamp(17px,3vw,21px); font-weight:700; line-height:1.45; margin:18px 0 16px; }
.answers-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-bottom:16px; }
@media(max-width:520px){ .answers-grid { grid-template-columns:1fr; } }
.answer-btn { background:var(--surface); border:2px solid var(--border); border-radius:var(--radius); padding:14px 16px; color:var(--text); font-family:'DM Sans',sans-serif; font-size:14px; text-align:left; cursor:pointer; transition:all .18s; line-height:1.4; width:100%; }
.answer-btn:hover:not(:disabled) { border-color:var(--accent); background:rgba(255,77,109,.05); }
.answer-btn.correct { border-color:var(--accent3)!important; background:rgba(74,222,128,.1)!important; color:var(--accent3)!important; }
.answer-btn.wrong   { border-color:var(--accent)!important;  background:rgba(255,77,109,.1)!important; color:var(--accent)!important; }
.answer-btn:disabled { cursor:default; }
.q-feedback { padding:11px 15px; border-radius:var(--radius-sm); font-size:13px; font-weight:500; margin-bottom:13px; line-height:1.5; }

/* ── RESULT ── */
.result-wrap { max-width:540px; }
.result-hero { text-align:center; padding:28px 20px 20px; }
.result-icon  { font-size:68px; margin-bottom:12px; line-height:1; }
.score-big    { font-family:'Syne',sans-serif; font-size:72px; font-weight:800; line-height:1; margin-bottom:8px; }
.score-big span { font-size:28px; color:var(--muted); }
.result-title { font-size:34px; font-weight:800; margin-bottom:7px; }
.result-sub   { font-size:15px; color:var(--muted); line-height:1.55; }
.result-actions { display:flex; flex-direction:column; gap:9px; margin-top:18px; }

.result-badge-wrap { background:linear-gradient(135deg,rgba(251,191,36,.08),rgba(255,77,109,.08)); border:1px solid rgba(251,191,36,.22); border-radius:var(--radius); padding:24px; display:flex; flex-direction:column; align-items:center; gap:10px; text-align:center; margin:6px 0; }
.badge-unlocked-label { font-size:11px; text-transform:uppercase; letter-spacing:.12em; color:var(--gold); }
.badge-unlocked-name  { font-family:'Syne',sans-serif; font-weight:700; font-size:17px; }
.badge-unlocked-level { font-size:12px; color:var(--muted); }
.result-badge-icon-el { width:80px; height:80px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:36px; border:2px solid var(--gold); }

/* Share row */
.share-row { display:flex; align-items:center; gap:8px; flex-wrap:wrap; justify-content:center; }
.share-label { font-size:12px; color:var(--muted); }
.share-btn { width:36px; height:36px; border-radius:50%; border:1px solid var(--border); background:var(--surface2); font-size:13px; font-weight:700; cursor:pointer; transition:all .2s; display:flex; align-items:center; justify-content:center; color:var(--text); }
.share-btn:hover { transform:scale(1.1); }
.share-tw:hover { border-color:#1da1f2; color:#1da1f2; }
.share-li:hover { border-color:#0077b5; color:#0077b5; }
.share-wa:hover { border-color:#25d366; color:#25d366; }
.share-cp:hover { border-color:var(--accent3); color:var(--accent3); }

/* ── BADGES ── */
.filter-row { display:flex; gap:7px; flex-wrap:wrap; margin-bottom:18px; }
.filter-btn { padding:6px 14px; border-radius:20px; border:1px solid var(--border); background:transparent; color:var(--muted); font-size:12px; cursor:pointer; transition:all .2s; }
.filter-btn:hover { border-color:var(--accent); color:var(--accent); }
.filter-btn.active { background:var(--accent); border-color:var(--accent); color:#fff; }

.badges-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(142px,1fr)); gap:12px; }
.badge-card { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:18px; display:flex; flex-direction:column; align-items:center; gap:8px; text-align:center; transition:all .22s; }
.badge-card.earned:hover { border-color:var(--gold); box-shadow:0 0 18px rgba(251,191,36,.16); }
.badge-icon { width:64px; height:64px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:28px; border:2px solid; }
.badge-name  { font-family:'Syne',sans-serif; font-weight:700; font-size:12px; line-height:1.3; }
.badge-level { font-size:11px; color:var(--muted); }
.badge-earned-tag { font-size:10px; color:var(--accent3); }

/* ── PROFILE ── */
.profile-wrap { max-width:640px; }
.profile-header { display:flex; align-items:center; gap:16px; background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:24px; margin-bottom:20px; }
.profile-avatar-big { width:72px; height:72px; border-radius:50%; flex-shrink:0; background:linear-gradient(135deg,var(--accent),var(--accent2)); display:flex; align-items:center; justify-content:center; font-family:'Syne',sans-serif; font-size:24px; font-weight:800; color:#fff; }
.profile-name { font-size:20px; font-weight:800; }
.profile-role { font-size:13px; color:var(--muted); margin-top:3px; }
.profile-grid { display:grid; grid-template-columns:1fr 1fr; gap:9px; margin-bottom:20px; }
@media(max-width:520px){ .profile-grid { grid-template-columns:1fr; } }
.profile-item { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-sm); padding:12px 14px; }
.profile-item-label { font-size:10px; color:var(--muted); text-transform:uppercase; letter-spacing:.07em; margin-bottom:2px; }
.profile-item-val   { font-size:14px; font-weight:500; }
.profile-actions { display:flex; gap:10px; flex-wrap:wrap; }

/* ── LEADERBOARD ── */
.tab-row { display:flex; gap:7px; margin-bottom:18px; background:var(--surface); border-radius:var(--radius-sm); padding:4px; }
.tab-btn { flex:1; padding:8px; border-radius:8px; font-family:'DM Sans',sans-serif; font-size:13px; font-weight:500; border:none; background:transparent; color:var(--muted); cursor:pointer; transition:all .2s; }
.tab-btn.active { background:var(--surface2); color:var(--text); }
.tab-btn:hover:not(.active) { color:var(--text); }

.my-rank-card { background:linear-gradient(135deg,rgba(255,77,109,.1),rgba(255,154,60,.1)); border:1px solid rgba(255,77,109,.25); border-radius:var(--radius); padding:14px 20px; display:flex; align-items:center; gap:12px; margin-bottom:18px; }
.my-rank-label { font-size:12px; color:var(--muted); }
.my-rank-num { font-family:'Syne',sans-serif; font-size:22px; font-weight:800; color:var(--accent); margin-left:auto; }
.my-rank-pts { font-size:13px; color:var(--muted); }

.lb-list { display:flex; flex-direction:column; gap:9px; }
.lb-row { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:14px 16px; display:flex; align-items:center; gap:13px; transition:all .2s; }
.lb-row.me { border-color:rgba(255,77,109,.35); background:rgba(255,77,109,.04); }
.lb-rank { font-family:'Syne',sans-serif; font-size:18px; font-weight:800; width:28px; text-align:center; flex-shrink:0; }
.lb-rank.gold   { color:var(--gold); }
.lb-rank.silver { color:#aab4be; }
.lb-rank.bronze { color:#cd7f32; }
.lb-avatar { width:38px; height:38px; border-radius:50%; background:linear-gradient(135deg,var(--accent),var(--accent2)); display:flex; align-items:center; justify-content:center; font-family:'Syne',sans-serif; font-size:13px; font-weight:800; color:#fff; flex-shrink:0; }
.lb-info { flex:1; min-width:0; }
.lb-name { font-family:'Syne',sans-serif; font-weight:700; font-size:14px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.lb-sub  { font-size:11px; color:var(--muted); margin-top:2px; }
.lb-score { text-align:right; flex-shrink:0; }
.lb-pts  { font-family:'Syne',sans-serif; font-size:16px; font-weight:800; color:var(--gold); }
.lb-bdg  { font-size:11px; color:var(--muted); }
.lb-you-tag { font-size:10px; color:var(--accent); margin-left:4px; }

/* ── HISTORY ── */
.history-stats { display:grid; grid-template-columns:repeat(4,1fr); gap:10px; margin-bottom:18px; }
@media(max-width:560px){ .history-stats { grid-template-columns:repeat(2,1fr); } }

.history-list { display:flex; flex-direction:column; gap:9px; }
.history-item { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:14px 16px; display:flex; align-items:center; gap:13px; transition:all .2s; }
.history-item:hover { border-color:rgba(255,255,255,.12); }
.history-cat-icon { font-size:28px; flex-shrink:0; }
.history-info { flex:1; min-width:0; }
.history-title { font-family:'Syne',sans-serif; font-weight:700; font-size:14px; }
.history-meta  { font-size:11px; color:var(--muted); margin-top:2px; }
.history-score { text-align:right; flex-shrink:0; }
.history-pts { font-family:'Syne',sans-serif; font-size:17px; font-weight:800; }
.history-pts.pass { color:var(--accent3); }
.history-pts.fail { color:var(--accent); }
.history-badge-tag { font-size:10px; color:var(--gold); margin-top:2px; }
.history-retry { font-size:11px; color:var(--muted); margin-top:2px; cursor:pointer; }
.history-retry:hover { color:var(--accent); }

/* ── ADMIN ── */
.admin-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:4px; }
.admin-search-row { display:flex; gap:9px; flex-wrap:wrap; margin-bottom:14px; }
.admin-search-input { flex:1; min-width:180px; }
.admin-select { width:auto; flex-shrink:0; }
.admin-questions-list { display:flex; flex-direction:column; gap:9px; }
.admin-q-item { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-sm); padding:13px 15px; display:flex; align-items:flex-start; gap:12px; }
.admin-q-text { flex:1; font-size:13px; line-height:1.45; }
.admin-q-meta { font-size:11px; color:var(--muted); margin-top:4px; }
.admin-q-tag { display:inline-block; padding:2px 8px; border-radius:10px; font-size:10px; font-weight:600; margin-right:4px; border:1px solid; }
.admin-q-actions { display:flex; gap:6px; flex-shrink:0; }
.admin-q-btn { padding:5px 10px; border-radius:6px; font-size:11px; font-weight:600; cursor:pointer; border:1px solid var(--border); background:transparent; color:var(--muted); transition:all .2s; }
.admin-q-btn:hover { border-color:var(--accent); color:var(--accent); }
.admin-q-btn.del:hover { border-color:var(--accent); background:rgba(255,77,109,.1); }
.admin-stats-card { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:18px; }

/* ── TOAST ── */
#toast-wrap { position:fixed; bottom:22px; right:18px; display:flex; flex-direction:column; gap:8px; z-index:9998; pointer-events:none; }
.toast { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-sm); padding:12px 17px; font-size:13px; max-width:300px; animation:fadeUp .3s ease; box-shadow:var(--shadow); pointer-events:auto; }
.toast.success { border-color:rgba(74,222,128,.35); }
.toast.error   { border-color:rgba(255,77,109,.35); }

/* ── BOTTOM NAV ── */
#bottom-nav { display:none; position:fixed; bottom:0; left:0; right:0; background:rgba(10,10,15,.96); backdrop-filter:blur(18px); -webkit-backdrop-filter:blur(18px); border-top:1px solid var(--border); align-items:center; justify-content:space-around; padding:8px 0 max(env(safe-area-inset-bottom),8px); z-index:100; }
#bottom-nav.visible { display:flex; }
body.has-nav { padding-bottom:68px; }
.bnav-btn { display:flex; flex-direction:column; align-items:center; gap:2px; background:none; border:none; color:var(--muted); padding:3px 10px; border-radius:8px; transition:all .2s; min-width:52px; }
.bnav-icon  { font-size:19px; }
.bnav-label { font-size:9px; font-family:'DM Sans',sans-serif; }
.bnav-btn.active { color:var(--accent); }
.bnav-btn:hover  { color:var(--text); }

/* ── MISC ── */
.loading-placeholder { color:var(--muted); font-size:14px; padding:20px 0; }
.empty-state { text-align:center; padding:40px 20px; color:var(--muted); font-size:14px; }
.empty-state-icon { font-size:48px; margin-bottom:12px; }

/* ── CUSTOM TOGGLE (sostituisce checkbox native per compatibilità Safari) ── */
.toggle-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  cursor: pointer;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface2);
  transition: all .2s;
  user-select: none;
  -webkit-user-select: none;
}
.toggle-row:hover { border-color: rgba(255,77,109,.4); }
.toggle-row.active { border-color: var(--accent); background: rgba(255,77,109,.08); }
.toggle-row span { font-size: 14px; color: var(--text); line-height: 1.5; padding-top: 1px; }
.toggle-box {
  width: 22px;
  height: 22px;
  min-width: 22px;
  border-radius: 6px;
  border: 2px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: transparent;
  transition: all .2s;
  margin-top: 1px;
}
.toggle-row.active .toggle-box {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
