/* Retex Trans — style mobile d'abord (repris du prototype validé) */

@font-face { font-family: "Barlow"; font-weight: 400; font-display: swap; src: url("/fonts/barlow-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-display: swap; src: url("/fonts/barlow-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-display: swap; src: url("/fonts/barlow-condensed-latin-700-normal.woff2") format("woff2"); }

:root {
  --bg: #eef1f4; --surface: #ffffff; --ink: #14202b; --muted: #5d6b78; --line: #d5dce3;
  --accent: #0f5e6e; --accent-ink: #ffffff; --tape: #f2c230; --tape-ink: #2a2100; --danger: #b3261e;
  --display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --body: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f161d; --surface: #18222c; --ink: #e6edf3; --muted: #93a2b0; --line: #2b3a47;
    --accent: #4fb3c4; --accent-ink: #06222a; --danger: #f2867d;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg); color: var(--ink);
  font-family: var(--body); font-size: 16px; line-height: 1.45;
  -webkit-text-size-adjust: 100%;
}
body::before {
  content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px);
  z-index: 10; background: #14202b;
}

/* En-tête */
header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5;
  background: #14202b; color: #eef1f4;
  padding: 12px max(16px, env(safe-area-inset-right, 0px)) 12px max(16px, env(safe-area-inset-left, 0px));
}
.hrow { max-width: 620px; margin: 0 auto; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.brand { font-family: var(--display); font-weight: 700; font-size: 26px; letter-spacing: .02em; text-transform: uppercase; line-height: 1; }
.brand span { background: var(--tape); color: var(--tape-ink); padding: 0 6px; margin-left: 4px; }
.edition { font-size: 13px; opacity: .75; letter-spacing: .04em; }

main {
  max-width: 620px; margin: 0 auto;
  padding: 18px max(16px, env(safe-area-inset-right, 0px)) calc(110px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
}
.centre { text-align: center; padding-top: 18vh; }
.centre .btn { margin-top: 8px; }

h2 { font-family: var(--display); font-weight: 700; font-size: 22px; text-transform: uppercase; letter-spacing: .03em; margin: 0 0 4px; }
.sub { color: var(--muted); margin: 0 0 18px; font-size: 15px; }

/* Formulaire */
form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 420px) { .two { grid-template-columns: 1fr; } }

label, .label { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.req { color: var(--danger); }
.compte { text-transform: none; letter-spacing: 0; font-weight: 400; }

input[type=text], select, textarea {
  width: 100%; font: inherit; font-size: 17px; color: var(--ink); background: var(--surface);
  border: 1.5px solid var(--line); border-radius: 8px; padding: 12px; min-height: 50px;
  appearance: none; -webkit-appearance: none;
}
select {
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%;
  background-size: 6px 6px; background-repeat: no-repeat; padding-right: 36px;
}
select:disabled { opacity: .55; }
textarea { min-height: 130px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
}
[aria-invalid="true"] { border-color: var(--danger) !important; }
.hint { font-size: 13px; color: var(--muted); }

/* Photos */
.photos { display: flex; flex-wrap: wrap; gap: 10px; }
.addphoto {
  position: relative; width: 88px; height: 88px; border: 1.5px dashed var(--muted); border-radius: 8px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer; text-transform: none; letter-spacing: 0;
}
.addphoto:focus-within { outline: 3px solid var(--accent); }
.addphoto svg { width: 26px; height: 26px; }
.addphoto input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.addphoto.occupe { opacity: .5; pointer-events: none; }
.thumb { position: relative; width: 88px; height: 88px; border-radius: 8px; overflow: hidden; background: var(--line); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb button {
  position: absolute; top: 2px; right: 2px; width: 32px; height: 32px; border-radius: 50%; border: 0;
  background: rgba(0, 0, 0, .65); color: #fff; font-size: 18px; line-height: 1; cursor: pointer;
}

/* Boutons */
.btn {
  font: inherit; font-family: var(--display); font-weight: 700; font-size: 20px; text-transform: uppercase; letter-spacing: .05em;
  border: 0; border-radius: 8px; min-height: 56px; padding: 0 20px; cursor: pointer;
  background: var(--accent); color: var(--accent-ink);
}
.btn:disabled { opacity: .6; cursor: progress; }
.btn:focus-visible, .tab:focus-visible { outline: 3px solid var(--tape); outline-offset: 2px; }

/* Message temporaire */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(84px + env(safe-area-inset-bottom, 0px));
  background: var(--ink); color: var(--bg);
  padding: 12px 18px; border-radius: 8px; font-weight: 600; z-index: 20; max-width: calc(100% - 32px);
}
@media (prefers-reduced-motion: no-preference) {
  .toast { animation: monte .25s ease-out; }
  @keyframes monte { from { transform: translate(-50%, 10px); opacity: 0; } }
}

/* Onglets en bas */
nav.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6;
  background: var(--surface); border-top: 1px solid var(--line);
  padding: 0 env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
}
.tabrow { max-width: 620px; margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); }
.tab {
  font: inherit; font-weight: 600; font-size: 14px; background: none; border: 0; color: var(--muted);
  padding: 10px 0 12px; min-height: 56px; display: flex; flex-direction: column; align-items: center; gap: 3px;
  cursor: pointer; position: relative;
}
.tab svg { width: 24px; height: 24px; }
.tab[aria-selected="true"] { color: var(--accent); }
.tab[aria-selected="true"]::before {
  content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 3px;
  background: var(--accent); border-radius: 0 0 3px 3px;
}

/* Cartes (aide, mes retex) */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 14px; margin-bottom: 12px; min-width: 0;
}
.card h3 { margin: 0 0 6px; font-size: 18px; font-weight: 600; }
.card p { margin: 0; }
.card ol { margin: 0; padding-left: 22px; }
.card li + li { margin-top: 4px; }
.empty { color: var(--muted); text-align: center; padding: 30px 0; }

/* Mes retex */
.where { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 6px; }
.tag {
  font-family: var(--display); font-weight: 700; font-size: 15px; text-transform: uppercase; letter-spacing: .04em;
  background: var(--tape); color: var(--tape-ink); padding: 1px 8px; border-radius: 3px;
}
.tag.lieu { background: transparent; color: var(--ink); border: 1.5px solid var(--ink); }
.card h3 { overflow-wrap: anywhere; line-height: 1.3; }
.card .texte { overflow-wrap: anywhere; white-space: pre-wrap; margin-bottom: 6px; }
.meta { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.attente {
  font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: var(--danger); border: 1.5px solid currentColor; border-radius: 3px; padding: 0 6px; margin-left: auto;
}

/* Bandeaux d'état (file d'attente, mise à jour) */
.bandeau {
  position: sticky; top: calc(env(safe-area-inset-top, 0px) + 50px); z-index: 4;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px max(16px, env(safe-area-inset-right, 0px)) 8px max(16px, env(safe-area-inset-left, 0px));
  font-weight: 600; font-size: 15px;
}
.bandeau.file { background: var(--tape); color: var(--tape-ink); }
.bandeau.maj { background: var(--accent); color: var(--accent-ink); }
.bandeau button {
  font: inherit; font-weight: 700; min-height: 40px; padding: 0 14px; border-radius: 6px; cursor: pointer;
  border: 2px solid currentColor; background: transparent; color: inherit; flex: none;
}
.bandeau button:disabled { opacity: .6; cursor: progress; }
