/* ehliyetkursu.tr — ortak sınav çözüm ekranı (ehliyet, SRC, kurye)
   Kullanım: <body class="sx ..."> ve js/sinav-ui.js. Tüm kurallar body.sx altındadır,
   eski sayfa stillerini etkilemez. Açık/koyu tema js/tema.js'in koyduğu data-theme'i izler. */

body.sx {
  --sx-bg: #F2F4F7; --sx-surface: #FFFFFF; --sx-fg: #1B2733; --sx-muted: #5B6B7B; --sx-line: #DCE2E9;
  --sx-bar: #E8A13C; --sx-bar-fg: #1B2733;
  --sx-opt: #263746; --sx-opt-fg: #FFFFFF; --sx-opt-hover: #2F4558;
  --sx-ok: #2E9E6B; --sx-bad: #D4493F;
  --sx-focus: #1D5FD1;
  --sx-font: 'Figtree', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body.sx {
    --sx-bg: #0F161D; --sx-surface: #17212B; --sx-fg: #E8EDF2; --sx-muted: #9AA9B8; --sx-line: #2A3846;
    --sx-opt: #243546; --sx-opt-hover: #2D4358; --sx-focus: #7FB0FF;
  }
}
:root[data-theme="dark"] body.sx {
  --sx-bg: #0F161D; --sx-surface: #17212B; --sx-fg: #E8EDF2; --sx-muted: #9AA9B8; --sx-line: #2A3846;
  --sx-opt: #243546; --sx-opt-hover: #2D4358; --sx-focus: #7FB0FF;
}

body.sx { background: var(--sx-bg); color: var(--sx-fg); font-family: var(--sx-font); font-size: 16px; line-height: 1.5; margin: 0; padding: 0; min-height: 100vh; -webkit-tap-highlight-color: transparent; }
body.sx *, body.sx *::before, body.sx *::after { box-sizing: border-box; }
body.sx button { font: inherit; color: inherit; cursor: pointer; }
body.sx :focus-visible { outline: 3px solid var(--sx-focus); outline-offset: 2px; }
body.sx .theme-toggle { display: none; }
body.sx .to-top { display: none !important; }

/* Durum şeridi */
body.sx .sx-top { position: sticky; top: 0; z-index: 30; padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 0; background: linear-gradient(var(--sx-bg) 70%, transparent); }
body.sx .sx-bar { max-width: 1080px; margin: 0 auto; height: 56px; border-radius: 16px; background: var(--sx-bar); color: var(--sx-bar-fg); display: flex; align-items: center; justify-content: space-between; padding: 0 18px; font-weight: 800; font-size: 1.05rem; position: relative; }
body.sx .sx-l { display: flex; align-items: center; gap: 10px; min-width: 0; }
body.sx .sx-count, body.sx .sx-score { font-variant-numeric: tabular-nums; white-space: nowrap; }
body.sx .sx-exit { width: 36px; height: 36px; border-radius: 10px; border: 0; background: rgba(27,39,51,.14); display: grid; place-items: center; flex: none; text-decoration: none; color: inherit; }
body.sx .sx-exit svg { width: 18px; height: 18px; }
body.sx .sx-exit.armed { background: var(--sx-bad); color: #fff; }
body.sx .sx-ring { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); width: 76px; height: 76px; border-radius: 50%; background: var(--sx-surface); display: grid; place-items: center; box-shadow: 0 0 0 4px var(--sx-bg); }
body.sx .sx-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
body.sx .sx-ring .tr { stroke: var(--sx-line); }
body.sx .sx-ring .pg { stroke: var(--sx-bar); transition: stroke-dashoffset 1s linear; }
body.sx .sx-ring b { font-size: 1rem; font-variant-numeric: tabular-nums; color: var(--sx-fg); position: relative; }
body.sx .sx-ring.low .pg { stroke: var(--sx-bad); }
body.sx .sx-ring.low b { color: var(--sx-bad); }

/* Gövde */
body.sx .sx-main { width: 100%; max-width: 1080px; margin: 0 auto; padding: 30px 16px 128px; display: grid; gap: 20px; grid-template-columns: minmax(0,1fr); }
body.sx .sx-card { min-width: 0; }
body.sx .sx-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; color: var(--sx-muted); font-size: .85rem; font-weight: 600; }
body.sx .sx-meta .sx-right { display: flex; align-items: center; gap: 10px; }
body.sx .sx-chip { padding: 3px 10px; border-radius: 99px; background: var(--sx-surface); border: 1px solid var(--sx-line); max-width: 60vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.sx .sx-rep { border: 0; background: none; color: var(--sx-muted); font-size: .82rem; padding: 4px 2px; text-decoration: underline; display: inline-flex; align-items: center; gap: 6px; }
body.sx .sx-rep:disabled { text-decoration: none; color: var(--sx-ok); cursor: default; }
body.sx .sx-q { font-size: clamp(1.2rem, 3.6vw, 1.6rem); font-weight: 800; line-height: 1.38; margin: 4px 0 18px; overflow-wrap: anywhere; }
body.sx .sx-q p { margin: 0 0 .5em; } body.sx .sx-q p:last-child { margin-bottom: 0; }
body.sx .sx-q img { max-width: 100%; height: auto; }
body.sx .sx-media { display: grid; place-items: center; background: var(--sx-surface); border: 1px solid var(--sx-line); border-radius: 16px; padding: 14px; margin-bottom: 18px; }
body.sx .sx-media img { max-width: 100%; max-height: 42vh; height: auto; object-fit: contain; border-radius: 8px; }
body.sx .sx-vid { position: relative; border-radius: 16px; overflow: hidden; background: #000; margin-bottom: 18px; display: grid; }
body.sx .sx-vid video { width: 100%; max-height: 46vh; display: block; object-fit: contain; background: #000; }
body.sx .sx-vc { position: absolute; right: 10px; bottom: 10px; display: flex; gap: 8px; }
body.sx .sx-vb { width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; display: grid; place-items: center; }
body.sx .sx-vb svg { width: 20px; height: 20px; }

/* Şıklar */
body.sx .sx-opts { display: grid; gap: 12px; grid-template-columns: minmax(0,1fr); }
body.sx .sx-opt { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 62px; padding: 12px 16px; text-align: left; border: 2px solid transparent; border-radius: 18px; background: var(--sx-opt); color: var(--sx-opt-fg); font-size: 1.06rem; font-weight: 500; box-shadow: 0 2px 0 rgba(0,0,0,.18); transition: background .15s, transform .05s; }
body.sx .sx-opt:hover:not(:disabled):not(.locked) { background: var(--sx-opt-hover); }
body.sx .sx-opt:active:not(:disabled):not(.locked) { transform: scale(.99); }
body.sx .sx-opt .k { flex: none; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: rgba(255,255,255,.14); font-weight: 800; font-size: .9rem; }
body.sx .sx-opt .t { flex: 1; min-width: 0; overflow-wrap: anywhere; display: grid; gap: 8px; justify-items: start; }
body.sx .sx-opt .t img, body.sx .sx-opt .t video { max-width: 100%; max-height: 150px; border-radius: 10px; background: #fff; }
body.sx .sx-opt .ic { flex: none; width: 24px; height: 24px; display: none; }
body.sx .sx-opt.locked, body.sx .sx-opt:disabled { cursor: default; }
body.sx .sx-opt.ok { background: var(--sx-ok); border-color: var(--sx-ok); }
body.sx .sx-opt.ok .ic.y { display: block; }
body.sx .sx-opt.bad { background: var(--sx-bad); border-color: var(--sx-bad); }
body.sx .sx-opt.bad .ic.n { display: block; }
body.sx .sx-opt.dim { opacity: .55; }
body.sx .sx-opt.wait { opacity: .7; }

/* Çözüm açıklaması */
body.sx .sx-why { margin-top: 18px; border-radius: 18px; background: var(--sx-surface); border: 1px solid var(--sx-line); padding: 16px 18px; }
body.sx .sx-why h3 { margin: 0 0 6px; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--sx-muted); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
body.sx .sx-why .v { font-weight: 800; letter-spacing: 0; text-transform: none; font-size: .95rem; }
body.sx .sx-why.ok .v { color: var(--sx-ok); }
body.sx .sx-why.bad .v { color: var(--sx-bad); }
body.sx .sx-why p { margin: 0; max-width: 65ch; }

/* Alt çubuk */
body.sx .sx-dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px)); background: linear-gradient(transparent, var(--sx-bg) 35%); }
body.sx .sx-dock .in { max-width: 1080px; margin: 0 auto; display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); gap: 10px; align-items: center; }
body.sx .sx-btn { height: 52px; border-radius: 16px; border: 1px solid var(--sx-line); background: var(--sx-surface); color: var(--sx-fg); font-weight: 700; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 0 12px; min-width: 0; text-decoration: none; }
body.sx .sx-btn:hover { color: var(--sx-fg); }
body.sx .sx-btn:disabled, body.sx .sx-btn.off { opacity: .4; cursor: default; pointer-events: none; }
body.sx .sx-btn.go { background: var(--sx-fg); color: var(--sx-bg); border-color: var(--sx-fg); }
body.sx .sx-btn.go:hover { color: var(--sx-bg); }
body.sx .sx-btn.map { min-width: 96px; font-variant-numeric: tabular-nums; }
body.sx .sx-btn svg { width: 20px; height: 20px; flex: none; }

/* Soru haritası */
body.sx .sx-mapbox { background: var(--sx-surface); border: 1px solid var(--sx-line); border-radius: 18px; padding: 16px; }
body.sx .sx-mapbox h2 { margin: 0 0 12px; font-size: 1rem; font-weight: 800; display: flex; justify-content: space-between; align-items: baseline; color: var(--sx-fg); }
body.sx .sx-mapbox h2 span { font-weight: 500; color: var(--sx-muted); font-size: .85rem; }
body.sx .sx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 8px; }
body.sx .sx-cell { aspect-ratio: 1; border-radius: 12px; border: 1.5px solid var(--sx-line); background: var(--sx-bg); font-weight: 700; font-variant-numeric: tabular-nums; }
body.sx .sx-cell.ok { background: var(--sx-ok); border-color: var(--sx-ok); color: #fff; }
body.sx .sx-cell.bad { background: var(--sx-bad); border-color: var(--sx-bad); color: #fff; }
body.sx .sx-cell.cur { outline: 3px solid var(--sx-focus); outline-offset: 1px; }
body.sx .sx-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 14px 0 0; color: var(--sx-muted); font-size: .8rem; }
body.sx .sx-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; background: var(--sx-bg); border: 1.5px solid var(--sx-line); }
body.sx .sx-legend .a i { background: var(--sx-ok); border-color: var(--sx-ok); }
body.sx .sx-legend .b i { background: var(--sx-bad); border-color: var(--sx-bad); }
body.sx .sx-finish { width: 100%; margin-top: 14px; }
body.sx .sx-side { display: none; }

/* Alttan açılan sayfa ve onay penceresi */
body.sx .sx-sheet, body.sx .sx-confirm { position: fixed; inset: 0; z-index: 60; display: none; }
body.sx .sx-sheet.open, body.sx .sx-confirm.open { display: block; }
body.sx .sx-sheet .bg, body.sx .sx-confirm .bg { position: absolute; inset: 0; background: rgba(8,12,16,.55); }
body.sx .sx-sheet .pan { position: absolute; left: 0; right: 0; bottom: 0; max-height: 80%; overflow: auto; background: var(--sx-bg); border-radius: 22px 22px 0 0; padding: 14px 16px calc(18px + env(safe-area-inset-bottom, 0px)); animation: sxup .22s ease-out; }
body.sx .sx-sheet .grab { width: 44px; height: 5px; border-radius: 9px; background: var(--sx-line); margin: 0 auto 12px; }
body.sx .sx-confirm .box { position: absolute; left: 16px; right: 16px; top: 50%; transform: translateY(-50%); max-width: 420px; margin: 0 auto; background: var(--sx-surface); border-radius: 20px; padding: 22px; box-shadow: 0 20px 60px rgba(0,0,0,.4); }
body.sx .sx-confirm h2 { margin: 0 0 8px; font-size: 1.15rem; font-weight: 800; color: var(--sx-fg); }
body.sx .sx-confirm p { margin: 0 0 18px; color: var(--sx-muted); }
body.sx .sx-confirm .row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@keyframes sxup { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }

/* Bildirim */
body.sx .sx-toast { position: fixed; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 80; max-width: min(92vw, 420px); padding: 12px 18px; border-radius: 14px; color: #fff; background: var(--sx-ok); font-weight: 600; box-shadow: 0 8px 24px rgba(0,0,0,.3); }
body.sx .sx-toast.err { background: var(--sx-bad); }

/* Sonuç / bitiş kartı */
body.sx .sx-result { text-align: center; padding: 36px 20px; }
body.sx .sx-result .big { font-size: 3rem; font-weight: 800; font-variant-numeric: tabular-nums; }
body.sx .sx-result .row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }

/* Hata bildirimi penceresi (Bootstrap modal ve özel modal) */
body.sx .modal-content, body.sx .custom-modal-content { background: var(--sx-surface); color: var(--sx-fg); border-radius: 18px; border: 1px solid var(--sx-line); }
body.sx .modal-header, body.sx .modal-footer, body.sx .custom-modal-header, body.sx .custom-modal-footer { border-color: var(--sx-line); }
body.sx .modal-header.bg-danger { background: var(--sx-bad) !important; border-radius: 17px 17px 0 0; }
body.sx .form-control { background: var(--sx-bg); color: var(--sx-fg); border-color: var(--sx-line); }
body.sx .error-type-options { display: flex; flex-direction: column; gap: 8px; }
body.sx .error-type-item { display: flex; align-items: center; cursor: pointer; margin: 0; }
body.sx .error-type-item input[type="checkbox"] { display: none; }
body.sx .error-type-label { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 2px solid var(--sx-line); border-radius: 12px; width: 100%; font-size: .92rem; color: var(--sx-muted); background: var(--sx-bg); cursor: pointer; }
body.sx .error-type-label i { width: 18px; text-align: center; flex-shrink: 0; }
body.sx .error-type-item input[type="checkbox"]:checked + .error-type-label { border-color: var(--sx-bad); color: var(--sx-bad); font-weight: 700; }
body.sx .section-divider { border: 0; border-top: 1px solid var(--sx-line); margin: 16px 0; }
body.sx .text-muted { color: var(--sx-muted) !important; }
@media (max-width: 575.98px) {
  body.sx .modal-dialog { margin: 0; min-height: 100%; align-items: flex-end; }
  body.sx .modal-content { border-radius: 22px 22px 0 0; }
}

@media (min-width: 960px) {
  body.sx .sx-main { grid-template-columns: minmax(0,1fr) 320px; gap: 32px; padding-top: 36px; }
  body.sx .sx-side { display: block; position: sticky; top: 110px; align-self: start; }
  body.sx .sx-btn.map { display: none; }
  body.sx .sx-dock .in { grid-template-columns: 1fr 1fr; padding-right: 352px; }
  body.sx .theme-toggle { display: block; bottom: 24px; }
}
@media (prefers-reduced-motion: reduce) { body.sx * { animation: none !important; transition: none !important; } }

@media (max-width: 479.98px) {
  body.sx .sx-count .lbl { display: none; }
  body.sx .sx-bar { padding: 0 12px; font-size: 1rem; }
}
