/* Régie Promos LuxTruffe — téléphone d'abord, une colonne, gros boutons. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body, h1, h2, p, ol, figure, fieldset { margin: 0; }
ol { padding: 0; list-style: none; }
fieldset { border: 0; padding: 0; min-width: 0; }
img { display: block; max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

:root {
  --bg: #f6f2ea; --card: #fffdf8; --ink: #1d1a16; --muted: #6b6359; --line: #d9d0c2;
  --gold: #8a6a2f; --gold-ink: #fff; --focus: #2f5fbf;
  --ok-bg: #e3f1e4; --ok: #1f5d2a; --warn-bg: #fbefd5; --warn: #7a4e00;
  --err-bg: #fbe3e1; --err: #9b1c13; --off-bg: #ebe7e0; --off: #4f4a43; --plan-bg: #e2eaf7; --plan: #1f437e;
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15130f; --card: #1f1c17; --ink: #f1ebe0; --muted: #b3a998; --line: #3a352c;
    --gold: #c9a35a; --gold-ink: #15130f; --focus: #8fb2ff;
    --ok-bg: #1d3a22; --ok: #b9e6c0; --warn-bg: #3d2f12; --warn: #f3d28c;
    --err-bg: #43201c; --err: #ffc3bc; --off-bg: #2d2a25; --off: #d6cfc4; --plan-bg: #1c2b45; --plan: #c4d6ff;
  }
}

body {
  background: var(--bg); color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px; line-height: 1.5;
}
h1 { font-size: 1.5rem; line-height: 1.2; }
h2 { font-size: 1.05rem; margin-top: .5rem; }
em { font-style: normal; color: var(--muted); font-weight: 400; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.wrap { max-width: 640px; margin: 0 auto; padding: 16px 16px 96px; }
.stack > * + * { margin-top: 16px; }
.hint, .field__help { color: var(--muted); font-size: .9rem; }
.empty { padding: 24px 0; color: var(--muted); }

.brand { font-weight: 700; letter-spacing: .02em; }
.brand span { font-weight: 400; color: var(--muted); }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; background: var(--card); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}

/* Boutons : 48 px de haut au moins (cible tactile). */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 48px; padding: 10px 18px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--card); cursor: pointer;
  font-weight: 600; text-decoration: none; touch-action: manipulation;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn--primary { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }
.btn--secondary { border-color: var(--gold); color: var(--ink); }
.btn--danger { background: var(--err); border-color: var(--err); color: #fff; }
.btn--ghost { background: transparent; }
.btn--small { min-height: 44px; padding: 8px 12px; font-size: .95rem; }
.btn--block { width: 100%; }
.btn--icon { min-width: 48px; padding: 8px; }

/* Formulaire : 16 px minimum, sinon iOS zoome à la saisie. */
.field { display: block; }
.field__label { display: block; font-weight: 600; margin-bottom: 6px; }
.field input:not([type=checkbox]):not([type=file]), .field select, .field textarea {
  display: block; width: 100%; min-height: 48px; padding: 10px 12px; font-size: 16px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
}
.field textarea { resize: vertical; min-height: 120px; }
.field [aria-invalid=true] { border-color: var(--err); box-shadow: 0 0 0 2px var(--err-bg); }
.field__count { display: block; text-align: right; font-size: .8rem; color: var(--muted); }
.field__count.is-over { color: var(--err); font-weight: 700; }
.field--check { display: flex; align-items: center; gap: 12px; padding: 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); font-weight: 600; }
.field--check input { width: 26px; height: 26px; flex: none; accent-color: var(--gold); }
.field-group { padding: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.field-group > * + * { margin-top: 12px; }
.field-group legend { font-weight: 700; padding: 0 4px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row > .field + .field { margin-top: 0; }
.upload { position: relative; overflow: hidden; }
.upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
.upload:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.preview img { border-radius: var(--radius); max-height: 320px; width: 100%; object-fit: cover; background: var(--off-bg); }
.preview figcaption { margin-top: 8px; }
.translations { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.translations summary { cursor: pointer; font-weight: 700; min-height: 32px; }
.translations[open] summary { margin-bottom: 12px; }
.actions > * + * { margin-top: 10px; }

.alert { padding: 12px 14px; border-radius: var(--radius); }
.alert--error { background: var(--err-bg); color: var(--err); }
.alert ul { margin: 6px 0 0; padding-left: 20px; }

/* Liste */
.list-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.offers { margin-top: 16px; }
.offer { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.offer + .offer { margin-top: 12px; }
.offer.is-focus { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold); }
.offer__top { display: flex; gap: 12px; }
.offer__thumb { width: 72px; height: 72px; flex: none; border-radius: 8px; object-fit: cover; background: var(--off-bg); }
.offer__body { min-width: 0; flex: 1; }
.offer__title { font-weight: 700; overflow-wrap: anywhere; }
.offer__meta { color: var(--muted); font-size: .9rem; }
.offer__tools { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.offer__tools .btn { padding: 8px 6px; font-size: .9rem; }
.offer__tools .span-2 { grid-column: span 2; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 700; margin-right: 6px; }
.pill--active { background: var(--ok-bg); color: var(--ok); }
.pill--inactive { background: var(--off-bg); color: var(--off); }
.pill--scheduled { background: var(--plan-bg); color: var(--plan); }
.pill--expired { background: var(--warn-bg); color: var(--warn); }

/* Bandeau de publication, collé sous la barre du haut */
.publish { position: sticky; top: 65px; z-index: 4; padding: 10px 16px; font-size: .95rem; text-align: center; }
.publish.is-building { background: var(--plan-bg); color: var(--plan); }
.publish.is-ok { background: var(--ok-bg); color: var(--ok); }
.publish.is-error { background: var(--err-bg); color: var(--err); text-align: left; }
.toast {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 10; max-width: 608px; margin: 0 auto;
  padding: 14px 16px; border-radius: var(--radius); background: var(--ink); color: var(--bg);
  box-shadow: 0 6px 24px rgba(0,0,0,.25);
}
.toast.is-error { background: var(--err); color: #fff; }

.dialog { border: 0; border-radius: var(--radius); padding: 20px; max-width: min(92vw, 420px); background: var(--card); color: var(--ink); }
.dialog::backdrop { background: rgba(0,0,0,.45); }

.page-login .login { max-width: 400px; margin: 0 auto; padding: 48px 16px; }
.page-login .login > * + * { margin-top: 16px; }

@media (min-width: 720px) {
  .wrap { padding-top: 24px; }
  .offer__tools { grid-template-columns: repeat(7, auto); justify-content: start; }
  .offer__tools .span-2 { grid-column: auto; }
}
@media (prefers-reduced-motion: no-preference) {
  .btn { transition: background-color .15s, border-color .15s; }
}
