/* Toctoc — page émetteur. Design tokens : toctoc_specs_00_architecture.md §4. */

:root {
  --teal-950: #0D2E26;
  --teal-800: #16463A;
  --teal-700: #1E5947;
  --sage-100: #D9E9E1;
  --sage-200: #C3DDD1;
  --amber-500: #E2793D;
  --amber-600: #C86A34;
  --red-500: #B84A3E;
  --cream-50: #FAFBFA;
  --ink-900: #1A1A18;
  --ink-500: #6B6B65;
  --ink-300: #A6A69F;
  --line: #E4E4DE;

  --font-heading: Georgia, 'Iowan Old Style', 'Palatino Linotype', serif;
  --font-body: -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--cream-50);
  color: var(--ink-900);
  font-family: var(--font-body);
  -webkit-tap-highlight-color: transparent;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

h1 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 8px;
  line-height: 1.25;
}

.muted { color: var(--ink-500); margin: 0 0 20px; line-height: 1.5; }

.page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 24px 20px calc(24px + env(safe-area-inset-bottom));
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
}

#screen-loading, #screen-error, #screen-confirmation {
  align-items: center;
  justify-content: center;
  text-align: center;
}

.icon { width: 24px; height: 24px; flex-shrink: 0; }
.icon--small { width: 18px; height: 18px; }

.icon-badge {
  width: 64px;
  height: 64px;
  border-radius: 999px;
  background: var(--sage-100);
  color: var(--teal-800);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.icon-badge svg { width: 32px; height: 32px; }
.icon-badge--muted { background: var(--line); color: var(--ink-500); }

.vehicle-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  background: white;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 16px;
  margin-bottom: 20px;
  color: var(--ink-500);
  font-size: 0.9rem;
}
.vehicle-chip .icon { color: var(--teal-800); }

#contact-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 20px;
}

.field-group { display: flex; flex-direction: column; gap: 10px; }

.motif-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  font: inherit;
  font-size: 0.95rem;
  color: var(--ink-900);
  text-align: left;
  cursor: pointer;
  min-height: 44px;
}
.motif-card:focus-visible {
  outline: 2px solid var(--teal-800);
  outline-offset: 2px;
}
.motif-icon {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: var(--sage-100);
  color: var(--teal-800);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.motif-icon svg { width: 20px; height: 20px; }
.motif-label { flex: 1; }
.motif-check { width: 20px; height: 20px; color: var(--teal-800); visibility: hidden; flex-shrink: 0; }
.motif-check svg { width: 100%; height: 100%; }

.motif-card[aria-checked="true"] {
  border-color: var(--teal-800);
  border-width: 1.5px;
  background: #F5FAF7;
}
.motif-card[aria-checked="true"] .motif-icon {
  background: var(--teal-800);
  color: white;
}
.motif-card[aria-checked="true"] .motif-check { visibility: visible; }

.dropzone {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border: 1.5px dashed var(--line);
  border-radius: 12px;
  color: var(--ink-500);
  cursor: pointer;
  min-height: 44px;
}
.dropzone.is-active {
  border-color: var(--teal-800);
  border-style: solid;
  color: var(--teal-800);
  background: #F5FAF7;
}
.dropzone .icon { color: inherit; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 0.85rem; color: var(--ink-500); }
.field input,
input[type="tel"] {
  font: inherit;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  color: var(--ink-900);
  min-height: 44px;
}
.field input:focus-visible,
input[type="tel"]:focus-visible {
  outline: 2px solid var(--teal-800);
  outline-offset: 1px;
}

.btn {
  font: inherit;
  font-weight: 600;
  font-size: 1rem;
  border-radius: 12px;
  min-height: 52px;
  padding: 0 20px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-primary {
  background: var(--teal-800);
  color: white;
  position: sticky;
  bottom: calc(16px + env(safe-area-inset-bottom));
}
.btn-primary:disabled {
  background: var(--sage-100);
  color: var(--ink-300);
  cursor: not-allowed;
}
.btn-primary:not(:disabled):active { background: var(--teal-700); }
.btn-outline {
  background: white;
  border: 1px solid var(--line);
  color: var(--teal-800);
}
.btn-ghost {
  background: transparent;
  color: var(--teal-800);
  border: 1px solid var(--line);
}

.privacy-note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: var(--ink-500);
  font-size: 0.8rem;
  line-height: 1.5;
  margin: 0;
}
.privacy-note .icon { color: var(--teal-800); margin-top: 1px; }

.inline-error {
  background: #FBEFEC;
  color: var(--red-500);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 0.9rem;
  margin: 0;
}

.spinner {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 3px solid var(--sage-100);
  border-top-color: var(--teal-800);
  animation: spin 0.8s linear infinite;
  margin-bottom: 12px;
}
.spinner--inline {
  width: 18px;
  height: 18px;
  border-width: 2px;
  border-color: rgba(255, 255, 255, 0.35);
  border-top-color: white;
  margin-bottom: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Transitions d'écran — fade + translateY, cf. architecture §4. */
.screen {
  animation: screen-in 280ms ease both;
}
@keyframes screen-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .screen { animation: none; }
}

/* Large écran (>= 880px) — panneau de marque + formulaire, cf. spec client §6. */
@media (min-width: 880px) {
  .page { flex-direction: row; }
  .page::before {
    content: "";
    flex: 1;
    background: var(--teal-950);
    min-height: 100dvh;
  }
  #screen-loading, #screen-error, #screen-contact, #screen-confirmation {
    flex: 1;
    max-width: 520px;
    margin: auto;
    justify-content: center;
  }
}
