/* =====================================================================
   Le Verdict — styles
   Direction « tribunal pop » : sombre par défaut, un rouge verdict,
   un jaune surligneur. Typos : Bricolage Grotesque + Inter.
   ===================================================================== */

:root {
  --ink: #14131A;
  --paper: #F6F4EF;
  --red: #E5383B;
  --red-soft: rgba(229, 56, 59, .14);
  --yellow: #FFD23F;
  --grey: #8A8794;

  --bg: var(--ink);
  --surface: #1E1D26;
  --surface-2: #282733;
  --line: #34333F;
  --text: #F6F4EF;
  --text-2: #B4B1BD;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);

  --radius: 16px;
  --font-title: 'Bricolage Grotesque', system-ui, sans-serif;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

html.light {
  --bg: var(--paper);
  --surface: #FFFFFF;
  --surface-2: #EFECE5;
  --line: #E0DCD3;
  --text: #14131A;
  --text-2: #5C5966;
  --shadow: 0 10px 30px rgba(20, 19, 26, .08);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

#app {
  max-width: 560px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 8px) 18px calc(env(safe-area-inset-bottom) + 40px);
  min-height: 100vh;
}

h1, h2, h3 { font-family: var(--font-title); line-height: 1.15; margin: 0 0 .5em; }
h1 { font-size: 2rem; font-weight: 800; letter-spacing: -.02em; }
h2 { font-size: 1.35rem; font-weight: 800; letter-spacing: -.01em; }
h3 { font-size: 1.05rem; font-weight: 600; }
p { margin: 0 0 .9em; }
a { color: inherit; }
.muted { color: var(--text-2); }
.small { font-size: .875rem; }
.center { text-align: center; }
.hidden { display: none !important; }

/* ---------- En-tête ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0 18px;
}
.logo {
  font-family: var(--font-title); font-weight: 800; font-size: 1.35rem;
  letter-spacing: -.02em; text-decoration: none; display: flex; align-items: center; gap: 8px;
}
.logo span, .logo-big span { color: var(--red); }
.logo svg { width: 26px; height: 26px; }
.topbar-actions { display: flex; gap: 8px; align-items: center; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); display: grid; place-items: center;
  cursor: pointer; font-size: 1.1rem; text-decoration: none;
}
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); text-decoration: none; margin-bottom: 12px; font-weight: 500; }

.splash { min-height: 80vh; display: grid; place-items: center; }
.logo-big { font-family: var(--font-title); font-weight: 800; font-size: 2.6rem; letter-spacing: -.03em; }

/* ---------- Cartes & sections ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; margin-bottom: 14px; box-shadow: var(--shadow);
}
.card.flat { box-shadow: none; }
.card.accent { border-color: var(--red); background: linear-gradient(180deg, var(--red-soft), transparent 70%), var(--surface); }
.section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 26px 0 10px; }
.section-title h2 { margin: 0; }

.list { display: flex; flex-direction: column; gap: 10px; }
.item {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--text);
}
.item:active { transform: scale(.99); }
.item .grow { flex: 1; min-width: 0; }
.item .title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .sub { color: var(--text-2); font-size: .85rem; }
.chev { color: var(--text-2); font-size: 1.2rem; }

.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 99px;
  font-size: .75rem; font-weight: 600; background: var(--surface-2); color: var(--text-2); white-space: nowrap;
}
.badge.red { background: var(--red); color: #fff; }
.badge.yellow { background: var(--yellow); color: var(--ink); }
.badge.green { background: rgba(80, 200, 120, .16); color: #4fc37a; }

.avatar {
  width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center;
  font-family: var(--font-title); font-weight: 800; background: var(--surface-2); color: var(--text);
}
.avatar.red { background: var(--red); color: #fff; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 8px 14px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface);
  color: var(--text); font: inherit; font-size: .9rem; cursor: pointer;
}
.chip.on { background: var(--red); border-color: var(--red); color: #fff; font-weight: 600; }

/* ---------- Formulaires ---------- */
label { display: block; font-weight: 600; margin: 14px 0 6px; font-size: .95rem; }
.hint { color: var(--text-2); font-size: .82rem; font-weight: 400; margin-top: 4px; }
input[type=text], input[type=email], input[type=password], select, textarea {
  width: 100%; padding: 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--text); font: inherit; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
textarea { min-height: 170px; resize: vertical; line-height: 1.5; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%), linear-gradient(135deg, var(--text-2) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; margin: 14px 0; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--red); flex: none; }
.counter { text-align: right; font-size: .8rem; color: var(--text-2); margin-top: 4px; }
.counter.over { color: var(--red); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 16px 20px; border-radius: 14px; border: none; cursor: pointer;
  font: inherit; font-weight: 700; font-size: 1rem; text-decoration: none;
  background: var(--red); color: #fff; margin-top: 14px; transition: transform .08s, opacity .2s;
}
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .5; cursor: default; }
.btn.ghost { background: var(--surface-2); color: var(--text); }
.btn.outline { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn.small { width: auto; padding: 10px 14px; font-size: .9rem; margin-top: 0; }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; }

.tabs { display: flex; background: var(--surface-2); border-radius: 12px; padding: 4px; margin-bottom: 8px; }
.tabs button { flex: 1; border: none; background: none; color: var(--text-2); padding: 10px; border-radius: 9px; font: inherit; font-weight: 600; cursor: pointer; }
.tabs button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

.error-box { background: var(--red-soft); color: var(--text); border: 1px solid var(--red); border-radius: 12px; padding: 12px 14px; margin-top: 12px; font-size: .92rem; }
.info-box { background: var(--surface-2); border-radius: 12px; padding: 12px 14px; font-size: .88rem; color: var(--text-2); margin-top: 12px; }
.demo-banner { background: var(--yellow); color: var(--ink); border-radius: 12px; padding: 10px 14px; font-size: .85rem; font-weight: 600; margin-bottom: 14px; }

/* ---------- Accueil ---------- */
.hero { padding: 30px 0 10px; }
.hero h1 { font-size: 2.4rem; }
.hero .stamp-demo {
  display: inline-block; font-family: var(--font-title); font-weight: 800; color: var(--red);
  border: 4px solid var(--red); border-radius: 12px; padding: 4px 14px; transform: rotate(-6deg);
  font-size: 1.6rem; letter-spacing: .04em; margin: 10px 0 20px;
}
.steps { counter-reset: s; list-style: none; padding: 0; margin: 18px 0; }
.steps li { counter-increment: s; display: flex; gap: 12px; margin-bottom: 12px; align-items: flex-start; }
.steps li::before {
  content: counter(s); flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--surface-2);
  display: grid; place-items: center; font-weight: 800; font-family: var(--font-title);
}

/* ---------- Juges ---------- */
.judges { display: grid; gap: 10px; }
.judge {
  display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: 14px; border: 2px solid var(--line);
  background: var(--surface); cursor: pointer; text-align: left; color: var(--text); font: inherit; width: 100%;
}
.judge.on { border-color: var(--red); background: var(--red-soft); }
.judge .jface { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-size: 1.5rem; background: var(--surface-2); flex: none; }
.judge strong { display: block; }
.judge span { color: var(--text-2); font-size: .85rem; }

/* ---------- Plaidoyer ---------- */
.plea-tools { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.mic.on { background: var(--red); color: #fff; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px var(--red-soft); } }
.thumbs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 10px; }
.thumb { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--surface-2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb button { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; border: none; background: rgba(0,0,0,.7); color: #fff; cursor: pointer; font-size: .8rem; }

.waiting-list .item { padding: 10px 14px; }
.deliberation { text-align: center; padding: 40px 10px; }
.gavel { font-size: 3rem; display: inline-block; animation: knock 1s infinite; transform-origin: 70% 70%; }
@keyframes knock { 0%, 60%, 100% { transform: rotate(0); } 30% { transform: rotate(-25deg); } }

/* ---------- Verdict ---------- */
.verdict-head { text-align: center; padding: 10px 0 4px; }
.verdict-head .case { font-family: var(--font-title); font-weight: 800; font-size: 1.6rem; margin: 6px 0; }
.stamp {
  display: inline-block; margin: 18px auto 6px; padding: 6px 18px; border: 5px solid var(--red); border-radius: 14px;
  color: var(--red); font-family: var(--font-title); font-weight: 800; font-size: 2.2rem; letter-spacing: .05em;
  transform: rotate(-7deg); animation: slam .45s cubic-bezier(.2, 1.6, .4, 1) both;
}
@keyframes slam { 0% { transform: rotate(-7deg) scale(2.4); opacity: 0; } 100% { transform: rotate(-7deg) scale(1); opacity: 1; } }
.coupable-name { font-family: var(--font-title); font-weight: 800; font-size: 1.5rem; }
.bars { margin: 18px 0 8px; display: flex; flex-direction: column; gap: 14px; }
.bar-row .bar-top { display: flex; justify-content: space-between; font-weight: 600; margin-bottom: 6px; }
.bar { height: 14px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--grey); border-radius: 99px; width: 0; transition: width 1s ease; }
.bar-row.guilty .bar i { background: var(--red); }
.bar-row .vanne { color: var(--text-2); font-size: .92rem; margin-top: 6px; font-style: italic; }
.quote {
  font-family: var(--font-title); font-weight: 800; font-size: 1.35rem; line-height: 1.25; margin: 6px 0;
}
.quote mark { background: var(--yellow); color: var(--ink); padding: 0 .15em; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.label { text-transform: uppercase; letter-spacing: .08em; font-size: .72rem; font-weight: 700; color: var(--text-2); margin-bottom: 6px; }

details { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin-bottom: 10px; }
details summary { cursor: pointer; font-weight: 600; }
details p { margin-top: 10px; white-space: pre-wrap; color: var(--text-2); }

.share-zone { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.share-zone .btn { margin-top: 0; }

/* ---------- Toast ---------- */
#toast {
  position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 20px); transform: translateX(-50%) translateY(150%);
  background: var(--text); color: var(--bg); padding: 12px 18px; border-radius: 12px; font-weight: 600; font-size: .92rem;
  transition: transform .3s; z-index: 50; max-width: 90vw; text-align: center;
}
#toast.show { transform: translateX(-50%) translateY(0); }

.spinner { width: 18px; height: 18px; border: 3px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

footer.foot { margin-top: 40px; text-align: center; font-size: .8rem; color: var(--text-2); }
footer.foot a { color: var(--text-2); }
