/* Lien Waiver Generator — identité visuelle chantier BTP US.
   Document papier sur fond chantier, orange sécurité, champs à chasse fixe. */

:root {
  --chantier: #1c2530;
  --chantier-2: #242f3d;
  --papier: #fdfdf9;
  --orange: #f97316;
  --orange-fonce: #c2410c;
  --encre: #1a1a1a;
  --gris: #64748b;
  --ligne: #d8d3c3;
  --vert: #15803d;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--chantier);
  color: #e5e7eb;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  line-height: 1.55;
}

a { color: var(--orange); }

.bandeau {
  background: repeating-linear-gradient(
    -45deg, var(--orange) 0 18px, var(--chantier) 18px 36px);
  height: 10px;
}

.wrap { max-width: 880px; margin: 0 auto; padding: 24px 20px 64px; }

h1 { font-size: 1.9rem; line-height: 1.2; margin: 18px 0 8px; color: #fff; }
h2 { color: #fff; font-size: 1.25rem; margin-top: 36px; }
h3 { color: #e5e7eb; }

.sous-titre { color: #cbd5e1; font-size: 1.05rem; margin-top: 0; }

.marque {
  font-family: "Courier New", ui-monospace, monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--orange);
  font-weight: bold;
  font-size: 0.85rem;
}

.carte {
  background: var(--chantier-2);
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 20px;
  margin: 18px 0;
}

/* Sélecteur d'État */
.etats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
  margin: 16px 0;
}
.etats a {
  display: block;
  background: var(--chantier-2);
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 9px 12px;
  color: #e5e7eb;
  text-decoration: none;
  font-size: 0.92rem;
}
.etats a:hover { border-color: var(--orange); }
.etats a.statutaire { border-left: 4px solid var(--orange); }
.etats a .badge {
  display: inline-block;
  font-size: 0.68rem;
  font-family: ui-monospace, monospace;
  color: var(--orange);
  letter-spacing: 0.08em;
}
.etats a.indisponible { opacity: 0.75; }

/* Sélecteur de type de décharge */
.types { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 18px 0; }
@media (max-width: 640px) { .types { grid-template-columns: 1fr; } }
.types button {
  text-align: left;
  background: var(--chantier-2);
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 14px 16px;
  color: #e5e7eb;
  cursor: pointer;
  font-size: 0.95rem;
}
.types button:hover, .types button.actif { border-color: var(--orange); }
.types button .code {
  display: block;
  font-family: ui-monospace, monospace;
  color: var(--orange);
  font-size: 0.78rem;
  margin-bottom: 4px;
}
.types button .quand { color: #94a3b8; font-size: 0.82rem; display: block; margin-top: 4px; }

/* Le document papier */
.feuille {
  background: var(--papier);
  color: var(--encre);
  border-radius: 4px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.45);
  padding: 48px 52px;
  margin: 24px 0;
  font-size: 0.95rem;
  line-height: 1.6;
}
@media (max-width: 640px) { .feuille { padding: 28px 22px; } }

.feuille .doc-titre {
  text-align: center;
  font-weight: bold;
  letter-spacing: 0.04em;
  margin-bottom: 18px;
  font-size: 1.05rem;
}

.feuille .doc-notice {
  border: 2px solid var(--encre);
  padding: 10px 14px;
  font-weight: bold;
  font-size: 1rem; /* exigence : au moins aussi grand que le plus grand corps du formulaire */
  margin-bottom: 18px;
}

.feuille h4 {
  font-size: 0.95rem;
  margin: 18px 0 8px;
  border-bottom: 1px solid var(--ligne);
  padding-bottom: 4px;
}

.ligne-champ { margin: 6px 0; }
.ligne-champ label { font-weight: 600; }

input.blanc {
  font-family: "Courier New", ui-monospace, monospace;
  font-size: 0.95rem;
  border: none;
  border-bottom: 1.5px solid var(--encre);
  background: transparent;
  padding: 1px 4px;
  min-width: 180px;
  color: var(--encre);
}
input.blanc:focus { outline: 2px solid var(--orange); background: #fff7ed; }
input.blanc.court { min-width: 110px; }
input.blanc.large { min-width: 320px; width: 60%; }

textarea.editable {
  width: 100%;
  font-family: inherit;
  font-size: 0.95rem;
  border: 1px dashed var(--gris);
  border-radius: 4px;
  padding: 10px;
  min-height: 130px;
  color: var(--encre);
  background: #fff;
}

.reference-legale {
  font-family: ui-monospace, monospace;
  font-size: 0.78rem;
  color: var(--gris);
  margin-top: 26px;
  border-top: 1px solid var(--ligne);
  padding-top: 10px;
}

/* Actions */
.actions { margin: 20px 0; display: flex; gap: 12px; flex-wrap: wrap; }
button.principal {
  background: var(--orange);
  color: #1a1a1a;
  font-weight: bold;
  border: none;
  border-radius: 6px;
  padding: 13px 22px;
  font-size: 1rem;
  cursor: pointer;
}
button.principal:hover { background: var(--orange-fonce); color: #fff; }
button.secondaire {
  background: transparent;
  color: #cbd5e1;
  border: 1px solid #475569;
  border-radius: 6px;
  padding: 13px 22px;
  cursor: pointer;
}

/* Capture email — au moment du résultat, optionnelle */
.capture {
  display: none;
  background: var(--chantier-2);
  border: 1px solid var(--orange);
  border-radius: 8px;
  padding: 18px 20px;
  margin: 20px 0;
}
.capture.visible { display: block; }
.capture input[type=email] {
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid #475569;
  background: var(--chantier);
  color: #fff;
  min-width: 240px;
}
.capture .refus { background: none; border: none; color: #94a3b8; text-decoration: underline; cursor: pointer; }
.capture .statut { margin-top: 8px; font-size: 0.88rem; }

/* Mention avocat */
.mention {
  font-size: 0.82rem;
  color: #94a3b8;
  border-top: 1px solid #334155;
  margin-top: 40px;
  padding-top: 14px;
}

/* Page « pas encore disponible » */
.alerte-indisponible {
  border: 2px solid var(--orange);
  background: var(--chantier-2);
  border-radius: 8px;
  padding: 20px;
  margin: 24px 0;
}
.alerte-indisponible h2 { margin-top: 0; }

/* FAQ */
details { background: var(--chantier-2); border: 1px solid #334155; border-radius: 6px; margin: 8px 0; padding: 12px 16px; }
details summary { cursor: pointer; font-weight: 600; color: #e5e7eb; }
details p { color: #cbd5e1; }

footer { margin-top: 48px; font-size: 0.8rem; color: #64748b; }

/* Impression : seule la feuille, format US Letter */
@media print {
  @page { size: Letter; margin: 0.6in; }
  body { background: #fff; }
  body * { visibility: hidden; }
  .feuille, .feuille * { visibility: visible; }
  .feuille {
    position: absolute;
    inset: 0;
    box-shadow: none;
    margin: 0;
    padding: 0;
    border-radius: 0;
  }
  input.blanc { border-bottom: none; }
  .feuille .doc-notice { font-size: 12pt; }
}
