/* MEVQR — styles communs (couleurs, boutons, fenêtres, messages) */

:root {
  --terra: #B84A24;
  --terra-dark: #8E3518;
  --terra-soft: #FBE9DF;
  --ink: #2A1A12;
  --cream: #FFF8F3;
  --sand: #F7E6D8;
  --line: #EBD9CC;
  --muted: #6B5447;
  --saffron: #F2A33A;
  --green: #1F7A4D;
  --green-soft: #E3F2E8;
  --amber-soft: #FDF0D5;
  --red: #B42318;
  --white: #FFFFFF;
  --radius: 18px;
  --shadow: 0 2px 10px rgba(120, 60, 30, .08);
  --font-display: 'Bricolage Grotesque', system-ui, sans-serif;
  --font-body: 'Manrope', system-ui, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
}
img, video, svg { display: block; max-width: 100%; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.1; margin: 0; }
p { margin: 0; }
a { color: var(--terra); }
a:hover { color: var(--terra-dark); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--saffron); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* Boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border-radius: 14px; border: 1px solid transparent;
  font-weight: 700; font-size: 15px; text-decoration: none; cursor: pointer;
  transition: transform .12s ease, background .15s ease, opacity .15s ease;
}
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--terra); color: var(--white); }
.btn-primary:hover { background: var(--terra-dark); color: var(--white); }
.btn-dark { background: var(--ink); color: var(--white); }
.btn-dark:hover { background: #000; color: var(--white); }
.btn-ghost { background: var(--white); border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--muted); color: var(--ink); }
.btn-danger { background: var(--white); border-color: #F1C5C0; color: var(--red); }
.btn-sm { min-height: 44px; padding: 0 14px; font-size: 14px; border-radius: 12px; }
.btn-block { width: 100%; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--white); display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}

/* Champs */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .label { font-weight: 700; font-size: 14px; }
.hint { font-size: 13px; color: var(--muted); }
.input, .field input, .field select, .field textarea {
  width: 100%; min-height: 48px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--white); padding: 10px 14px; font-size: 16px;
}
.field textarea { min-height: 84px; resize: vertical; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 600; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--terra); }

/* Fenêtres (bas d'écran sur mobile) */
dialog.sheet {
  border: none; padding: 0; margin: auto auto 0; width: 100%; max-width: 560px;
  max-height: 92vh; border-radius: 28px 28px 0 0; background: var(--cream); color: var(--ink);
  overflow: auto; overscroll-behavior: contain;
}
dialog.sheet::backdrop { background: rgba(42, 26, 18, .55); }
dialog.sheet[open] { animation: sheet-up .25s ease-out; }
@media (min-width: 700px) {
  dialog.sheet { margin: auto; border-radius: 28px; }
}
@keyframes sheet-up { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
.sheet-close { position: absolute; top: 14px; right: 14px; z-index: 2; }

/* Messages */
#toast-zone {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 1000;
  display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px); pointer-events: none;
}
.toast {
  background: var(--ink); color: var(--white); padding: 12px 16px; border-radius: 14px;
  font-weight: 600; box-shadow: 0 10px 30px rgba(0,0,0,.25); transition: opacity .4s, transform .4s;
}
.toast-error { background: var(--red); }
.toast-ok { background: var(--green); }
.toast.out { opacity: 0; transform: translateY(8px); }

/* Médias des plats */
.media { position: relative; overflow: hidden; background: var(--sand); }
.media img, .media video { width: 100%; height: 100%; object-fit: cover; }
.media-art { display: flex; align-items: center; justify-content: center; }
.badge-video {
  position: absolute; left: 8px; top: 8px; display: inline-flex; align-items: center; gap: 4px;
  background: rgba(42, 26, 18, .82); color: var(--white); border-radius: 999px; padding: 3px 8px;
  font-size: 11px; font-weight: 700;
}
.dish-art .steam path { fill: none; stroke: #CDB8A8; stroke-width: 3; stroke-linecap: round; animation: steam 2.8s ease-in-out infinite; }
.dish-art .steam path:nth-child(2) { animation-delay: .9s; }
.dish-art .steam path:nth-child(3) { animation-delay: 1.8s; }
@keyframes steam { 0% { transform: translateY(6px); opacity: 0; } 40% { opacity: .9; } 100% { transform: translateY(-10px); opacity: 0; } }

.spinner {
  width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--terra);
  animation: spin .8s linear infinite; margin: 40px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.demo-ribbon {
  background: var(--ink); color: var(--white); text-align: center; font-size: 13px; font-weight: 700; padding: 6px 12px;
}
.demo-ribbon a { color: var(--saffron); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
