/* ============================================================ */
/* Bon d'intervention digital — Styles spécifiques              */
/* Cohérence avec main.css (dark theme, brand red)              */
/* ============================================================ */

/* Inputs textuels */
.input-field {
  width: 100%;
  background: rgba(20, 20, 20, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  color: #fff;
  font-size: 16px; /* anti auto-zoom iOS */
  transition: border-color 180ms ease, background 180ms ease;
}
.input-field::placeholder {
  color: #6b7280;
}
.input-field:focus {
  outline: none;
  border-color: rgba(192, 0, 0, 0.5);
  background: rgba(30, 30, 30, 0.9);
  box-shadow: 0 0 0 3px rgba(192, 0, 0, 0.12);
}

/* Checkbox custom brand */
.checkbox-brand {
  appearance: none;
  width: 1.125rem;
  height: 1.125rem;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-radius: 0.25rem;
  background: transparent;
  cursor: pointer;
  position: relative;
  transition: all 180ms ease;
  flex-shrink: 0;
}
.checkbox-brand:hover {
  border-color: rgba(255, 255, 255, 0.5);
}
.checkbox-brand:checked {
  background: linear-gradient(135deg, #c00000, #ff1a1a);
  border-color: #c00000;
}
.checkbox-brand:checked::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 0px;
  width: 6px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* Radio custom brand */
.radio-brand {
  appearance: none;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-radius: 9999px;
  background: transparent;
  cursor: pointer;
  transition: all 180ms ease;
  flex-shrink: 0;
  position: relative;
}
.radio-brand:hover {
  border-color: rgba(255, 255, 255, 0.5);
}
.radio-brand:checked {
  border-color: #c00000;
}
.radio-brand:checked::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 9999px;
  background: linear-gradient(135deg, #c00000, #ff1a1a);
}

/* Material cards (choix type d'appareil) */
.material-card {
  cursor: pointer;
  display: block;
}
.material-card-inner {
  background: rgba(255, 255, 255, 0.03);
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-radius: 1rem;
  padding: 1.25rem 1rem;
  text-align: center;
  transition: all 200ms ease;
}
.material-card-inner:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
}
.material-card-inner.is-selected {
  background: rgba(192, 0, 0, 0.12);
  border-color: #c00000;
  box-shadow: 0 0 20px rgba(192, 0, 0, 0.2);
}
@media (hover: none) {
  .material-card-inner:hover { background: rgba(255, 255, 255, 0.03); }
}

/* Lock cards (choix type verrouillage) */
.lock-card {
  cursor: pointer;
  display: block;
}
.lock-card-inner {
  background: rgba(255, 255, 255, 0.03);
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.75rem;
  padding: 0.875rem 1rem;
  text-align: center;
  transition: all 200ms ease;
}
.lock-card-inner.is-selected {
  background: rgba(192, 0, 0, 0.12);
  border-color: #c00000;
}

/* Option rows (données perso, testable) */
.option-row {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  padding: 0.875rem 1rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.75rem;
  cursor: pointer;
  transition: all 180ms ease;
}
.option-row:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.15);
}
.option-row:has(input:checked) {
  background: rgba(192, 0, 0, 0.08);
  border-color: #c00000;
}
@media (hover: none) {
  .option-row:hover {
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.08);
  }
}

/* Gradient text (déjà dans main.css mais fallback ici) */
.gradient-text {
  background: linear-gradient(135deg, #c00000, #ff1a1a);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* btn-gradient (fallback minimal) */
.btn-gradient {
  background: linear-gradient(135deg, #c00000, #ff1a1a);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.btn-gradient:hover {
  box-shadow: 0 0 30px rgba(192, 0, 0, 0.4);
}
@media (hover: none) {
  .btn-gradient:hover {
    box-shadow: 0 0 20px rgba(192, 0, 0, 0.3);
  }
}

/* ============================================================ */
/* Wizard v2 — mobile-first                                     */
/* ============================================================ */

/* Reset des cartes devenues <button> */
.material-card, .lock-card {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  width: 100%;
  font: inherit;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.material-card-inner { min-height: 96px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.lock-card-inner {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.25rem; min-height: 64px;
}
.lock-card-inner:hover { border-color: rgba(255,255,255,0.15); }
@media (hover: none) { .lock-card-inner:hover { border-color: rgba(255,255,255,0.08); } }

/* Classe explicite (fiabilité vs :has selon navigateurs) */
.option-row.is-checked { background: rgba(192,0,0,0.08); border-color: #c00000; }

/* Header wizard */
.wz-header {
  position: sticky; top: 0; z-index: 30;
  background: rgba(10,10,10,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding-top: env(safe-area-inset-top);
}
.wz-header-top {
  max-width: 48rem; margin: 0 auto;
  padding: 0.75rem 1rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}

/* Étapes cliquables */
.wz-steps {
  max-width: 48rem; margin: 0 auto;
  padding: 0 0.5rem 0.75rem;
  display: flex; align-items: flex-start; justify-content: space-between;
}
.wz-step {
  appearance: none; background: none; border: 0; cursor: default;
  display: flex; flex-direction: column; align-items: center; gap: 0.3rem;
  flex: 1 1 0; min-width: 0; padding: 0;
  -webkit-tap-highlight-color: transparent;
}
.wz-step.is-clickable { cursor: pointer; }
.wz-step-dot {
  width: 1.75rem; height: 1.75rem; border-radius: 9999px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 700;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  color: #9ca3af; transition: all 200ms ease;
}
.wz-step.is-done .wz-step-dot { background: rgba(34,197,94,0.15); border-color: rgba(34,197,94,0.5); color: #4ade80; }
.wz-step.is-active .wz-step-dot {
  background: linear-gradient(135deg,#c00000,#ff1a1a); border-color: #ff1a1a; color: #fff;
  box-shadow: 0 0 0 4px rgba(192,0,0,0.15);
}
.wz-step-label { font-size: 0.62rem; color: #6b7280; text-align: center; line-height: 1.1; }
.wz-step.is-active .wz-step-label { color: #fff; font-weight: 600; }
@media (min-width: 480px) { .wz-step-label { font-size: 0.72rem; } .wz-step-dot { width: 2rem; height: 2rem; } }

/* Barre de progression fine */
.wz-progress { height: 3px; background: rgba(255,255,255,0.05); }
.wz-progress-bar { height: 100%; background: linear-gradient(to right,#c00000,#ff1a1a); transition: width 400ms ease; }

/* Main : réserve la place pour la barre d'action collante */
.wz-main {
  max-width: 48rem; margin: 0 auto;
  padding: 1.25rem 1rem calc(6.5rem + env(safe-area-inset-bottom));
}
@media (min-width: 640px) { .wz-main { padding-top: 2rem; } }

.wz-title { font-size: clamp(1.5rem, 5vw, 2.25rem); line-height: 1.15; }
.wz-label { display: block; font-size: 0.875rem; color: #9ca3af; margin-bottom: 0.4rem; }

/* Erreurs de champ */
.field-error { color: #f87171; font-size: 0.78rem; margin-top: 0.35rem; }
.input-field.has-error { border-color: rgba(248,113,113,0.6); box-shadow: 0 0 0 3px rgba(248,113,113,0.1); }

/* Chips (panne, accessoires) */
.chip-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip {
  appearance: none; cursor: pointer;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.12);
  color: #d1d5db;
  padding: 0.5rem 0.85rem; border-radius: 9999px;
  font-size: 0.85rem; line-height: 1;
  transition: all 160ms ease;
  min-height: 40px;
  -webkit-tap-highlight-color: transparent;
}
.chip:hover { border-color: rgba(255,255,255,0.25); }
.chip.is-active {
  background: rgba(192,0,0,0.15); border-color: #c00000; color: #fff; font-weight: 600;
}
.chip.is-active::before { content: '✓ '; }

/* Grille pattern Android */
.pattern-wrap { max-width: 280px; margin: 0 auto; }
.pattern-svg {
  width: 100%; aspect-ratio: 1; display: block;
  touch-action: none; user-select: none; -webkit-user-select: none;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 1rem;
}

/* Barre d'action collante (thumb-friendly) */
.wz-actionbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  background: rgba(10,10,10,0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-bottom: env(safe-area-inset-bottom);
}
.wz-actionbar-inner {
  max-width: 48rem; margin: 0 auto;
  padding: 0.75rem 1rem;
  display: flex; align-items: center; gap: 0.75rem;
}
.wz-actionbar-hint { flex: 1; }
.wz-btn {
  appearance: none; cursor: pointer; border: 0;
  min-height: 48px; padding: 0 1.5rem; border-radius: 9999px;
  font-size: 0.95rem; font-weight: 600; font-family: inherit;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  transition: all 180ms ease;
  -webkit-tap-highlight-color: transparent;
}
.wz-btn-ghost { background: transparent; border: 1px solid rgba(255,255,255,0.15); color: #d1d5db; }
.wz-btn-ghost:hover { background: rgba(255,255,255,0.06); color: #fff; }
.wz-btn-primary {
  flex: 1; background: linear-gradient(135deg,#c00000,#ff1a1a); color: #fff;
  box-shadow: 0 8px 24px -8px rgba(192,0,0,0.5);
}
.wz-btn-primary:hover { box-shadow: 0 10px 30px -6px rgba(192,0,0,0.6); }
.wz-btn-primary:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
@media (min-width: 640px) {
  .wz-btn-primary { flex: 0 1 auto; min-width: 220px; margin-left: auto; }
  .wz-actionbar-hint { display: none; }
}

/* ============================================================ */
/* Utilitaires Tailwind ABSENTS du build purgé (main.css)       */
/* — nécessaires au wizard v2 ; portée limitée aux pages qui    */
/*   chargent intervention.css (prise-en-charge, /i, /pro).     */
/* ============================================================ */
.text-right { text-align: right; }
.break-all { word-break: break-word; overflow-wrap: anywhere; }
.touch-none { touch-action: none; }
.overflow-y-auto { overflow-y: auto; }
.underline { text-decoration-line: underline; }
.decoration-dotted { text-decoration-style: dotted; }
.font-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.tracking-\[0\.3em\] { letter-spacing: 0.3em; }
.aspect-\[3\/1\] { aspect-ratio: 3 / 1; }

.text-gray-500 { color: #6b7280; }
.text-gray-600 { color: #4b5563; }
.text-brand-light { color: #ff1a1a; }
.text-yellow-200 { color: #fef08a; }

.bg-brand\/15 { background-color: rgba(192, 0, 0, 0.15); }
.bg-white\/\[0\.02\] { background-color: rgba(255, 255, 255, 0.02); }
.bg-white\/\[0\.03\] { background-color: rgba(255, 255, 255, 0.03); }
.bg-yellow-500\/10 { background-color: rgba(234, 179, 8, 0.10); }
.bg-green-500\/15 { background-color: rgba(34, 197, 94, 0.15); }
.border-brand\/30 { border-color: rgba(192, 0, 0, 0.30); }
.border-yellow-500\/30 { border-color: rgba(234, 179, 8, 0.30); }
.border-green-500\/30 { border-color: rgba(34, 197, 94, 0.30); }

.p-4 { padding: 1rem; }
.mb-0 { margin-bottom: 0; }
.mb-5 { margin-bottom: 1.25rem; }
.max-h-56 { max-height: 14rem; }
.h-9 { height: 2.25rem; }
.w-9 { width: 2.25rem; }

@media (min-width: 640px) {
  .sm\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sm\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .sm\:mb-8 { margin-bottom: 2rem; }
}

/* Signature : empêche la page de scroller pendant qu'on signe (mobile) */
canvas[x-ref="signatureCanvas"] {
  touch-action: none;
  overscroll-behavior: contain;
}
