/* Déclic — socle commun : papier chaud, encre noire, touches franches qui s'enfoncent. */

@font-face {
  font-family: 'Bricolage';
  src: url('/fonts/bricolage-grotesque-latin-wght-normal.woff2') format('woff2-variations');
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Bricolage';
  src: url('/fonts/bricolage-grotesque-latin-ext-wght-normal.woff2') format('woff2-variations');
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F,
    U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --paper: #faf5ea;
  --paper-deep: #efe7d4;
  --card: #fffdf8;
  --ink: #17141c;
  --ink-soft: #57515f;
  --ink-faint: #8b8494;
  --accent: #ff5a36;
  --good: #1fa971;
  --good-soft: #c5f1da;
  --bad: #e5484d;
  --bad-soft: #ffd5d1;
  --warn-soft: #ffe7a3;

  /* Une couleur par réponse, toujours accompagnée de sa lettre. */
  --opt-0: #8ec5ff;
  --opt-1: #ffa987;
  --opt-2: #86e3b4;
  --opt-3: #ffd84d;
  --opt-4: #cdb0ff;
  --opt-5: #ff9fd0;

  --line: 2.5px;
  --border: var(--line) solid var(--ink);
  --radius: 16px;
  --press: 4px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --font: 'Bricolage', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  color-scheme: light;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.45;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1,
h2,
h3 {
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

input,
textarea,
select {
  font-size: 16px; /* en dessous, iOS zoome sur le champ */
}

button,
a,
[role='button'] {
  touch-action: manipulation;
}

button {
  user-select: none;
  -webkit-user-select: none;
}

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.num {
  font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------- logo */

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.045em;
  line-height: 1;
  color: var(--ink);
  text-decoration: none;
}

.logo svg {
  width: 0.95em;
  height: 0.95em;
  fill: var(--accent);
  stroke: var(--ink);
  stroke-width: 1.6;
  stroke-linejoin: round;
}

/* ------------------------------------------------------------- boutons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  min-height: 48px;
  padding: 0.7em 1.2em;
  border: var(--border);
  border-radius: 14px;
  background: var(--card);
  color: var(--ink);
  font-weight: 700;
  line-height: 1.1;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 var(--press) 0 var(--ink);
  transition:
    transform 110ms var(--ease-out),
    box-shadow 110ms var(--ease-out),
    background-color 140ms;
}

.btn:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--ink);
}

.btn:disabled {
  cursor: not-allowed;
  background: var(--paper-deep);
  color: var(--ink-faint);
  border-color: var(--ink-faint);
  box-shadow: 0 var(--press) 0 var(--ink-faint);
}

.btn--primary {
  background: var(--accent);
}

.btn--ink {
  background: var(--ink);
  color: var(--paper);
  box-shadow: 0 var(--press) 0 #4a4553;
}

.btn--ink:active:not(:disabled) {
  box-shadow: 0 1px 0 #4a4553;
}

.btn--ghost {
  background: transparent;
  box-shadow: none;
  border-color: transparent;
  min-height: 40px;
  padding: 0.45em 0.8em;
  font-weight: 600;
}

.btn--ghost:active:not(:disabled) {
  transform: scale(0.97);
  box-shadow: none;
  background: var(--paper-deep);
}

.btn--small {
  min-height: 38px;
  padding: 0.4em 0.85em;
  font-size: 0.92rem;
  border-radius: 11px;
  --press: 3px;
}

.btn--big {
  min-height: 60px;
  padding: 0.8em 1.6em;
  font-size: 1.2rem;
  border-radius: 18px;
  --press: 5px;
}

.btn--block {
  display: flex;
  width: 100%;
}

.btn--danger {
  background: var(--bad-soft);
}

@media (hover: hover) and (pointer: fine) {
  .btn:hover:not(:disabled):not(:active) {
    transform: translateY(-1px);
    box-shadow: 0 calc(var(--press) + 1px) 0 var(--ink);
  }
  .btn--ink:hover:not(:disabled):not(:active) {
    box-shadow: 0 calc(var(--press) + 1px) 0 #4a4553;
  }
  .btn--ghost:hover:not(:disabled):not(:active) {
    transform: none;
    box-shadow: none;
    background: var(--paper-deep);
  }
}

/* -------------------------------------------------------------- champs */

.field {
  display: grid;
  gap: 0.4rem;
}

.field > span,
.label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink-soft);
}

.input {
  width: 100%;
  min-height: 48px;
  padding: 0.6em 0.85em;
  border: var(--border);
  border-radius: 12px;
  background: var(--card);
  transition: box-shadow 140ms var(--ease-out);
}

.input::placeholder {
  color: var(--ink-faint);
}

.input:focus {
  outline: none;
  box-shadow: 0 0 0 4px var(--opt-3);
}

textarea.input {
  resize: vertical;
  line-height: 1.4;
}

select.input {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2.2em;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2317141c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85em center;
  background-size: 12px 8px;
}

/* ------------------------------------------------------------- divers */

.card {
  background: var(--card);
  border: var(--border);
  border-radius: var(--radius);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  padding: 0.25em 0.7em;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--card);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
}

.badge[data-type='single'] {
  background: var(--opt-0);
}
.badge[data-type='multiple'] {
  background: var(--opt-4);
}
.badge[data-type='speed'] {
  background: var(--opt-3);
}
.badge[data-type='open'] {
  background: var(--opt-2);
}
.badge[data-type='poll'] {
  background: var(--opt-5);
}

.letter {
  display: grid;
  place-items: center;
  flex: none;
  width: 1.9em;
  height: 1.9em;
  border: 2px solid var(--ink);
  border-radius: 9px;
  background: var(--card);
  font-weight: 800;
  line-height: 1;
}

.muted {
  color: var(--ink-soft);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
  }
}
