/* The CRO Game — shared styles (light theme).
 * Tailwind's gray / accent scales are inverted in cro.js (tailwind.config), so the pages' existing classes
 * (text-gray-300, bg-gray-900/70, text-white, text-emerald-400, bg-rose-900/30 …) render correctly on light surfaces.
 */
:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --line: #e3e8f0;
  --line-strong: #cbd5e1;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --accent-blue: #2563eb; --accent-cyan: #0891b2; --accent-purple: #9333ea;
  --accent-rose: #e11d48; --accent-amber: #d97706; --accent-emerald: #059669;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 6px 20px rgba(15, 23, 42, .06);
  --shadow-lg: 0 2px 4px rgba(15, 23, 42, .05), 0 14px 36px rgba(15, 23, 42, .10);
}
html { color-scheme: light; }
body {
  font-family: 'Inter', sans-serif; color: var(--ink); overflow-x: hidden; min-height: 100vh;
  background:
    radial-gradient(1200px 420px at 10% -10%, rgba(37, 99, 235, .07), transparent 60%),
    radial-gradient(900px 380px at 95% -5%, rgba(147, 51, 234, .06), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
.display-font { font-family: 'Space Grotesk', sans-serif; letter-spacing: -0.01em; }
h1, h2, h3 { color: var(--ink); }
.glass-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.kpi { font-variant-numeric: tabular-nums; }
.pill { display:inline-block; padding:2px 10px; border-radius:999px; font-size:.7rem; font-weight:700; letter-spacing:.05em; text-transform:uppercase; }
.tag { display:inline-block; padding:4px 12px; border-radius:999px; font-size:.7rem; font-weight:700; letter-spacing:.12em; text-transform:uppercase; }
code { background: #eef2f7; padding: 1px 5px; border-radius: 4px; }

::-webkit-scrollbar { width: 10px; height: 10px; } ::-webkit-scrollbar-track { background: transparent; } ::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 6px; border: 2px solid var(--bg); }

/* range sliders */
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; background: transparent; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; height: 20px; width: 20px; border-radius: 50%; background: var(--slider-color, var(--accent-blue)); cursor: pointer; margin-top: -8px; border: 3px solid #fff; box-shadow: 0 1px 4px rgba(15,23,42,.3); }
input[type=range]::-webkit-slider-runnable-track { width: 100%; height: 4px; cursor: pointer; background: #dbe2ec; border-radius: 2px; }
input[type=range]::-moz-range-thumb { height: 16px; width: 16px; border-radius: 50%; border: 3px solid #fff; background: var(--slider-color, var(--accent-blue)); cursor: pointer; box-shadow: 0 1px 4px rgba(15,23,42,.3); }
input[type=range]::-moz-range-track { height: 4px; background: #dbe2ec; border-radius: 2px; }

/* tables */
.data-room-table { width: 100%; border-collapse: collapse; }
.data-room-table th, .data-room-table td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.data-room-table th { color: var(--muted); font-weight: 600; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; background: var(--surface-2); }
.data-room-table td { font-size: 0.85rem; color: var(--ink-2); }
.data-room-table tr:last-child td { border-bottom: 0; }
.data-room-table td.num, .data-room-table th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* selectable cards / options */
.card-selectable { transition: all 0.15s ease; cursor: pointer; }
.card-selectable:hover { border-color: #94a3b8; background: var(--surface-2); }
.card-selected-active { border-color: var(--accent-blue) !important; background: #eff6ff !important; box-shadow: 0 0 0 3px rgba(37,99,235,.12); }

.opt { display:block; width:100%; text-align:left; padding: 12px 14px; border:1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--ink-2); font-size:.875rem; line-height:1.45; transition: all .15s ease; box-shadow: var(--shadow-sm); }
.opt:hover:not([disabled]) { border-color: #94a3b8; background: var(--surface-2); transform: translateY(-1px); }
.opt[disabled] { cursor: default; }
.opt.picked { border-color: var(--accent-blue); background: #eff6ff; color: var(--ink); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.opt.correct { border-color: var(--accent-emerald); background: #ecfdf5; color: var(--ink); }
.opt.wrong { border-color: var(--accent-rose); background: #fff1f2; color: var(--ink); }
.opt.partial { border-color: var(--accent-amber); background: #fffbeb; color: var(--ink); }
.opt.dim { opacity: .55; }
.opt .opt-key { display:inline-flex; align-items:center; justify-content:center; width:22px; height:22px; border-radius:6px; background:#eef2f7; color: var(--muted); font-size:.7rem; font-weight:700; margin-right:10px; flex-shrink:0; }
.opt.picked .opt-key { background: var(--accent-blue); color: #fff; }
.opt.correct .opt-key { background: var(--accent-emerald); color: #fff; }
.opt.wrong .opt-key { background: var(--accent-rose); color: #fff; }

/* bars & meters */
.bar-track { width: 100%; height: 10px; background: #e6ebf2; border-radius: 6px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 6px; transition: width .5s ease, background .3s; }
.stat-row { display:flex; justify-content:space-between; align-items:center; gap: 12px; }

/* buttons & inputs */
.btn { display:inline-flex; align-items:center; justify-content:center; gap:8px; padding: 10px 18px; border-radius: 10px; font-weight: 700; font-size: .875rem; transition: all .15s ease; cursor:pointer; border: 1px solid transparent; }
.btn[disabled] { opacity:.45; cursor:not-allowed; }
.btn:not([disabled]):active { transform: translateY(1px); }
.btn-primary { background: #2563eb; color:#fff; box-shadow: 0 1px 2px rgba(37,99,235,.3), 0 4px 12px rgba(37,99,235,.22); }
.btn-primary:hover:not([disabled]) { background:#1d4ed8; }
.btn-emerald { background: #059669; color:#fff; box-shadow: 0 1px 2px rgba(5,150,105,.3), 0 4px 12px rgba(5,150,105,.22); }
.btn-emerald:hover:not([disabled]) { background:#047857; }
.btn-ghost { background: var(--surface); color: var(--ink-2); border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.btn-ghost:hover:not([disabled]) { background: var(--surface-2); border-color:#94a3b8; }
.btn-danger { background: #e11d48; color:#fff; }
.btn-danger:hover:not([disabled]) { background:#be123c; }
.input { width:100%; padding: 10px 12px; border-radius: 10px; background: var(--surface); border:1px solid var(--line-strong); color: var(--ink); font-size:.9rem; }
.input::placeholder { color: #94a3b8; }
.input:focus { outline:none; border-color: var(--accent-blue); box-shadow: 0 0 0 3px rgba(37,99,235,.18); }
label.lbl { display:block; font-size:.7rem; color: var(--muted); font-weight:600; text-transform:uppercase; letter-spacing:.08em; margin-bottom:6px; }
:focus-visible { outline: 2px solid var(--accent-blue); outline-offset: 2px; }

/* details */
details > summary { cursor: pointer; list-style: none; }
details > summary::-webkit-details-marker { display:none; }
details[open] .chev { transform: rotate(90deg); }
.chev { display:inline-block; transition: transform .2s; }

/* top bar */
#cro-topbar { position: sticky; top: 0; z-index: 40; }
.cro-bar { background: rgba(255,255,255,.92); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.cro-logo { width: 26px; height: 26px; border-radius: 8px; display:inline-flex; align-items:center; justify-content:center; background: linear-gradient(135deg, #2563eb, #9333ea 55%, #e11d48); color:#fff; font: 700 11px 'Space Grotesk', sans-serif; letter-spacing: .02em; box-shadow: 0 2px 6px rgba(37,99,235,.35); }

/* overlays & toasts */
.cro-overlay { position: fixed; inset: 0; z-index: 60; background: rgba(241,245,249,.85); backdrop-filter: blur(4px); display:flex; align-items:center; justify-content:center; padding: 16px; }
.cro-toast-wrap { position: fixed; right: 16px; bottom: 16px; z-index: 70; display:flex; flex-direction:column; gap:8px; max-width: min(420px, calc(100vw - 32px)); }
.cro-toast { padding: 12px 16px; border-radius: 10px; font-size: .85rem; border:1px solid var(--line); border-left: 4px solid var(--accent-blue); background: #fff; color: var(--ink-2); box-shadow: var(--shadow-lg); animation: fadeIn .25s ease-out; }
.cro-toast.good { border-left-color: var(--accent-emerald); }
.cro-toast.bad { border-left-color: var(--accent-rose); }
.cro-toast.warn { border-left-color: var(--accent-amber); }

.fade-in { animation: fadeIn 0.3s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px);} to { opacity: 1; transform: translateY(0);} }
.pulse-dot { width: 10px; height: 10px; border-radius: 50%; background: #e11d48; box-shadow: 0 0 0 3px rgba(225,29,72,.15); animation: pulse 2s infinite; display:inline-block; }
@keyframes pulse { 0%,100% { opacity:1 } 50% { opacity:.45 } }
.lift { transition: transform .15s ease, box-shadow .15s ease; }
.lift:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

.score-badge { font-family:'Space Grotesk', sans-serif; font-weight:700; }
.hidden-soft { display:none !important; }
pre { color: var(--ink-2); }

@media print { #cro-topbar, .no-print { display:none !important; } body { background:#fff; } .glass-panel { box-shadow:none; } }
