@font-face { font-family: "Bricolage Grotesque"; font-style: normal; font-weight: 200 800; font-display: swap; src: url("/fonts/bricolage-grotesque.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 600; font-display: swap; src: url("/fonts/ibm-plex-mono-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Saira Stencil One"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/saira-stencil-one.woff2") format("woff2"); }
/* Idée de mise en page : à gauche le bureau (la question, le formulaire à l'encre bleue),
   à droite l'objet : un ticket de caisse sur lequel tombe le coup de tampon du verdict. */
:root {
  --desk: #DCE3EF;
  --grid: #CCD6E7;
  --ink: #131B3A;
  --ink-soft: #4A557A;
  --bille: #1B3BD1;
  --on-bille: #FFFFFF;
  --field: #F5F7FC;
  --line: #B4C0DA;
  --paper: #FCFBF6;
  --paper-ink: #1C1C22;
  --paper-soft: #66666E;
  --paper-line: #C6C4BA;
  --ok: #0B7A48;
  --warn: #B45F06;
  --no: #C1272D;
  --flou: #3B4C8A;
  --shadow: 19 27 58;
  --display: "Bricolage Grotesque", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --stamp: "Saira Stencil One", Impact, "Arial Black", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --desk: #0E1326;
    --grid: #161D36;
    --ink: #E8ECF8;
    --ink-soft: #9CA7C9;
    --bille: #93A8FF;
    --on-bille: #0E1326;
    --field: #161D36;
    --line: #313C66;
    --paper: #EFEDE4;
    --shadow: 0 0 0;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --desk: #0E1326;
  --grid: #161D36;
  --ink: #E8ECF8;
  --ink-soft: #9CA7C9;
  --bille: #93A8FF;
  --on-bille: #0E1326;
  --field: #161D36;
  --line: #313C66;
  --paper: #EFEDE4;
  --shadow: 0 0 0;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background-color: var(--desk);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 26px 26px;
  color: var(--ink);
  font-family: var(--display);
  font-size: 17px;
  line-height: 1.5;
}
.page {
  max-width: 1140px;
  margin: 0 auto;
  padding: clamp(28px, 6vw, 72px) clamp(18px, 4vw, 40px) 48px;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: clamp(32px, 6vw, 80px);
  align-items: start;
}
@media (max-width: 880px) {
  .page { grid-template-columns: minmax(0, 1fr); }
}

/* ——— Colonne gauche ——— */
.ask { display: flex; flex-direction: column; gap: 30px; min-width: 0; }
h1 {
  margin: 0;
  font-size: clamp(2.7rem, 7.2vw, 5rem);
  font-weight: 800;
  line-height: 0.92;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
h1 .q { color: var(--bille); }
.lede {
  margin: 0;
  max-width: 34em;
  font-size: 1.12rem;
  color: var(--ink-soft);
}
form { display: flex; flex-direction: column; gap: 24px; }
.step { display: flex; flex-direction: column; gap: 9px; min-width: 0; border: 0; padding: 0; margin: 0; }
.step > label, .step > legend {
  display: flex; align-items: baseline; gap: 10px;
  padding: 0;
  font-weight: 700; font-size: 1.02rem;
}
.num {
  font-family: var(--mono); font-weight: 600; font-size: 0.8rem;
  color: var(--bille);
}
select, textarea, input[type="text"] {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background-color: var(--field);
  border: 1.5px solid var(--line);
  border-radius: 6px;
  padding: 13px 14px;
}
select {
  appearance: none; -webkit-appearance: none;
  padding-right: 44px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--bille) 50%),
    linear-gradient(135deg, var(--bille) 50%, transparent 50%);
  background-position: calc(100% - 22px) 55%, calc(100% - 15px) 55%;
  background-size: 7px 7px;
  background-repeat: no-repeat;
  cursor: pointer;
}
textarea { resize: vertical; min-height: 96px; line-height: 1.4; }
::placeholder { color: var(--ink-soft); opacity: 0.75; }
select:focus-visible, textarea:focus-visible, input:focus-visible,
button:focus-visible, .seg input:focus-visible + span {
  outline: 3px solid var(--bille);
  outline-offset: 2px;
}
#autre-wrap[hidden] { display: none; }

.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span {
  display: block;
  padding: 9px 14px;
  border: 1.5px solid var(--line);
  border-radius: 6px;
  background: var(--field);
  font-weight: 500; font-size: 0.97rem;
}
.seg input:checked + span {
  background: var(--ink); color: var(--desk); border-color: var(--ink);
}

.ideas { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ideas-label { font-family: var(--mono); font-size: 0.74rem; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.06em; }
.idea {
  font: inherit; font-size: 0.9rem;
  color: var(--bille);
  background: transparent;
  border: 0; border-bottom: 1.5px dashed var(--bille);
  padding: 1px 0;
  cursor: pointer;
  text-align: left;
}
.idea:hover { border-bottom-style: solid; }

.go-row { display: flex; flex-wrap: wrap; gap: 14px 18px; align-items: center; }
.go {
  font: inherit; font-weight: 800; font-size: 1.15rem; letter-spacing: -0.01em;
  color: var(--on-bille);
  background: var(--bille);
  border: 0; border-radius: 6px;
  padding: 15px 26px;
  cursor: pointer;
  box-shadow: 0 3px 0 rgb(var(--shadow) / 0.55);
  transition: transform 0.08s, box-shadow 0.08s;
}
.go:hover { transform: translateY(-1px); box-shadow: 0 4px 0 rgb(var(--shadow) / 0.55); }
.go:active { transform: translateY(2px); box-shadow: 0 1px 0 rgb(var(--shadow) / 0.55); }
.go[disabled] { opacity: 0.6; cursor: progress; transform: none; }
.cancel {
  font: inherit; font-size: 0.95rem; color: var(--ink-soft);
  background: none; border: 0; padding: 4px 0; cursor: pointer; text-decoration: underline;
}
.cancel[hidden] { display: none; }
.msg {
  margin: 0; min-height: 1.4em;
  font-size: 0.95rem; font-weight: 500; color: var(--ink);
}
.msg:empty { display: none; }
.fine a { color: inherit; }
.frequentes { margin: 0; font-size: 0.95rem; font-weight: 600; }
.frequentes a { color: var(--bille); text-underline-offset: 3px; }
.fine {
  margin: 0; max-width: 40em;
  font-size: 0.84rem; color: var(--ink-soft);
  border-top: 1.5px solid var(--line); padding-top: 16px;
}

/* ——— Le ticket ——— */
.ticket-col { min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.ticket-shadow {
  width: 100%; max-width: 430px;
  filter: drop-shadow(0 18px 22px rgb(var(--shadow) / 0.22)) drop-shadow(0 2px 3px rgb(var(--shadow) / 0.18));
  transform: rotate(1.1deg);
}
@media (max-width: 880px) { .ticket-shadow { transform: none; } }
.ticket {
  --z: 9px;
  background: var(--paper);
  color: var(--paper-ink);
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.5;
  padding: 26px 24px calc(22px + var(--z));
  -webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / calc(2 * var(--z)) 100%;
  mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / calc(2 * var(--z)) 100%;
  display: flex; flex-direction: column; gap: 14px;
  overflow-wrap: anywhere;
}
.t-head { text-align: center; display: flex; flex-direction: column; gap: 2px; }
.t-title { font-weight: 600; font-size: 1.05rem; letter-spacing: 0.22em; text-indent: 0.22em; }
.t-sub { color: var(--paper-soft); font-size: 0.74rem; font-variant-numeric: tabular-nums; }
.t-tag {
  align-self: center; margin-top: 6px;
  font-size: 0.68rem; font-weight: 600; letter-spacing: 0.14em;
  padding: 2px 8px; border: 1px solid var(--paper-ink);
}
.t-rule { border: 0; border-top: 1.5px dashed var(--paper-line); margin: 0; }
.t-meta { margin: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 14px; }
.t-meta dt { color: var(--paper-soft); text-transform: uppercase; font-size: 0.72rem; letter-spacing: 0.06em; padding-top: 1px; }
.t-meta dd { margin: 0; text-align: right; }
.t-meta dd.dep { font-weight: 500; }

.stamp-zone { display: flex; justify-content: center; padding: 14px 0 10px; }
.stamp {
  --c: var(--ok);
  display: inline-flex; flex-direction: column; align-items: center; gap: 2px;
  color: var(--c);
  border: 4px solid var(--c);
  outline: 1.5px solid var(--c); outline-offset: 3px;
  border-radius: 8px;
  padding: 8px 18px 7px;
  transform: rotate(-6deg);
  filter: url(#encre);
  mix-blend-mode: multiply;
  text-align: center;
}
.stamp[data-v="conditions"] { --c: var(--warn); }
.stamp[data-v="non"] { --c: var(--no); transform: rotate(5deg); }
.stamp[data-v="non"] b { font-size: clamp(1.35rem, 5.6vw, 1.95rem); }
.stamp[data-v="flou"] { --c: var(--flou); transform: rotate(-3deg); }
.stamp b {
  font-family: var(--stamp); font-weight: 400;
  font-size: clamp(1.7rem, 7vw, 2.35rem); line-height: 1; letter-spacing: 0.03em;
  text-transform: uppercase;
}
.stamp small { font-family: var(--mono); font-size: 0.64rem; font-weight: 600; letter-spacing: 0.16em; }
.stamp.slam { animation: slam 0.42s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes slam {
  0% { opacity: 0; scale: 2.4; }
  55% { opacity: 1; scale: 0.94; }
  100% { opacity: 1; scale: 1; }
}
.t-phrase {
  margin: 0; text-align: center;
  font-family: var(--display); font-weight: 700; font-size: 1.12rem; line-height: 1.25;
  text-wrap: balance;
}
.t-block { display: flex; flex-direction: column; gap: 4px; }
.t-block h2 {
  margin: 0; font: inherit; font-weight: 600; font-size: 0.72rem;
  text-transform: uppercase; letter-spacing: 0.1em; color: var(--paper-soft);
}
.t-block p { margin: 0; }
.t-block ol { margin: 0; padding: 0; list-style: none; counter-reset: c; display: flex; flex-direction: column; gap: 5px; }
.t-block li { counter-increment: c; display: grid; grid-template-columns: 2.2em minmax(0, 1fr); }
.t-block li::before { content: counter(c, decimal-leading-zero); color: var(--paper-soft); }
.t-foot { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.barcode {
  width: 70%; height: 34px;
  background: repeating-linear-gradient(90deg,
    var(--paper-ink) 0 2px, transparent 2px 5px, var(--paper-ink) 5px 6px, transparent 6px 9px,
    var(--paper-ink) 9px 12px, transparent 12px 14px, var(--paper-ink) 14px 15px, transparent 15px 19px);
}
.t-foot p { margin: 0; font-size: 0.7rem; color: var(--paper-soft); }
.t-foot p.t-url { font-size: 0.82rem; font-weight: 600; letter-spacing: 0.12em; color: var(--paper-ink); }

/* Impression en cours */
.printing { display: flex; flex-direction: column; gap: 10px; padding: 18px 0 8px; }
.printing .now { font-weight: 600; text-align: center; min-height: 1.5em; }
.printing .now::after { content: "▍"; animation: blink 0.9s steps(2) infinite; margin-left: 2px; }
@keyframes blink { 50% { opacity: 0; } }
.feed { display: flex; flex-direction: column; gap: 9px; }
.feed i { display: block; height: 9px; background: var(--paper-line); opacity: 0.55; animation: feed 1.3s ease-in-out infinite; }
.feed i:nth-child(1) { width: 92%; }
.feed i:nth-child(2) { width: 78%; animation-delay: 0.15s; }
.feed i:nth-child(3) { width: 85%; animation-delay: 0.3s; }
.feed i:nth-child(4) { width: 52%; animation-delay: 0.45s; }
@keyframes feed { 50% { opacity: 0.2; } }

.ticket-actions { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; }
.link {
  font: inherit; font-size: 0.92rem; font-weight: 500; color: var(--ink);
  background: none; border: 0; padding: 4px 0; cursor: pointer;
  border-bottom: 1.5px solid var(--bille);
}
.link[hidden] { display: none; }

@media (prefers-reduced-motion: reduce) {
  .stamp.slam, .feed i, .printing .now::after { animation: none; }
  .go { transition: none; }
}
