/**
 * Studio Block — TEST (quiz in pagina) — stiluri
 * Namespace: .stq-*
 * Functioneaza in editor (.se-block-wrap) si in viewer (.studio-view-block)
 */

/* Tokens locale */
.stq {
    --stq-primary: #2563eb;
    --stq-primary-light: rgba(37,99,235,0.08);
    --stq-ok: #10b981;
    --stq-danger: #ef4444;
    --stq-text: #0f172a;
    --stq-muted: rgba(15,23,42,0.55);
    --stq-faint: rgba(15,23,42,0.35);
    --stq-ease: cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
    background: #f8fafc;
    border: 1px solid rgba(15,23,42,0.08);
    border-radius: 14px;
    padding: 18px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    color: var(--stq-text);
}
.stq * { box-sizing: border-box; }

/* ───────── Comutare COPERTA ↔ CORP ───────── */
/* implicit: coperta vizibila, corpul ascuns */
.stq-body  { display: none; }
.stq-cover { display: flex; }
/* editor: blocul selectat (.active) -> arata corpul (editare) */
.se-block-wrap.active .stq-cover { display: none; }
.se-block-wrap.active .stq-body  { display: block; }
/* viewer: dupa "Incepe" (.is-started) -> arata corpul */
.stq.is-started .stq-cover { display: none; }
.stq.is-started .stq-body  { display: block; }

/* ───────── COPERTA INTRO (design nou) ───────── */
/* coperta umple tot blocul (anuleaza padding-ul .stq) */
.stq-cover {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin: -18px;
    border-radius: 13px;
    background: linear-gradient(180deg, #ffffff 0%, #f9fafb 100%);
}
.stq-cover-inner {
    width: 100%; max-width: 560px; margin: 0 auto;
    padding: 56px 28px;
    display: flex; flex-direction: column; align-items: center;
}
/* Badge pastila */
.stq-cover-badge {
    display: inline-flex; align-items: center; gap: 7px;
    background: linear-gradient(90deg, rgba(59,130,246,0.10), rgba(99,102,241,0.10));
    color: #2563eb;
    border: 1px solid rgba(59,130,246,0.22);
    padding: 6px 14px; border-radius: 999px;
    font: 700 11px/1 'Inter', sans-serif; letter-spacing: 0.06em; text-transform: uppercase;
    margin-bottom: 22px;
}
.stq-cover-badge svg { width: 14px; height: 14px; }
/* Titlu */
.stq-cover-title {
    font: 800 38px/1.08 'Fraunces', serif;
    letter-spacing: -0.02em; color: #0f172a; margin: 0 0 14px;
}
/* Subtitlu */
.stq-cover-sub {
    font: 400 15px/1.6 'Inter', sans-serif; color: #64748b;
    margin: 0 0 32px; max-width: 430px;
}
/* Grila statistici */
.stq-cover-stats {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
    width: 100%; max-width: 430px; margin-bottom: 34px;
}
.stq-cover-stat {
    background: rgba(255,255,255,0.7);
    border: 1px solid rgba(15,23,42,0.08);
    border-radius: 16px; padding: 16px 8px;
    transition: box-shadow .2s var(--stq-ease);
}
.stq-cover-stat:hover { box-shadow: 0 6px 18px -6px rgba(15,23,42,0.15); }
.stq-cover-stat-num { font: 800 26px/1 'Inter', sans-serif; color: #0f172a; margin-bottom: 5px; }
.stq-cover-stat-lbl { font: 600 10px/1.2 'Inter', sans-serif; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.04em; }
/* Buton CTA (inchis, rotund) */
.stq-start {
    display: inline-flex; align-items: center; justify-content: center; gap: 9px;
    padding: 15px 38px; border: 0; border-radius: 999px; cursor: pointer;
    background: #0f172a; color: #fff;
    font: 600 15px/1 'Inter', sans-serif; letter-spacing: -0.01em;
    box-shadow: 0 10px 24px -8px rgba(15,23,42,0.45);
    transition: transform .2s var(--stq-ease), background .2s var(--stq-ease), box-shadow .2s var(--stq-ease);
}
.stq-start:hover { background: #1e293b; transform: translateY(-1px) scale(1.02); box-shadow: 0 14px 30px -8px rgba(15,23,42,0.5); }
.stq-start svg { width: 16px; height: 16px; transition: transform .2s var(--stq-ease); }
.stq-start:hover svg { transform: translateX(3px); }
.stq-cover-hint { margin-top: 16px; font: 500 11px/1.3 'Inter', sans-serif; color: var(--stq-faint); }
@media (max-width: 520px) {
    .stq-cover-inner { padding: 40px 18px; }
    .stq-cover-title { font-size: 30px; }
    .stq-cover-stat-num { font-size: 22px; }
}

/* ───────── CAP corp ───────── */
.stq-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.stq-badge {
    display: inline-flex; align-items: center; gap: 6px;
    font: 700 10px/1 'Inter', sans-serif; letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--stq-primary); background: var(--stq-primary-light);
    padding: 5px 9px; border-radius: 20px;
}
.stq-badge svg { width: 12px; height: 12px; }
.stq-lockpill {
    display: inline-flex; align-items: center; gap: 5px;
    font: 700 10px/1 'Inter', sans-serif; letter-spacing: 0.04em;
    color: #b45309; background: rgba(245,158,11,0.14);
    padding: 5px 9px; border-radius: 20px;
}
.stq-lockpill svg { width: 12px; height: 12px; }

/* ───────── SLIDER ───────── */
.stq-slider { margin-top: 2px; }
.stq-viewport { overflow: hidden; }
.stq-slides { display: flex; align-items: flex-start; transition: transform .32s var(--stq-ease); }
.stq-q { flex: 0 0 100%; width: 100%; min-width: 100%; padding: 10px 2px; }

.stq-nav { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 8px; }
.stq-nav-btn {
    width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center;
    border-radius: 8px; background: #fff; border: 1.5px solid rgba(15,23,42,0.12);
    color: var(--stq-text); cursor: pointer; transition: all .15s var(--stq-ease);
}
.stq-nav-btn:hover:not(:disabled) { border-color: var(--stq-primary); color: var(--stq-primary); background: var(--stq-primary-light); }
.stq-nav-btn:disabled { opacity: .3; cursor: default; }
.stq-nav-btn svg { width: 15px; height: 15px; }
.stq-counter { font: 700 12px/1 'Inter', sans-serif; color: var(--stq-muted); min-width: 48px; text-align: center; }
.stq-counter b { color: var(--stq-text); }

/* ───────── O intrebare ───────── */
.stq-q-top { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.stq-q-num {
    flex: 0 0 auto; width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%; background: linear-gradient(180deg, #3b82f6, #2563eb); color: #fff;
    font: 700 11px/1 'Inter', sans-serif; margin-top: 2px;
}
.stq-q-text {
    flex: 1; font: 600 15px/1.4 'Inter', sans-serif; color: var(--stq-text);
    outline: none; border-radius: 6px; min-height: 22px; padding: 2px 4px; margin: -2px -4px;
}
.stq-q-text:focus { outline: 2px solid rgba(37,99,235,0.4); outline-offset: 2px; }
.stq-q-del {
    flex: 0 0 auto; width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center;
    border-radius: 6px; background: transparent; border: 0; cursor: pointer; color: var(--stq-faint); transition: all .15s var(--stq-ease);
}
.stq-q-del:hover { background: rgba(239,68,68,0.12); color: var(--stq-danger); }
.stq-q-del svg { width: 14px; height: 14px; }

/* placeholder pentru campuri editabile goale */
.stq [data-stq-edit]:empty::before {
    content: attr(data-placeholder);
    color: var(--stq-faint); font-style: italic;
}

/* ───────── Variante ───────── */
.stq-opts { display: flex; flex-direction: column; gap: 8px; padding-left: 32px; }
.stq-opt {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px; background: #fff; border: 1.5px solid rgba(15,23,42,0.1); border-radius: 10px;
    transition: all .15s var(--stq-ease);
}
.stq-opt.is-correct { border-color: var(--stq-ok); background: rgba(16,185,129,0.05); }
.stq-check {
    flex: 0 0 auto; width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center;
    border-radius: 7px; border: 2px solid #cbd5e1; background: #e2e8f0; cursor: pointer; padding: 0;
    transition: all .15s var(--stq-ease);
}
.stq-check svg { width: 13px; height: 13px; opacity: 0; transform: scale(0.5); transition: all .15s var(--stq-ease); stroke: #fff; }
.stq-opt.is-correct .stq-check { background: linear-gradient(180deg, #10b981, #059669); border-color: #059669; }
.stq-opt.is-correct .stq-check svg { opacity: 1; transform: scale(1); }
.stq-opt-text {
    flex: 1; font: 400 13.5px/1.4 'Inter', sans-serif; color: #334155;
    outline: none; border-radius: 5px; min-height: 19px; padding: 1px 3px; margin: -1px -3px;
}
.stq-opt-text:focus { outline: 2px solid rgba(37,99,235,0.35); outline-offset: 2px; }
.stq-opt-del {
    flex: 0 0 auto; width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center;
    border-radius: 6px; background: transparent; border: 0; cursor: pointer; color: var(--stq-faint); opacity: 0;
    transition: all .15s var(--stq-ease);
}
.stq-opt:hover .stq-opt-del { opacity: 1; }
.stq-opt-del:hover { background: rgba(239,68,68,0.12); color: var(--stq-danger); }
.stq-opt-del svg { width: 13px; height: 13px; }

.stq-add-opt {
    margin: 10px 0 0 32px; display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 12px; border-radius: 8px; background: transparent; cursor: pointer;
    border: 1.5px dashed rgba(15,23,42,0.18); color: var(--stq-muted);
    font: 600 12px/1 'Inter', sans-serif; transition: all .15s var(--stq-ease);
}
.stq-add-opt:hover { border-color: var(--stq-primary); color: var(--stq-primary); background: var(--stq-primary-light); }
.stq-add-opt svg { width: 13px; height: 13px; }

/* ───────── Nota punctaj (jos) ───────── */
.stq-foot {
    margin-top: 14px; padding-top: 12px; border-top: 1px dashed rgba(15,23,42,0.1);
    display: flex; align-items: center; gap: 8px;
    font: 600 11.5px/1.45 'Inter', sans-serif; color: var(--stq-muted);
}
.stq-foot svg { width: 15px; height: 15px; flex: 0 0 auto; color: var(--stq-primary); }
.stq-foot b { color: var(--stq-text); }

/* viewer: variantele nu se editeaza (Etapa 1) */
.stq[data-mode="viewer"] .stq-check { cursor: default; }

/* ════════════════════════════════════════════
   TOOLBAR — controale specifice testului
   (in interiorul .se-float-toolbar al editorului)
   ════════════════════════════════════════════ */
.stq-badge-t { background: linear-gradient(180deg, #3b82f6, #2563eb) !important; color: #fff !important; }
.stq-tb-chev { display: inline-flex; transition: transform .18s var(--stq-ease, ease); }
.stq-tb-chev svg { width: 11px; height: 11px; display: block; }

/* Adauga intrebare */
.stq-tb-add-wrap { position: relative; display: inline-flex; align-items: stretch; height: 34px; flex: 0 0 auto; }
.stq-tb-add-wrap::after { content: ''; position: absolute; top: 100%; left: -12px; right: -12px; height: 14px; }
.stq-tb-add-trigger {
    display: inline-flex; align-items: center; gap: 7px; padding: 0 11px; height: 34px;
    background: linear-gradient(180deg, #3b82f6, #2563eb); border: 0; border-radius: 8px; cursor: pointer;
    color: #fff; font: 600 12.5px/1 'Inter', sans-serif;
    box-shadow: 0 1px 2px rgba(37,99,235,0.4), inset 0 1px 0 rgba(255,255,255,0.25);
}
.stq-tb-add-trigger > svg:first-child { width: 14px; height: 14px; }
.stq-tb-add-wrap:hover .stq-tb-add-trigger .stq-tb-chev { transform: rotate(180deg); }
.stq-tb-add-dd {
    position: absolute; top: calc(100% + 10px); left: 0; min-width: 250px;
    background: #fff; border: 1px solid rgba(15,23,42,0.08); border-radius: 12px;
    box-shadow: 0 8px 24px -4px rgba(15,23,42,0.18), 0 20px 48px -8px rgba(15,23,42,0.22);
    padding: 6px; z-index: 100; display: flex; flex-direction: column; gap: 3px;
    opacity: 0; pointer-events: none; transform: translateY(-6px);
    transition: opacity .18s var(--stq-ease), transform .18s var(--stq-ease);
}
.stq-tb-add-wrap:hover .stq-tb-add-dd { opacity: 1; pointer-events: auto; transform: translateY(0); }
.stq-tb-add-opt { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; text-align: left; }
.stq-tb-add-opt:hover { background: var(--stq-primary-light); }
.stq-tb-add-ico { min-width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; background: linear-gradient(180deg, #3b82f6, #2563eb); border-radius: 7px; }
.stq-tb-add-ico svg { width: 15px; height: 15px; }
.stq-tb-add-txt { display: flex; flex-direction: column; gap: 1px; }
.stq-tb-add-name { font: 600 12.5px/1.3 'Inter', sans-serif; color: var(--stq-text); }
.stq-tb-add-desc { font: 400 10.5px/1.3 'Inter', sans-serif; color: var(--stq-faint); }

/* Punctaj minim */
.stq-tb-score-wrap { position: relative; display: inline-flex; align-items: stretch; height: 34px; flex: 0 0 auto; }
.stq-tb-score-wrap::after { content: ''; position: absolute; top: 100%; left: -12px; right: -12px; height: 14px; }
.stq-tb-score-trigger {
    display: inline-flex; align-items: center; gap: 7px; padding: 0 9px; height: 34px;
    background: rgba(15,23,42,0.04); border: 0; border-radius: 8px; cursor: pointer;
    color: var(--stq-text); font: 600 12px/1 'Inter', sans-serif;
}
.stq-tb-score-trigger > svg:first-child { width: 15px; height: 15px; color: var(--stq-muted); }
.stq-tb-score-val {
    display: inline-flex; align-items: center; justify-content: center; min-width: 34px; padding: 0 7px; height: 22px;
    background: linear-gradient(180deg, #3b82f6, #2563eb); color: #fff; border-radius: 6px;
    font: 700 11.5px/1 'Inter', sans-serif;
}
.stq-tb-score-wrap:hover .stq-tb-score-trigger .stq-tb-chev { transform: rotate(180deg); }
.stq-tb-score-dd {
    position: absolute; top: calc(100% + 10px); right: 0; min-width: 240px; max-height: 320px; overflow-y: auto;
    background: #fff; border: 1px solid rgba(15,23,42,0.08); border-radius: 12px;
    box-shadow: 0 8px 24px -4px rgba(15,23,42,0.18), 0 20px 48px -8px rgba(15,23,42,0.22);
    padding: 6px; z-index: 100; display: flex; flex-direction: column; gap: 3px;
    opacity: 0; pointer-events: none; transform: translateY(-6px);
    transition: opacity .18s var(--stq-ease), transform .18s var(--stq-ease);
}
.stq-tb-score-wrap:hover .stq-tb-score-dd { opacity: 1; pointer-events: auto; transform: translateY(0); }
.stq-tb-score-hdr { font: 700 10px/1.4 'Inter', sans-serif; letter-spacing: 0.06em; text-transform: uppercase; color: var(--stq-faint); padding: 6px 8px 8px; }
.stq-tb-score-opt { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; text-align: left; }
.stq-tb-score-opt:hover { background: var(--stq-primary-light); }
.stq-tb-score-opt.is-active { background: var(--stq-primary-light); }
.stq-tb-score-opt.is-active .stq-tb-score-name { color: var(--stq-primary); }
.stq-tb-score-badge { min-width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; border-radius: 7px; background: rgba(15,23,42,0.06); color: var(--stq-text); font: 700 12px/1 'Inter', sans-serif; }
.stq-tb-score-opt.is-active .stq-tb-score-badge { background: linear-gradient(180deg, #3b82f6, #2563eb); color: #fff; }
.stq-tb-score-txt { display: flex; flex-direction: column; gap: 1px; }
.stq-tb-score-name { font: 600 12.5px/1.3 'Inter', sans-serif; color: var(--stq-text); }
.stq-tb-score-desc { font: 400 10.5px/1.3 'Inter', sans-serif; color: var(--stq-faint); }

/* Blocare progres (toggle) */
.stq-tb-toggle {
    display: inline-flex; align-items: center; gap: 7px; padding: 0 11px 0 8px; height: 34px;
    border: 0; border-radius: 8px; background: rgba(15,23,42,0.04); cursor: pointer;
    color: var(--stq-muted); font: 600 12px/1 'Inter', sans-serif; transition: all .15s var(--stq-ease);
}
.stq-tb-toggle:hover { background: rgba(15,23,42,0.08); color: var(--stq-text); }
.stq-tb-toggle.is-active {
    background: linear-gradient(180deg, #3b82f6, #2563eb); color: #fff;
    box-shadow: 0 1px 2px rgba(37,99,235,0.4), inset 0 1px 0 rgba(255,255,255,0.3);
}
.stq-tb-toggle svg { width: 15px; height: 15px; display: block; }


/* ════════════════════════════════════════════
   ETAPA 2 — modul de RASPUNS (user)
   ════════════════════════════════════════════ */

/* Varianta selectabila (buton) */
.stq-opt-ans { width: 100%; cursor: pointer; text-align: left; background: #fff; }
.stq-opt-ans:hover { border-color: rgba(37,99,235,0.5); }
.stq-opt-ans.is-selected { border-color: var(--stq-primary); background: var(--stq-primary-light); }
.stq-radio {
    flex: 0 0 auto; width: 20px; height: 20px; border-radius: 50%;
    border: 2px solid #cbd5e1; background: #fff; position: relative; transition: all .15s var(--stq-ease);
}
.stq-opt-ans.is-selected .stq-radio { border-color: var(--stq-primary); }
.stq-opt-ans.is-selected .stq-radio::after {
    content: ''; position: absolute; inset: 3px; border-radius: 50%;
    background: linear-gradient(180deg, #3b82f6, #2563eb);
}

/* Footer cu progres + buton finalizare */
.stq-foot-ans { justify-content: space-between; }
.stq-progress { font: 600 11.5px/1 'Inter', sans-serif; color: var(--stq-muted); }
.stq-submit {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 9px 18px; border: 0; border-radius: 9px; cursor: pointer;
    background: linear-gradient(180deg, #3b82f6, #2563eb); color: #fff;
    font: 600 13px/1 'Inter', sans-serif;
    box-shadow: 0 2px 6px rgba(37,99,235,0.4), inset 0 1px 0 rgba(255,255,255,0.25);
    transition: filter .15s var(--stq-ease);
}
.stq-submit:hover { filter: brightness(1.06); }
.stq-submit.is-disabled { opacity: .4; pointer-events: none; box-shadow: none; }

/* Rezultat */
.stq-result {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; gap: 8px; padding: 28px 16px;
}
.stq-result-icon {
    width: 52px; height: 52px; display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%; color: #fff; margin-bottom: 2px;
}
.stq-result-icon svg { width: 26px; height: 26px; }
.stq-result.is-pass .stq-result-icon { background: linear-gradient(180deg, #10b981, #059669); }
.stq-result.is-pass .stq-result-icon svg { stroke: #fff; }
.stq-result.is-fail .stq-result-icon { background: linear-gradient(180deg, #f87171, #ef4444); }
.stq-result-title { font: 700 18px/1.2 'Fraunces', serif; }
.stq-result.is-pass .stq-result-title { color: #059669; }
.stq-result.is-fail .stq-result-title { color: #dc2626; }
.stq-result-sub { font: 500 13px/1.5 'Inter', sans-serif; color: var(--stq-muted); max-width: 320px; }
.stq-retry {
    margin-top: 10px; display: inline-flex; align-items: center; gap: 6px;
    padding: 9px 18px; border: 0; border-radius: 9px; cursor: pointer;
    background: linear-gradient(180deg, #3b82f6, #2563eb); color: #fff;
    font: 600 13px/1 'Inter', sans-serif;
    box-shadow: 0 2px 6px rgba(37,99,235,0.4), inset 0 1px 0 rgba(255,255,255,0.25);
    transition: filter .15s var(--stq-ease);
}
.stq-retry:hover { filter: brightness(1.06); }
.stq-retry svg { width: 14px; height: 14px; }


/* ════════════════════════════════════════════
   USER (parcurgere) — text intrebare mai mare + aliniat cu numarul
   (doar in modul raspuns .stq-q-ans; editorul ramane neschimbat)
   ════════════════════════════════════════════ */
.stq-q-ans .stq-q-top { align-items: center; }
.stq-q-ans .stq-q-num { margin-top: 0; width: 24px; height: 24px; font-size: 12px; }
.stq-q-ans .stq-q-text { font-size: 18px; line-height: 1.45; font-weight: 600; }
