/* GÉOTOP RDV — interface sobre, très contrastée, lisible en extérieur, utilisable d'une main. */
:root {
  --rouge: #E2001A;
  --rouge-fonce: #B00014;
  --gris: #3E393D;
  --gris-clair: #F2F1F2;
  --bord: #CFCBCE;
  --texte: #1A1719;
  --muet: #5E585C;
  --vert: #0B7A3B;
  --orange: #9A5B00;
  --fond: #FFFFFF;
  --rayon: 12px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--fond); color: var(--texte);
  font: 18px/1.45 Arial, Helvetica, sans-serif;
  padding-bottom: env(safe-area-inset-bottom);
}
main { max-width: 760px; margin: 0 auto; padding: 16px 16px 96px; }
h1 { font-size: 1.45rem; margin: .4em 0 .6em; color: var(--gris); }
h2 { font-size: 1.15rem; margin: 1.4em 0 .5em; color: var(--gris); border-bottom: 3px solid var(--rouge); padding-bottom: 4px; }
a { color: var(--rouge-fonce); }
.muted { color: var(--muet); }
.center { text-align: center; }
.small { font-size: .85rem; }
[hidden] { display: none !important; }

.topbar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between;
  background: var(--gris); color: #fff; padding: 8px 16px; padding-top: max(8px, env(safe-area-inset-top));
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: bold; }
.brand img { border-radius: 4px; }
.net { font-size: .85rem; padding: 4px 10px; border-radius: 99px; background: rgba(255,255,255,.15); }
.net.off { background: #FFD9DD; color: var(--rouge-fonce); font-weight: bold; }
.banner { background: #FFF4D6; color: #5A3B00; border-bottom: 2px solid #E8B400; padding: 12px 16px; font-weight: bold; }
.banner.err { background: #FFE3E6; color: var(--rouge-fonce); border-color: var(--rouge); }

/* Boutons : grands, faciles à toucher */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%;
  min-height: 56px; padding: 12px 18px; margin: 10px 0; border: 2px solid var(--gris); border-radius: var(--rayon);
  background: #fff; color: var(--gris); font: bold 1.05rem Arial, sans-serif; text-decoration: none; cursor: pointer;
  touch-action: manipulation;
}
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--rouge); border-color: var(--rouge); color: #fff; }
.btn.dark { background: var(--gris); color: #fff; }
.btn.big { min-height: 72px; font-size: 1.25rem; }
.btn.small { min-height: 44px; width: auto; display: inline-flex; padding: 6px 14px; margin: 4px 6px 4px 0; font-size: .95rem; }
.btn.danger { border-color: var(--rouge); color: var(--rouge-fonce); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }

/* Formulaires */
label { display: block; font-weight: bold; margin: 14px 0 6px; color: var(--gris); }
input[type=text], input[type=password], input[type=date], input[type=time], select, textarea {
  width: 100%; min-height: 52px; padding: 10px 12px; border: 2px solid var(--bord); border-radius: 10px;
  font: 1.05rem Arial, sans-serif; color: var(--texte); background: #fff;
}
input:focus, select:focus, textarea:focus { outline: 3px solid var(--rouge); outline-offset: 1px; border-color: var(--gris); }
textarea { min-height: 96px; resize: vertical; }
.hint { font-size: .85rem; color: var(--muet); margin-top: 4px; }
.error { color: var(--rouge-fonce); font-weight: bold; }
.card { border: 2px solid var(--bord); border-radius: var(--rayon); padding: 12px 14px; margin: 10px 0; background: #fff; }
.card.accent { border-color: var(--rouge); }
.line { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: end; margin-bottom: 8px; }
.line.interloc { grid-template-columns: 1.4fr 1fr auto; }
.line .btn.small { margin: 0; min-height: 52px; }
.line .full { grid-column: 1 / -1; }
.spacer { flex: 1; }
.fixed-person { padding: 10px 12px; background: var(--gris-clair); border-radius: 10px; margin-bottom: 8px; }

.consent {
  display: flex; gap: 14px; align-items: flex-start; border: 3px solid var(--rouge); border-radius: var(--rayon);
  padding: 14px; margin: 22px 0 8px; font-weight: bold; color: var(--texte);
}
.consent input { width: 32px; height: 32px; flex: none; accent-color: var(--rouge); margin: 0; }
.consent.ok { border-color: var(--vert); }

/* Écran d'enregistrement */
.recbox { text-align: center; border: 3px solid var(--gris); border-radius: 16px; padding: 14px; margin-bottom: 14px; }
.recbox.on { border-color: var(--rouge); }
.chrono { font: bold 3.2rem/1.1 "Arial", monospace; font-variant-numeric: tabular-nums; color: var(--gris); }
.recstate { font-weight: bold; margin-top: 4px; }
.dot { display: inline-block; width: 14px; height: 14px; border-radius: 50%; background: var(--rouge); margin-right: 6px; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .2; } }
.item { border: 2px solid var(--bord); border-radius: var(--rayon); padding: 10px 12px; margin: 8px 0; }
.item .t { font-weight: bold; color: var(--rouge-fonce); font-variant-numeric: tabular-nums; margin-right: 6px; }
.item .text { white-space: pre-wrap; }
.photo-item { display: grid; grid-template-columns: 96px 1fr; gap: 12px; align-items: start; }
.photo-item img { width: 96px; height: 96px; object-fit: cover; border-radius: 8px; background: var(--gris-clair); }
.status { display: inline-block; font-size: .85rem; font-weight: bold; padding: 3px 10px; border-radius: 99px; background: var(--gris-clair); color: var(--gris); }
.status.pending { background: #FFF0CC; color: var(--orange); }
.status.uploading { background: #E2ECFF; color: #1F4AA8; }
.status.received { background: #DDF3E5; color: var(--vert); }
.status.open { background: #FFE3E6; color: var(--rouge-fonce); }

/* Appareil photo plein écran */
.camera { position: fixed; inset: 0; z-index: 50; background: #000; display: flex; flex-direction: column; }
.camera video, .camera img.preview { flex: 1; width: 100%; min-height: 0; object-fit: contain; background: #000; }
.camera .bar { padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); background: #111; display: flex; gap: 12px; align-items: center; }
.camera .bar .btn { margin: 0; width: auto; flex: 1; }
.shutter { flex: none !important; width: 84px; height: 84px; border-radius: 50%; border: 6px solid #fff; background: var(--rouge); cursor: pointer; }
.camera .rec-mini { position: absolute; top: max(12px, env(safe-area-inset-top)); left: 12px; color: #fff; font-weight: bold; background: rgba(0,0,0,.5); padding: 4px 10px; border-radius: 99px; }
.camera .caption-zone { background: #111; padding: 12px 16px; }
.camera .caption-zone label { color: #fff; margin-top: 0; }

dialog { border: none; border-radius: 16px; padding: 20px; max-width: min(520px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(0,0,0,.55); }
dialog h3 { margin-top: 0; color: var(--gris); }

.sticky-bottom { position: fixed; left: 0; right: 0; bottom: 0; background: rgba(255,255,255,.97); border-top: 2px solid var(--bord); padding: 8px 16px calc(8px + env(safe-area-inset-bottom)); z-index: 5; }
.sticky-bottom .btn { max-width: 728px; margin: 0 auto; }

@media (min-width: 900px) {
  main { max-width: 980px; }
  .capture-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
}

/* Mode poche : noir (économe sur écran OLED), touches ignorées */
.pocket { position: fixed; inset: 0; z-index: 80; background: #000; color: #6b1a22; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 18px; touch-action: none; user-select: none; -webkit-user-select: none; }
.pocket-info { font: bold 2rem Arial, sans-serif; font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 10px; }
.pocket-hint { font-size: .95rem; color: #4a4446; text-align: center; padding: 0 24px; }
.pocket-progress { position: absolute; left: 0; bottom: 0; height: 6px; width: 0; background: #6b1a22; }
