/* =============================================
   REWAX & CARE — styles.css
   Mobile-first, full-screen, no-scroll
   ============================================= */

:root {
  --green: #153e21;
  --green-hover: #1a5029;
  --green-light: #eef4f0;
  --green-mid: #c6daca;
  --text: #111827;
  --text-light: #6b7280;
  --text-xlight: #9ca3af;
  --border: #e5e7eb;
  --bg: #f9f7f4;
  --white: #ffffff;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 20px 60px rgba(0,0,0,0.15);
  --transition: 200ms ease;
  --header-h: 56px;
  --progress-h: 3px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html {
  height: 100%;
  height: -webkit-fill-available;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  height: 100%;
  height: -webkit-fill-available;
  overflow: hidden;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* =============================================
   HEADER
   ============================================= */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  padding: 0 20px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 100;
  padding-top: var(--safe-top);
}

.header-logo {
  height: 26px;
  width: auto;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.back-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: var(--text-light);
  cursor: pointer;
  padding: 8px 0;
  transition: color var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.back-btn:hover { color: var(--text); }
.back-btn span { display: none; }

@media (min-width: 480px) {
  .back-btn span { display: inline; }
}

.step-counter {
  font-size: 13px;
  color: var(--text-xlight);
  font-variant-numeric: tabular-nums;
  min-width: 40px;
  text-align: right;
}

/* =============================================
   PROGRESS BAR
   ============================================= */
.progress-bar-wrap {
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  height: var(--progress-h);
  background: var(--border);
  z-index: 100;
}

.progress-bar-fill {
  height: 100%;
  background: var(--green);
  transition: width 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

/* =============================================
   STEPS ROOT & TRANSITIONS
   ============================================= */
.steps-root {
  position: fixed;
  top: calc(var(--header-h) + var(--progress-h));
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  perspective: 1200px;
}

.step {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  /* Default: waiting off-screen to the right */
  transform: translateX(100%);
  opacity: 0;
  will-change: transform, opacity;
  transition: transform 0.42s cubic-bezier(0.35, 0.17, 0.15, 1),
              opacity   0.42s cubic-bezier(0.35, 0.17, 0.15, 1);
}

/* Visible / current step */
.step.active {
  transform: translateX(0);
  opacity: 1;
}

/* Exiting to the left (going forward) */
.step.exit-left {
  transform: translateX(-28%) scale(0.97);
  opacity: 0;
}

/* Exiting to the right (going backward) */
.step.exit-right {
  transform: translateX(100%);
  opacity: 0;
}

/* Entering from the left (going backward) */
.step.enter-left {
  transform: translateX(-28%) scale(0.97);
  opacity: 0;
}

/* =============================================
   WELCOME
   ============================================= */
.step#step-0 {
  align-items: center;
  background: var(--white);
}

.step#step-0 {
  position: fixed;
  inset: 0;
  z-index: 101;
  background: #000;
  overflow: hidden;
}

.welcome-video-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.welcome-video-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1;
}

.welcome-wrap {
  position: relative;
  z-index: 2;
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Logo pinned at top */
.welcome-logo-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 52px 24px 0;
}

.welcome-logo { height: 44px; }

/* Text + button centered in remaining space */
.welcome-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  text-align: center;
  max-width: 560px;
  padding: 0 24px 80px;
}

.welcome-title {
  font-family: 'Sora', sans-serif;
  font-size: clamp(28px, 4.5vw, 48px);
  font-weight: 600;
  line-height: 1.2;
  color: #fff;
  white-space: nowrap;
}

.welcome-sub {
  font-size: 15px;
  color: rgba(255,255,255,0.8);
  line-height: 1.6;
}

/* =============================================
   BOUTIQUE OVERLAY (mode pro)
   ============================================= */
.boutique-overlay {
  position: fixed;
  top: calc(var(--header-h) + var(--progress-h));
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg);
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-y: auto;
}

.header-left-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-right-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dashboard-btn { margin-left: 8px; }

.dashboard-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-light);
  text-decoration: none;
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--white);
  white-space: nowrap;
  transition: border-color 0.15s, color 0.15s;
}
.dashboard-btn:hover { border-color: var(--green); color: var(--green); }

.pro-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--white);
  background: var(--green);
  padding: 3px 8px;
  border-radius: 20px;
  white-space: nowrap;
}

/* =============================================
   RECAP SIGNATURE
   ============================================= */
.recap-signature-wrap {
  padding: 0 20px 4px;
}
.recap-signature-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-light);
  margin-bottom: 8px;
}
.recap-signature-pad-wrap {
  position: relative;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  overflow: hidden;
}
.recap-signature-canvas {
  display: block;
  width: 100%;
  height: 130px;
  cursor: crosshair;
  touch-action: none;
}
.recap-signature-clear {
  position: absolute;
  top: 8px;
  right: 10px;
  background: none;
  border: none;
  font-size: 12px;
  color: var(--text-xlight);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color 0.15s;
}
.recap-signature-clear:hover { color: var(--text); }
.recap-signature-hint {
  font-size: 11px;
  color: var(--text-xlight);
  margin-top: 5px;
  text-align: center;
}

/* =============================================
   RECAP SEND EMAIL
   ============================================= */
.recap-send {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}

.btn-send-email {
  width: 100%;
  justify-content: center;
  gap: 8px;
}

.recap-send-status {
  font-size: 12px;
  text-align: center;
  min-height: 16px;
}

.welcome-timer {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  margin-top: -10px;
}

/* =============================================
   STEP INNER LAYOUT
   ============================================= */
.step-inner {
  width: 100%;
  max-width: 560px;
  padding: 36px 20px 40px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

@media (min-width: 600px) {
  .step-inner { padding: 48px 32px 56px; }
}

.step-header { display: flex; flex-direction: column; gap: 8px; }

.step-tag {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--green);
}

.step-question {
  font-family: 'Sora', sans-serif;
  font-size: clamp(26px, 5vw, 38px);
  font-weight: 500;
  color: var(--text);
  line-height: 1.25;
}

.step-hint {
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.5;
  margin-top: 2px;
}

.step-hint strong { color: var(--text); font-weight: 500; }

/* =============================================
   OPTION CARDS
   ============================================= */
.cards-grid {
  display: grid;
  gap: 10px;
}

.cards-grid.cols-1 { grid-template-columns: 1fr; }
.cards-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cards-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }

.option-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  transition: border-color var(--transition), background var(--transition), transform var(--transition), box-shadow var(--transition);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.option-card:active { transform: scale(0.97); }

.option-card:hover {
  border-color: var(--green-mid);
  background: var(--green-light);
}

.option-card.selected {
  border-color: var(--green);
  background: var(--green-light);
  box-shadow: 0 0 0 3px rgba(21,62,33,0.1);
}

/* Row-style cards (for origine) */
.card-row {
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  padding: 16px 18px;
  gap: 14px;
  text-align: left;
}

.card-icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-light);
  transition: background var(--transition), color var(--transition);
}

.option-card.selected .card-icon-wrap,
.option-card:hover .card-icon-wrap {
  background: var(--green-mid);
  color: var(--green);
}

.card-arrow {
  margin-left: auto;
  color: var(--text-xlight);
  flex-shrink: 0;
}

.card-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.card-sub {
  font-size: 12px;
  color: var(--text-light);
  font-weight: 400;
}

/* État cards */
.etat-card { gap: 10px; }
.etat-card svg { color: var(--text-xlight); transition: color var(--transition); }
.etat-card.selected svg { color: var(--green); }

/* Color cards */
.color-grid { gap: 10px; }

.color-card {
  padding: 14px 10px;
  gap: 8px;
}

.color-swatch {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid rgba(0,0,0,0.08);
  flex-shrink: 0;
}

.autre-swatch {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #e0e0e0, #c8c8c8);
  font-size: 14px;
  font-weight: 600;
  color: #777;
}

/* =============================================
   FORM FIELDS
   ============================================= */
.form-fields { display: flex; flex-direction: column; gap: 18px; }

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

.field-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.field-input {
  padding: 14px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 16px; /* 16px prevents iOS zoom */
  font-weight: 400;
  color: var(--text);
  background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  width: 100%;
  -webkit-appearance: none;
}

.field-input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(21,62,33,0.08);
}

.field-input::placeholder { color: #c5c5c5; }


.email-input-wrap { position: relative; }
.email-input-wrap .field-input { padding-right: 44px; }

.email-check {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--green);
  display: flex;
  align-items: center;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}
.email-check.visible { opacity: 1; }

/* =============================================
   BUTTONS
   ============================================= */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 15px 36px;
  background: var(--green);
  color: var(--white);
  border: none;
  border-radius: 50px;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  text-decoration: none;
}

.btn-primary:hover { background: var(--green-hover); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary.btn-full { width: 100%; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 20px;
  background: var(--white);
  color: var(--text-light);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.btn-ghost:hover { border-color: var(--green); color: var(--green); }

.photo-tip {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 4px 0 0;
  padding: 14px 16px;
  background: #eef6f0;
  border: 1px solid #c6dece;
  border-radius: 12px;
  color: #2d6647;
}

.photo-tip svg {
  flex-shrink: 0;
  margin-top: 1px;
  opacity: 0.8;
}

.photo-tip p {
  font-size: 13px;
  line-height: 1.55;
  margin: 0;
}

.btn-text {
  background: none;
  border: none;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--text-light);
  cursor: pointer;
  padding: 10px;
  transition: color var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.btn-text:hover { color: var(--text); }

.step-btns {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.step-btns-row {
  flex-direction: row;
  align-items: center;
  flex-wrap: nowrap;
  width: 100%;
}

.step-btns-row > * {
  flex: 1 1 0;
  text-align: center;
  justify-content: center;
  white-space: nowrap;
  font-size: 13px;
  padding-left: 10px;
  padding-right: 10px;
}

/* =============================================
   PHOTO STEPS
   ============================================= */
.photo-step-inner {
  max-width: 700px;
}

.photo-zone {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.upload-area {
  padding: 40px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  min-height: 200px;
  justify-content: center;
  transition: background var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.upload-area:hover,
.upload-area:active { background: var(--green-light); }

.upload-area svg { color: var(--text-xlight); }

.upload-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
}

.upload-sub {
  font-size: 13px;
  color: var(--text-light);
  text-align: center;
}

.photo-canvas-wrap {
  position: relative;
  cursor: crosshair;
}

.photo-img {
  width: 100%;
  height: auto;
  display: block;
  max-height: 380px;
  object-fit: contain;
  background: #f3f3f3;
}

@media (min-width: 600px) {
  .photo-img { max-height: 460px; }
}

.pins-layer {
  position: absolute;
  pointer-events: none;
}

/* Pin marker */
.pin {
  position: absolute;
  width: 30px;
  height: 30px;
  background: var(--green);
  color: white;
  border-radius: 50% 50% 50% 0;
  transform: translate(-50%, -100%) rotate(-45deg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  pointer-events: all;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
  transition: transform var(--transition);
  border: 2px solid rgba(255,255,255,0.4);
  -webkit-tap-highlight-color: transparent;
}

.pin:hover { transform: translate(-50%, -110%) rotate(-45deg); }

.pin-num { transform: rotate(45deg); }

/* Cross marker (zigzag, renfort) */
.pin-cross {
  position: absolute;
  width: 24px;
  height: 24px;
  transform: translate(-50%, -50%);
  cursor: pointer;
  pointer-events: all;
  -webkit-tap-highlight-color: transparent;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.5));
}

.pin-cross::before,
.pin-cross::after {
  content: '';
  position: absolute;
  background: #fff;
  border-radius: 2px;
}

.pin-cross::before {
  width: 3px;
  height: 100%;
  left: 50%;
  top: 0;
  transform: translateX(-50%) rotate(45deg);
}

.pin-cross::after {
  width: 100%;
  height: 3px;
  left: 0;
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
}

/* Circle marker (bouton) */
.pin-circle {
  position: absolute;
  width: 22px;
  height: 22px;
  border: 3px solid #fff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  cursor: pointer;
  pointer-events: all;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.5));
}

/* Rectangle annotation (empiècement) */
.anno-rect {
  position: absolute;
  border: 3px solid #fff;
  border-radius: 3px;
  box-sizing: border-box;
  pointer-events: all;
  cursor: pointer;
  background-image: repeating-linear-gradient(
    45deg,
    rgba(255,255,255,0.14) 0px,
    rgba(255,255,255,0.14) 1px,
    transparent 1px,
    transparent 9px
  );
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.5));
  -webkit-tap-highlight-color: transparent;
}

/* Labels on photo */
.anno-label {
  position: absolute;
  background: rgba(0,0,0,0.62);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  padding: 3px 6px;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  letter-spacing: 0.01em;
}

/* Pin label: undo teardrop rotation, place to the right */
.pin-label {
  transform: rotate(45deg);
  transform-origin: left center;
  top: 2px;
  left: 34px;
}

/* Cross label: to the right of the × */
.cross-label {
  left: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
}

/* Rect label: inside top-left corner */
.rect-label {
  top: 5px;
  left: 5px;
}

/* Rectangle preview while drawing */
.rect-preview {
  position: absolute;
  border: 3px dashed rgba(255,255,255,0.8);
  border-radius: 3px;
  box-sizing: border-box;
  pointer-events: none;
  background: rgba(255,255,255,0.05);
}

.change-photo-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  background: rgba(255,255,255,0.9);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition);
  backdrop-filter: blur(4px);
  -webkit-tap-highlight-color: transparent;
}

.change-photo-btn:hover { background: var(--white); }

/* Repair badges below photo */
.repair-badges-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 0;
}

.repair-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px 6px 8px;
  background: var(--green-light);
  border: 1px solid var(--green-mid);
  border-radius: 20px;
  font-size: 13px;
  color: var(--green);
  font-weight: 500;
}

.repair-badge-num {
  width: 20px;
  height: 20px;
  background: var(--green);
  color: white;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.repair-badge-del {
  width: 18px;
  height: 18px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--green);
  font-size: 16px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.6;
  transition: opacity var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.repair-badge-del:hover { opacity: 1; }

.photo-step-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

/* =============================================
   ENTRETIEN STEP
   ============================================= */
.entretien-list { display: flex; flex-direction: column; gap: 10px; }

.entretien-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.entretien-card:hover { border-color: var(--green-mid); background: var(--green-light); }
.entretien-card.selected { border-color: var(--green); background: var(--green-light); }

.entretien-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color var(--transition), background var(--transition);
}

.entretien-check svg { opacity: 0; transition: opacity var(--transition); color: var(--white); }

.entretien-card.selected .entretien-check {
  background: var(--green);
  border-color: var(--green);
}

.entretien-card.selected .entretien-check svg { opacity: 1; }

.entretien-check-arrow {
  border-color: var(--green);
  background: var(--green-light);
}
.entretien-check-arrow svg { opacity: 1; color: var(--green); }
.entretien-card-reparations { cursor: pointer; }
.entretien-card-reparations:hover { border-color: var(--green); }

.entretien-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.entretien-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.entretien-desc {
  font-size: 12px;
  color: var(--text-light);
}

.entretien-price {
  font-size: 15px;
  font-weight: 600;
  color: var(--green);
  flex-shrink: 0;
}
.entretien-price.sur-devis {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  background: #f0fdf4;
  color: var(--green);
  border: 1.5px solid #bbf7d0;
  border-radius: 6px;
  padding: 3px 8px;
}

/* =============================================
   ADDRESS AUTOCOMPLETE
   ============================================= */

.address-wrap { display: flex; flex-direction: column; gap: 16px; }

.address-search-group { position: relative; }

.address-input-wrap { position: relative; }

.address-suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  z-index: 50;
  max-height: 260px;
  overflow-y: auto;
  display: none;
}

.address-suggestions.open { display: block; }

.address-suggestion {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.address-suggestion:last-child { border-bottom: none; }
.address-suggestion:hover,
.address-suggestion:active { background: var(--green-light); }

.suggestion-main {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.suggestion-sub {
  font-size: 12px;
  color: var(--text-light);
}

.address-confirmed-row {
  display: flex;
  gap: 12px;
}

.field-input-readonly {
  background: var(--bg);
  color: var(--text-light);
  cursor: default;
}

.btn-reset-address {
  padding: 6px 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

/* =============================================
   ANNOTATION STEP (step-8)
   ============================================= */

/* Step override: full height, no outer scroll */
.step.anno-step {
  align-items: stretch;
  overflow: hidden;
}

/* --- Upload initial screen --- */
.anno-upload-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  padding: 20px;
}

.anno-upload-inner {
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 16px 0 32px;
}

.upload-duo {
  display: flex;
  flex-direction: row;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 6px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.upload-duo::-webkit-scrollbar { display: none; }

.upload-card-item {
  flex: 0 0 140px;
  min-width: 0;
  position: relative;
  background: var(--white);
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  padding: 28px 12px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  -webkit-tap-highlight-color: transparent;
  text-align: center;
}

.upload-card-item:hover,
.upload-card-item:active { border-color: var(--green); background: var(--green-light); }
.upload-card-item.uploaded { border-style: solid; border-color: var(--green); }

.upload-card-item svg { color: var(--text-xlight); }
.upload-card-item.uploaded svg { color: var(--green); }

.upload-card-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.upload-card-badge {
  font-size: 11px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 10px;
  background: #fef3c7;
  color: #92400e;
}

.upload-card-badge-opt {
  background: var(--green-light);
  color: var(--green);
}

.upload-card-add {
  border-style: dashed;
  color: var(--text-light);
  justify-content: center;
}
.upload-card-add svg { color: var(--text-xlight); }


/* delete button on upload card */
.upload-card-delete {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0,0,0,0.55);
  color: #fff;
  border: none;
  font-size: 14px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  z-index: 10;
}
.upload-card-delete:hover { background: rgba(0,0,0,0.8); }

/* thumb preview on upload card */
.upload-card-thumb {
  width: 100%;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
}

/* --- Annotation screen --- */
.anno-screen {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
}

.anno-photo {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: #1a1a1a;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

.anno-photo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.anno-photo.repair-mode {
  cursor: crosshair;
}

.anno-photo.repair-mode img {
  pointer-events: none;
}

/* Hint bubble → barre d'instruction */
.anno-hint-bubble {
  display: none;
}
.anno-hint-bubble.visible { display: none; }

.anno-instruction-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #f0fdf4;
  border: 1.5px solid #bbf7d0;
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 10px;
}
.anno-instruction-step {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--text);
  line-height: 1.4;
}
.anno-instruction-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--green);
  color: white;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.anno-instruction-sep {
  width: 1px;
  height: 28px;
  background: #bbf7d0;
  flex-shrink: 0;
}

/* Bottom panel */
.anno-bottom {
  background: var(--white);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* Thumbnails strip */
.anno-thumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.anno-thumbs::-webkit-scrollbar { display: none; }

.anno-thumb {
  width: 80px;
  height: 80px;
  border-radius: 10px;
  border: 2px solid var(--border);
  overflow: hidden;
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  transition: border-color var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.anno-thumb.active { border-color: var(--green); }

.anno-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.anno-thumb-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.55);
  color: white;
  font-size: 9px;
  font-weight: 600;
  text-align: center;
  padding: 2px 0;
  letter-spacing: 0.03em;
}

.anno-thumb-add {
  width: 80px;
  height: 80px;
  border-radius: 10px;
  border: 2px dashed var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  flex-shrink: 0;
  font-size: 9px;
  font-weight: 600;
  color: var(--text-xlight);
  transition: border-color var(--transition), color var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.anno-thumb-add:hover { border-color: var(--green); color: var(--green); }

/* Repair chips row */
.anno-repairs {
  padding: 10px 16px 8px;
  border-bottom: 1px solid var(--border);
}

.anno-repair-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-xlight);
  margin-bottom: 8px;
}

.anno-repair-scroll {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.anno-repair-scroll::-webkit-scrollbar { display: none; }

.repair-chip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 13px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  background: var(--white);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color var(--transition), background var(--transition), color var(--transition), transform var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.repair-chip:hover { border-color: var(--green-mid); background: var(--green-light); }

.repair-chip:active { transform: scale(0.96); }

.repair-chip.selected {
  border-color: var(--green);
  background: var(--green);
  color: var(--white);
}

.repair-chip-price {
  font-size: 11px;
  opacity: 0.65;
  font-weight: 400;
}

/* Placed repairs + footer */
.anno-footer {
  padding: 10px 16px calc(10px + var(--safe-bottom));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.anno-placed {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.placed-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px 4px 6px;
  background: var(--green-light);
  border: 1px solid var(--green-mid);
  border-radius: 16px;
  font-size: 12px;
  color: var(--green);
  font-weight: 500;
  white-space: nowrap;
}

.placed-badge-num {
  width: 18px;
  height: 18px;
  background: var(--green);
  color: white;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.placed-badge-del {
  cursor: pointer;
  opacity: 0.5;
  font-size: 14px;
  line-height: 1;
  background: none;
  border: none;
  color: var(--green);
  padding: 0;
  transition: opacity var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.placed-badge-del:hover { opacity: 1; }

/* =============================================
   REPAIR PICKER (bottom sheet)
   ============================================= */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.overlay.open {
  opacity: 1;
  pointer-events: all;
}

.bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--white);
  border-radius: 20px 20px 0 0;
  padding: 16px 20px calc(20px + var(--safe-bottom));
  z-index: 201;
  max-height: 75vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
}

.bottom-sheet.open { transform: translateY(0); }

.sheet-handle {
  width: 36px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 0 auto 16px;
}

.sheet-title {
  font-family: 'Sora', sans-serif;
  font-size: 18px;
  font-weight: 500;
  text-align: center;
  margin-bottom: 16px;
}

.sheet-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }

.sheet-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.sheet-item:hover,
.sheet-item:active { border-color: var(--green); background: var(--green-light); }

.sheet-item-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.sheet-item-price {
  font-size: 13px;
  color: var(--text-light);
}

.sheet-cancel {
  width: 100%;
  padding: 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-light);
}

/* =============================================
   MODALS
   ============================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal-card {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  background: var(--white);
  border-radius: 20px;
  padding: 28px 24px;
  width: calc(100% - 32px);
  max-width: 420px;
  z-index: 201;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.modal-card.open {
  opacity: 1;
  pointer-events: all;
  transform: translate(-50%, -50%) scale(1);
}

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  background: var(--white);
  border-radius: 20px;
  padding: 28px 24px;
  width: calc(100% - 32px);
  max-width: 420px;
  z-index: 201;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.modal.open {
  opacity: 1;
  pointer-events: all;
  transform: translate(-50%, -50%) scale(1);
}

.modal-title {
  font-family: 'Sora', sans-serif;
  font-size: 19px;
  font-weight: 500;
  text-align: center;
}

.modal-field { display: flex; flex-direction: column; gap: 8px; }

.modal-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.cm-row { display: flex; align-items: center; gap: 10px; }

.cm-input {
  width: 90px;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  text-align: center;
  outline: none;
  transition: border-color var(--transition);
  -webkit-appearance: none;
}

.cm-input:focus { border-color: var(--green); }
.cm-unit { font-size: 14px; color: var(--text-light); }

.doublure-row {
  display: flex;
  gap: 8px;
}

.doublure-btn {
  flex: 1;
  padding: 11px 6px;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), color var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.doublure-btn:hover { border-color: var(--green); background: var(--green-light); }
.doublure-btn.selected { border-color: var(--green); background: var(--green-light); color: var(--green); font-weight: 500; }

.modal-actions { display: flex; flex-direction: column; gap: 8px; }

/* Tartan color picker */
.tartan-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-top: 4px;
}
.tartan-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}
.tartan-option img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  border: 2.5px solid transparent;
  transition: border-color 0.15s, transform 0.15s;
}
.tartan-option span {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-light);
  transition: color 0.15s;
}
.tartan-option:hover img { transform: scale(1.04); }
.tartan-option.selected img { border-color: var(--green); }
.tartan-option.selected span { color: var(--green); font-weight: 700; }

/* =============================================
   RECAP
   ============================================= */
.recap-inner { max-width: 640px; }

.recap-body { display: flex; flex-direction: column; gap: 12px; }

.recap-section {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.recap-section-title {
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-light);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.recap-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 16px;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
}

.recap-row:last-child { border-bottom: none; }

.recap-row-label { color: var(--text); }
.recap-row-value { color: var(--text-light); font-size: 13px; }
.recap-row-price { font-weight: 600; color: var(--text); }
.recap-paid-badge {
  background: #e6f4ea;
  color: #1a7a38;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
}

.recap-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  background: var(--green);
  color: var(--white);
  border-radius: var(--radius);
}

.recap-total-label { font-size: 15px; font-weight: 500; }
.recap-total-price {
  font-family: 'Sora', sans-serif;
  font-size: 26px;
  font-weight: 600;
}

.recap-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0 16px;
  margin-bottom: 4px;
}

.recap-ref {
  font-size: 13px;
  font-weight: 700;
  color: var(--green);
  letter-spacing: 0.05em;
}

.recap-date {
  font-size: 12px;
  color: var(--text-xlight);
}

.recap-photos {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 8px;
}

.recap-photo-item {}

.recap-photo-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.recap-photo-img {
  width: 100%;
  border-radius: 10px;
  display: block;
}

.recap-actions {
  display: flex;
  flex-direction: row;
  gap: 10px;
  margin-top: 20px;
  width: 100%;
}

.recap-actions .btn-primary { flex: 0 0 calc(60% - 5px); justify-content: center; }
.recap-actions .btn-ghost   { flex: 1; justify-content: center; }

@media print {
  @page { size: A4 portrait; margin: 14mm 16mm; }

  /* Masquer tout sauf step-13 */
  body * { visibility: hidden; }
  #step-13, #step-13 * { visibility: visible; }

  /* Masquer les éléments non destinés à l'impression retoucheuse */
  .print-hide,
  .recap-row-price,
  .recap-total,
  .recap-send,
  .recap-meta,
  .recap-signature-wrap { display: none !important; }

  /* Signature — apparaît à l'impression */
  .recap-signature-wrap {
    padding: 0;
    margin-top: 12px;
    break-inside: avoid;
  }
  .recap-signature-canvas {
    height: 90px;
    border: 1px solid #ccc;
    border-radius: 6px;
  }
  .recap-signature-clear,
  .recap-signature-hint,
  .recap-signature-label { display: none !important; }
  #step-13 {
    position: fixed; inset: 0;
    background: #fff;
    overflow: visible;
    padding: 0;
  }

  /* Masquer éléments non imprimables */
  .recap-actions,
  .step-header,
  .app-header,
  #progressBar { display: none !important; }

  /* Conteneur principal pleine largeur */
  .recap-inner {
    max-width: 100%;
    padding: 0;
  }

  .recap-body { gap: 10px; }

  /* En-tête ref/date */
  .recap-meta {
    padding: 0 0 10px;
    margin-bottom: 8px;
    border-bottom: 1px solid #ddd;
  }

  /* Sections — mise en page proche de l'écran */
  .recap-section { border-radius: 8px; }

  .recap-section-title {
    padding: 8px 14px;
    font-size: 10px;
  }

  .recap-row {
    padding: 8px 14px;
    font-size: 12px;
  }

  /* Photos : 2 colonnes, chacune ≥ 1/4 de page (~70mm) */
  .recap-photos {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 8px;
  }

  .recap-photo-img {
    width: 100%;
    min-height: 72mm;
    max-height: 110mm;
    object-fit: contain;
    border-radius: 8px;
    background: #f5f5f3;
  }

  .recap-photo-label {
    font-size: 10px;
    margin-bottom: 4px;
  }

  /* Total */
  .recap-total {
    padding: 14px 18px;
    border-radius: 8px;
  }
  .recap-total-label { font-size: 13px; }
  .recap-total-price { font-size: 22px; }

  /* Coupures de page : éviter de couper une section en deux */
  .recap-section,
  .recap-total { page-break-inside: avoid; break-inside: avoid; }

  /* Les photos peuvent déclencher un saut de page mais ne se coupent pas */
  .recap-photo-item { page-break-inside: avoid; break-inside: avoid; }
}

/* =============================================
   STEP 10 — TWO-COLUMN ANNOTATION LAYOUT
   ============================================= */

/* Step override: stretch full height */
.step.anno-step {
  align-items: stretch;
  overflow: hidden;
  padding: 0;
}

/* Main grid: repairs left (30%) | photo right (70%) */
.anno-layout {
  display: grid;
  grid-template-columns: 60% 40%;
  grid-template-rows: auto 1fr;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.anno-instruction-bar {
  grid-column: 1 / -1;
  margin: 10px 16px 0;
}

/* ---- Left column: repair list ---- */
.anno-repairs-col {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: var(--white);
  overflow: hidden;
}

.anno-repairs-col-title {
  padding: 12px 12px 10px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-xlight);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.anno-repairs-list {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.anno-repairs-list::-webkit-scrollbar { width: 4px; }
.anno-repairs-list::-webkit-scrollbar-track { background: transparent; }
.anno-repairs-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.anno-repair-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.anno-repair-item:last-child { border-bottom: none; }
.anno-repair-item:hover { background: var(--green-light); }

.anno-repair-item.selected {
  background: var(--green-light);
}

.anno-repair-item-name {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.3;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
}

.anno-repair-item.selected .anno-repair-item-name { color: var(--green); }

.anno-repair-category {
  padding: 10px 12px 6px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--green);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1;
}

.cat-sub {
  opacity: 0.8;
}

.anno-repair-item-price {
  font-size: 13px;
  color: var(--green);
  font-weight: 600;
  flex-shrink: 0;
  white-space: nowrap;
}

.repair-qty-ctrl {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.qty-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--green);
  background: transparent;
  color: var(--green);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  font-weight: 600;
  transition: background var(--transition), color var(--transition);
}
.qty-btn:hover { background: var(--green); color: #fff; }

.qty-value {
  min-width: 16px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--green);
}

.repair-info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--text-xlight);
  opacity: 0.6;
  transition: opacity var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.repair-info-btn:hover { opacity: 1; }

.repair-info-popup {
  position: fixed;
  z-index: 999;
  background: var(--text);
  color: #fff;
  font-size: 12px;
  line-height: 1.5;
  padding: 10px 12px;
  border-radius: 10px;
  width: 220px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  pointer-events: none;
  animation: fadeInUp 0.15s ease;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ① Récap réparations */
.anno-recap-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #eaf4ec;
  border-top: 1px solid #c3e0ca;
  border-bottom: 1px solid #c3e0ca;
  font-size: 12px;
  color: var(--green);
  font-weight: 500;
  flex-shrink: 0;
  animation: fadeInUp 0.2s ease;
}
.anno-recap-total {
  font-size: 12px;
  color: var(--text-light);
}
.anno-recap-total strong {
  color: var(--green);
  font-weight: 700;
}

.anno-col-footer {
  height: 90px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px calc(var(--safe-bottom));
  background: #f2f2f0;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.btn-anno-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  height: 52px;
  padding: 0 8px;
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 50px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-light);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color var(--transition), color var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.btn-anno-delete:hover {
  border-color: #c0392b;
  color: #c0392b;}

.anno-col-footer .btn-primary {
  flex: 1;
  min-width: 0;
  height: 52px;
  padding: 0 12px;
  font-size: 14px;
  transition: background 0.25s, box-shadow 0.25s;
}

/* ② Bouton actif quand annotations présentes */
.anno-col-footer .btn-primary.has-items {
  background: var(--green);
  box-shadow: 0 4px 14px rgba(21,62,33,0.25);
}

/* ③ Hint d'aide sur la photo */
.anno-help-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: calc(100% - 24px);
  max-width: 280px;
  background: rgba(21,62,33,0.92);
  color: #fff;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 12px;
  line-height: 1.5;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  z-index: 20;
}
.anno-help-hint.visible {
  opacity: 1;
  pointer-events: auto;
}
.anno-help-hint svg {
  flex-shrink: 0;
  margin-top: 2px;
  opacity: 0.8;
}
.anno-precision-hint {
  top: 50%;
  transform: translate(-50%, -50%);
}
.anno-precision-hint.visible {
  opacity: 1;
  pointer-events: auto;
}

.anno-help-close {
  flex-shrink: 0;
  align-self: flex-start;
  background: none;
  border: none;
  padding: 2px;
  cursor: pointer;
  opacity: 0.6;
  color: inherit;
  line-height: 1;
}
.anno-help-close:hover { opacity: 1; }

/* ---- Right column: photo + thumb strip ---- */
.anno-photo-col {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  border-right: 1px solid var(--border);
}

.anno-photo-main {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

.anno-photo-main img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
  transition: transform 0.05s;
}

.anno-photo-main.repair-mode {
  cursor: crosshair;
}

.anno-photo-main.repair-mode img {
  pointer-events: none;
}

/* Thumbnails strip at bottom of photo col */
.anno-thumbs-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 90px;
  padding: 0 14px calc(var(--safe-bottom));
  background: #f2f2f0;
  border-top: 1px solid var(--border);
  overflow-x: auto;
  flex-shrink: 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.anno-thumbs-strip::-webkit-scrollbar { display: none; }

/* =============================================
   IMPROVEMENT 1 — Active repair badge on photo
   ============================================= */
@keyframes fadeInDown {
  from { opacity: 0; transform: translateX(-50%) translateY(-8px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.anno-active-repair-badge {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  background: #1a6b35;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 50px;
  white-space: nowrap;
  pointer-events: none;
  animation: fadeInDown 0.2s ease;
  box-shadow: 0 2px 8px rgba(21,62,33,0.3);
}

/* =============================================
   IMPROVEMENT 2 — Toast confirmation
   ============================================= */
.anno-toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  background: #1a3d26;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  padding: 9px 20px;
  border-radius: 50px;
  z-index: 1000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  white-space: nowrap;
}

.anno-toast.visible {
  opacity: 1;
}

/* =============================================
   IMPROVEMENT 3 — Undo button
   ============================================= */
.btn-anno-undo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 40px;
  width: 40px;
  height: 52px;
  padding: 0;
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 50px;
  font-size: 18px;
  color: var(--text-light);
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.btn-anno-undo:hover {
  border-color: var(--green);
  color: var(--green);
}

/* =============================================
   IMPROVEMENT 4 — Thumb badges
   ============================================= */
.anno-thumb-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #1a6b35;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  line-height: 1;
}

/* =============================================
   IMPROVEMENT 7 — Collapsible repair categories
   ============================================= */
.anno-repair-category {
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}

.cat-chevron {
  transition: transform 0.2s;
  flex-shrink: 0;
}

.anno-repair-category.open .cat-chevron {
  transform: rotate(0deg);
}

.anno-repair-category:not(.open) .cat-chevron {
  transform: rotate(-90deg);
}

.anno-repair-cat-body {
  overflow: hidden;
}

.anno-repair-cat-body:not(.open) {
  display: none;
}

/* =============================================
   RESPONSIVE OVERRIDES
   ============================================= */
@media (max-width: 480px) {
  .cards-grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
  .step-question { font-size: 20px; }
  .welcome-title { white-space: normal; font-size: clamp(26px, 7vw, 36px); }
}

/* =============================================
   STRIPE PAYMENT POPUP
   ============================================= */
.stripe-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.stripe-overlay.open { opacity: 1; pointer-events: all; }

.stripe-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.96);
  width: calc(100% - 32px);
  max-width: 400px;
  background: var(--white);
  border-radius: 24px;
  padding: 32px 28px 28px;
  z-index: 301;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  box-shadow: 0 20px 60px rgba(0,0,0,0.18);
}
.stripe-modal.open {
  opacity: 1;
  pointer-events: all;
  transform: translate(-50%, -50%) scale(1);
}
.stripe-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-light);
  padding: 4px;
  line-height: 1;
}
.stripe-modal-close:hover { color: var(--text); }
.stripe-modal-title {
  font-family: 'Sora', sans-serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}
.stripe-modal-desc {
  font-size: 14px;
  color: var(--text-light);
  line-height: 1.5;
  margin: 0;
}
.stripe-modal-btn {
  display: block;
  width: 100%;
  text-align: center;
  text-decoration: none;
  padding: 14px;
  border-radius: 50px;
}
.stripe-modal-secure {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-xlight);
  margin: 0;
}

/* =============================================
   OFFLINE BADGE
   ============================================= */
.offline-badge {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #92400e;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  padding: 11px 20px;
  text-align: center;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}
.offline-badge.visible {
  transform: translateY(0);
}

/* =============================================
   RÉCAP DÉTAILLÉ EXPANDABLE
   ============================================= */
.anno-recap-strip {
  cursor: pointer;
  user-select: none;
}
.anno-recap-strip:hover { background: #dff0e4; }

.anno-recap-right {
  display: flex;
  align-items: center;
  gap: 6px;
}
.recap-chevron {
  transition: transform 0.2s;
  flex-shrink: 0;
  opacity: 0.6;
}

.anno-recap-detail {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  background: #f7fbf8;
  border-bottom: 1px solid #c3e0ca;
  flex-shrink: 0;
}
.anno-recap-detail.open {
  max-height: 260px;
  overflow-y: auto;
}
.recap-detail-photo {
  padding: 6px 12px 2px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--green);
  letter-spacing: 0.05em;
}
.recap-detail-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 12px;
  font-size: 12px;
  color: var(--text);
  border-bottom: 1px solid #e8f3eb;
}
.recap-detail-item:last-child { border-bottom: none; }
.recap-detail-price {
  font-weight: 600;
  color: var(--green);
  flex-shrink: 0;
  margin-left: 8px;
}
.recap-detail-label {
  color: var(--text-light);
  font-style: italic;
}

/* =============================================
   MOBILE ANNOTATION — deux modes séquentiels (slide)
   ============================================= */

/* Wrapper transparent au grid sur desktop */
.anno-slides-wrap {
  display: contents;
}

/* Sur desktop : masquer la barre mobile */
@media (min-width: 769px) {
  .anno-mobile-topbar { display: none; }
}

@media (max-width: 768px) {

  /* Grille : colonne unique */
  .anno-layout {
    grid-template-columns: 1fr;
  }

  /* Barre d'instruction : n'affiche que l'étape 1 en mode liste */
  .anno-instruction-bar .anno-instruction-step:last-child,
  .anno-instruction-bar .anno-instruction-sep {
    display: none;
  }

  /* MODE PHOTO : masque la barre d'instruction */
  .anno-layout.photo-mode .anno-instruction-bar {
    display: none;
  }

  /* Slide container */
  .anno-slides-wrap {
    display: flex;
    grid-column: 1 / -1;
    position: relative;
    overflow: hidden;
    flex: 1;
    min-height: 0;
  }

  .anno-photo-col,
  .anno-repairs-col {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: flex !important;
    flex-direction: column;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  /* Mode liste : repairs visible, photo hors écran à droite */
  .anno-repairs-col { transform: translateX(0); border-right: none; }
  .anno-photo-col   { transform: translateX(100%); }

  /* Mode photo : photo visible, repairs hors écran à gauche */
  .anno-layout.photo-mode .anno-photo-col   { transform: translateX(0); }
  .anno-layout.photo-mode .anno-repairs-col { transform: translateX(-100%); }

  /* Barre mobile en haut de la photo */
  .anno-mobile-topbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
  }

  .anno-back-to-list {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--green);
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    white-space: nowrap;
  }

  .anno-mobile-repair-label {
    font-size: 12px;
    color: var(--text-light);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    text-align: center;
  }

  .anno-photo-counter {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-light);
    background: var(--bg);
    padding: 2px 8px;
    border-radius: 20px;
    flex-shrink: 0;
    white-space: nowrap;
  }
}

@media (min-width: 768px) {
  .app-header { padding: 0 40px; }
  .app-header { height: 64px; }
  :root { --header-h: 64px; }
  .step-inner { padding: 56px 40px; }
  .btn-primary { padding: 15px 44px; }
}
