/* Aurum Try-On — shared design system.
   Built for two very different screens: a manager's laptop and a 10" kiosk
   tablet held by a sales associate in a bright showroom. Hence the large hit
   targets, high contrast and no hover-only affordances. */

:root {
  --ink: #16130f;
  --ink-2: #2a251d;
  --paper: #faf8f4;
  --paper-2: #f1ede4;
  --line: #e0d9cc;
  --gold: #b8860b;
  --gold-soft: #d9b45a;
  --gold-wash: #fdf6e4;
  --muted: #7a7266;
  --ok: #1f7a53;
  --warn: #9a6b12;
  --bad: #a33127;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(22, 19, 15, .05), 0 8px 24px rgba(22, 19, 15, .07);
  --shadow-lg: 0 20px 60px rgba(22, 19, 15, .18);
  --font: ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #f2eee6; --ink-2: #cdc5b7; --paper: #14120f; --paper-2: #1d1a15;
    --line: #322c23; --gold: #d9b45a; --gold-wash: #241e12; --muted: #948b7c;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
  }
}
:root[data-theme="dark"] {
  --ink: #f2eee6; --ink-2: #cdc5b7; --paper: #14120f; --paper-2: #1d1a15;
  --line: #322c23; --gold: #d9b45a; --gold-wash: #241e12; --muted: #948b7c;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
h1, h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: -.01em; margin: 0 0 .4em; }
h1 { font-size: clamp(1.6rem, 4vw, 2.3rem); }
h2 { font-size: clamp(1.2rem, 2.6vw, 1.5rem); }
a { color: var(--gold); }
small, .small { font-size: .82rem; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .82em; }

/* ---------- layout ---------- */
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 16px; }
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 12px 16px; background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-size: 1.12rem; }
.brand .mark {
  width: 30px; height: 30px; border-radius: 9px; flex: none;
  background: linear-gradient(140deg, var(--gold-soft), var(--gold));
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: .82rem;
}
.spacer { flex: 1 1 auto; }
.grid { display: grid; gap: 16px; }
.cards { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 10px; }
section { padding: 22px 0; }

/* ---------- controls ---------- */
button, .btn {
  font: inherit; font-weight: 600; cursor: pointer;
  border-radius: 11px; border: 1px solid var(--line);
  background: var(--paper-2); color: var(--ink);
  padding: 11px 16px; min-height: 44px;
  transition: transform .08s ease, background .15s ease, border-color .15s ease;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
button:active, .btn:active { transform: translateY(1px); }
button:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: linear-gradient(140deg, var(--gold-soft), var(--gold)); border-color: transparent; color: #fff; }
.btn-ghost { background: transparent; }
.btn-danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, var(--line)); background: transparent; }
.btn-lg { padding: 15px 26px; min-height: 56px; font-size: 1.04rem; border-radius: 13px; }
input, select, textarea {
  font: inherit; color: var(--ink); background: var(--paper);
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; min-height: 44px; width: 100%;
}
input:focus, select:focus, textarea:focus, button:focus-visible {
  outline: 2px solid var(--gold); outline-offset: 1px;
}
label { display: block; font-size: .8rem; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
.field { margin-bottom: 12px; }

/* ---------- surfaces ---------- */
.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.card .body { padding: 14px; }
.panel { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.thumb { aspect-ratio: 1; width: 100%; object-fit: cover; background: var(--paper-2); display: block; }
.thumb.contain { object-fit: contain; }
.pill {
  display: inline-flex; align-items: center; gap: 5px; border-radius: 999px;
  padding: 3px 10px; font-size: .72rem; font-weight: 700; letter-spacing: .02em;
  background: var(--gold-wash); color: var(--warn); border: 1px solid color-mix(in srgb, var(--gold) 26%, transparent);
}
.pill.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 10%, transparent); border-color: color-mix(in srgb, var(--ok) 28%, transparent); }
.pill.bad { color: var(--bad); background: color-mix(in srgb, var(--bad) 10%, transparent); border-color: color-mix(in srgb, var(--bad) 28%, transparent); }
.pill.neutral { color: var(--muted); background: var(--paper-2); border-color: var(--line); }

.selectable { position: relative; cursor: pointer; }
.selectable.on { outline: 3px solid var(--gold); outline-offset: 2px; }
.selectable.on::after {
  content: "✓"; position: absolute; top: 8px; right: 8px; width: 26px; height: 26px;
  border-radius: 50%; background: var(--gold); color: #fff; display: grid; place-items: center;
  font-size: .85rem; font-weight: 700;
}

/* ---------- steps ---------- */
.steps { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.step {
  display: flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px;
  font-size: .8rem; font-weight: 600; color: var(--muted); background: var(--paper-2); border: 1px solid var(--line);
}
.step.on { color: #fff; background: var(--gold); border-color: transparent; }
.step.done { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 32%, transparent); }

.progress { height: 7px; border-radius: 99px; background: var(--paper-2); overflow: hidden; border: 1px solid var(--line); }
.progress > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold-soft), var(--gold)); transition: width .3s ease; }

.toast-host { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--ink); color: var(--paper); padding: 11px 16px; border-radius: 11px; box-shadow: var(--shadow-lg); font-size: .9rem; max-width: 90vw; }
.toast.bad { background: var(--bad); color: #fff; }

dialog { border: none; border-radius: 16px; padding: 0; background: var(--paper); color: var(--ink); box-shadow: var(--shadow-lg); max-width: min(680px, 94vw); width: 100%; }
dialog::backdrop { background: rgba(10, 8, 6, .55); backdrop-filter: blur(3px); }
dialog .body { padding: 20px; }
dialog header { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; }
dialog footer { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; }

table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); }
th { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }

.stat { padding: 14px 16px; border-radius: var(--radius); background: var(--paper-2); border: 1px solid var(--line); }
.stat b { display: block; font-family: var(--display); font-size: 1.85rem; line-height: 1.1; }
.stat span { font-size: .78rem; color: var(--muted); }

.empty { text-align: center; padding: 48px 20px; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); }
.hidden { display: none !important; }
.spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--gold) 30%, transparent); border-top-color: var(--gold); animation: sp .8s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { * { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ---------- kiosk-specific ---------- */
.kiosk { min-height: 100dvh; display: flex; flex-direction: column; }
.kiosk main { flex: 1; padding: 18px 16px 110px; }
.kiosk .dock {
  position: fixed; bottom: 0; left: 0; right: 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line); display: flex; gap: 10px; align-items: center; z-index: 30;
}
.stage { display: grid; place-items: center; background: var(--ink); border-radius: var(--radius); overflow: hidden; position: relative; }
.stage img, .stage video { width: 100%; display: block; }
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.filmstrip { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x mandatory; }
.filmstrip > * { flex: 0 0 min(220px, 56vw); scroll-snap-align: start; }

/* filmstrip cards keep a portrait crop so a gallery of looks scans evenly */
.filmstrip .thumb { aspect-ratio: 3/4; }
.filmstrip video.thumb { object-fit: cover; background: #000; }
