:root {
  --bg-paper: #FAF8F5;
  --bg-linen: #F2EFE9;
  --surface-white: #FFFFFF;
  --border-rule: #DED9CE;
  --text-ink: #121211;
  --text-muted: #57554F;
  --accent: #1E3A2F;
  --accent-hover: #152921;
  --danger: #7A1C1C;
  --font-display: 'Instrument Serif', Georgia, serif;
  --font-sans: 'DM Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --radius-sm: 2px;
  --radius-md: 3px;
  --ease-dry: cubic-bezier(0.2, 0, 0, 1);
}

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

html,
body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-paper);
  color: var(--text-ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.is-embed {
  background-color: var(--surface-white);
}

.page-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 16px 12px 32px;
}

body.is-embed .page-shell {
  min-height: auto;
  padding: 0;
}

.calc-card {
  width: 100%;
  max-width: 640px;
  background-color: var(--surface-white);
  border: 1px solid var(--border-rule);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

body.is-embed .calc-card {
  max-width: 100%;
  border-radius: 0;
}

/* Barre de progression 3px */
.progress-track {
  width: 100%;
  height: 3px;
  background-color: var(--bg-linen);
}

.progress-fill {
  height: 100%;
  width: 20%;
  background-color: var(--accent);
  transition: width 180ms var(--ease-dry);
}

/* En-tête entreprise */
.brand-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 16px;
  background-color: var(--bg-paper);
  border-bottom: 1px solid var(--border-rule);
}

.brand-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--accent);
  color: var(--bg-paper);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background-color: var(--surface-white);
}

.brand-mark.has-logo {
  width: auto;
  max-width: 136px;
  height: 40px;
  padding: 4px 8px;
  background-color: var(--logo-bg, var(--surface-white));
  border: 1px solid var(--border-rule);
}

.brand-mark.has-logo img {
  width: auto;
  max-width: 120px;
  height: 100%;
  object-fit: contain;
  background-color: transparent;
}

.brand-text {
  min-width: 0;
}

.brand-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-meta {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.step-badge {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 6px 8px;
  border: 1px solid var(--border-rule);
  background-color: var(--surface-white);
  border-radius: var(--radius-sm);
  font-variant-numeric: tabular-nums;
}

/* Corps d'étape */
.step-body {
  padding: 24px 16px 24px;
  flex: 1 1 auto;
}

.step-kicker {
  margin: 0 0 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.step-title {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4.5vw, 2.35rem);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.025em;
  color: var(--text-ink);
}

.step-lead {
  margin: 0 0 24px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-muted);
  max-width: 58ch;
}

/* Liste d'options cliquables */
.option-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.option-card {
  width: 100%;
  min-height: 60px;
  padding: 16px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  text-align: left;
  background-color: var(--bg-paper);
  border: 1px solid var(--border-rule);
  border-radius: var(--radius-sm);
  color: var(--text-ink);
  cursor: pointer;
  font-family: var(--font-sans);
  transition: background-color 120ms var(--ease-dry), border-color 120ms var(--ease-dry);
}

.option-card:hover {
  background-color: var(--bg-linen);
  border-color: #C7C0B2;
}

.option-card:active {
  background-color: var(--bg-linen);
}

.option-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.option-card.is-selected {
  background-color: var(--surface-white);
  border-color: var(--accent);
  box-shadow: inset 3px 0 0 0 var(--accent);
}

.option-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-rule);
  background-color: var(--surface-white);
  border-radius: var(--radius-sm);
  color: var(--accent);
}

.option-card.is-selected .option-icon {
  background-color: var(--accent);
  border-color: var(--accent);
  color: var(--bg-paper);
}

.option-content {
  flex: 1 1 auto;
  min-width: 0;
}

.option-code {
  display: block;
  margin-bottom: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.option-title {
  display: block;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-ink);
}

.option-desc {
  display: block;
  margin-top: 4px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text-muted);
}

.option-check {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  flex-shrink: 0;
  border: 1px solid var(--border-rule);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--surface-white);
  color: transparent;
}

.option-card.is-selected .option-check {
  border-color: var(--accent);
  background-color: var(--accent);
  color: var(--bg-paper);
}

/* Étape 2 : Dimensionnement */
.dimension-box {
  background-color: var(--bg-paper);
  border: 1px solid var(--border-rule);
  border-radius: var(--radius-sm);
  padding: 24px 16px;
}

.dimension-readout-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 24px;
}

.dimension-value-wrap {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.dimension-number {
  font-family: var(--font-display);
  font-size: 48px;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--text-ink);
  font-variant-numeric: tabular-nums;
}

.dimension-unit {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-muted);
  text-transform: uppercase;
}

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

.stepper-btn {
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--surface-white);
  border: 1px solid var(--border-rule);
  border-radius: var(--radius-sm);
  color: var(--text-ink);
  font-family: var(--font-mono);
  font-size: 20px;
  cursor: pointer;
  transition: background-color 120ms var(--ease-dry), border-color 120ms var(--ease-dry);
}

.stepper-btn:hover:not(:disabled) {
  background-color: var(--bg-linen);
  border-color: var(--accent);
}

.stepper-btn:active:not(:disabled) {
  background-color: var(--bg-linen);
}

.stepper-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.stepper-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Slider tactile personnalisé */
.slider-wrap {
  padding: 8px 0;
}

.range-input {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 44px;
  background: transparent;
  cursor: pointer;
  margin: 0;
}

.range-input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.range-input::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: var(--radius-sm);
  background: linear-gradient(
    to right,
    var(--accent) 0%,
    var(--accent) var(--slider-pct, 25%),
    var(--border-rule) var(--slider-pct, 25%),
    var(--border-rule) 100%
  );
}

.range-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 28px;
  height: 28px;
  margin-top: -11px;
  border-radius: 50%;
  background-color: var(--accent);
  border: 2px solid var(--surface-white);
  box-shadow: 0 0 0 1px var(--accent);
}

.range-input::-moz-range-track {
  height: 6px;
  border-radius: var(--radius-sm);
  background: var(--border-rule);
}

.range-input::-moz-range-progress {
  height: 6px;
  border-radius: var(--radius-sm);
  background: var(--accent);
}

.range-input::-moz-range-thumb {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: var(--accent);
  border: 2px solid var(--surface-white);
  box-shadow: 0 0 0 1px var(--accent);
}

.slider-bounds {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  margin-bottom: 16px;
}

.preset-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.preset-chip {
  min-height: 48px;
  padding: 8px 4px;
  background-color: var(--surface-white);
  border: 1px solid var(--border-rule);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-ink);
  cursor: pointer;
  font-variant-numeric: tabular-nums;
  transition: background-color 120ms var(--ease-dry), border-color 120ms var(--ease-dry), color 120ms var(--ease-dry);
}

.preset-chip:hover {
  background-color: var(--bg-linen);
}

.preset-chip:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.preset-chip.is-selected {
  background-color: var(--accent);
  border-color: var(--accent);
  color: var(--bg-paper);
}

/* Étape 5 : Formulaire lead */
.summary-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 12px 16px;
  margin-bottom: 24px;
  background-color: var(--bg-linen);
  border: 1px solid var(--border-rule);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-ink);
  font-variant-numeric: tabular-nums;
}

.lead-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

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

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

.field-input {
  width: 100%;
  min-height: 48px;
  padding: 12px;
  background-color: var(--bg-paper);
  border: 1px solid var(--border-rule);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 16px;
  color: var(--text-ink);
  transition: border-color 120ms var(--ease-dry), background-color 120ms var(--ease-dry);
}

.field-input:focus {
  outline: none;
  background-color: var(--surface-white);
  border-color: var(--accent);
}

.field-input.is-invalid {
  border-color: var(--danger);
}

.field-error {
  font-size: 12px;
  color: var(--danger);
  min-height: 16px;
}

.rgpd-box {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 48px;
  padding: 12px;
  background-color: var(--bg-paper);
  border: 1px solid var(--border-rule);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.rgpd-box.is-invalid {
  border-color: var(--danger);
}

.rgpd-checkbox {
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  flex-shrink: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.rgpd-text {
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-muted);
}

.form-alert {
  padding: 12px 16px;
  border: 1px solid var(--danger);
  background-color: #FDF5F5;
  color: var(--danger);
  font-size: 14px;
  border-radius: var(--radius-sm);
}

.honeypot-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* Écran de résultat */
.result-panel {
  padding: 24px 16px;
  background-color: var(--bg-paper);
  border: 1px solid var(--border-rule);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}

.result-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.result-range {
  font-family: var(--font-display);
  font-size: clamp(2rem, 6vw, 2.75rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  margin-bottom: 12px;
}

.result-disclaimer {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text-ink);
}

.result-grid {
  display: grid;
  grid-template-columns: 1fr;
  border-top: 1px solid var(--border-rule);
  margin-top: 24px;
}

.result-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-rule);
  font-size: 14px;
}

.result-row dt {
  color: var(--text-muted);
}

.result-row dd {
  margin: 0;
  font-weight: 600;
  color: var(--text-ink);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.result-confirm {
  margin-top: 16px;
  padding: 12px 16px;
  background-color: var(--bg-linen);
  border: 1px solid var(--border-rule);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-ink);
}

/* Barre d'actions inférieure */
.action-bar {
  position: sticky;
  bottom: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background-color: var(--surface-white);
  border-top: 1px solid var(--border-rule);
}

.btn {
  min-height: 52px;
  padding: 12px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color 120ms var(--ease-dry), border-color 120ms var(--ease-dry), opacity 120ms var(--ease-dry);
}

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn-primary {
  flex: 1 1 auto;
  background-color: var(--accent);
  color: var(--bg-paper);
}

.btn-primary:hover:not(:disabled) {
  background-color: var(--accent-hover);
}

.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-secondary {
  background-color: var(--bg-paper);
  border-color: var(--border-rule);
  color: var(--text-ink);
}

.btn-secondary:hover:not(:disabled) {
  background-color: var(--bg-linen);
}

.btn-secondary.is-hidden {
  display: none;
}

.shell-note {
  margin: 16px 0 0;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  text-align: center;
}

body.is-embed .shell-note {
  display: none;
}

@media (min-width: 640px) {
  .page-shell {
    padding: 32px 24px 48px;
  }

  .brand-bar {
    padding: 16px 24px;
  }

  .step-body {
    padding: 32px 24px;
  }

  .action-bar {
    position: static;
    padding: 16px 24px;
  }

  .field-grid {
    grid-template-columns: 1fr 1fr;
  }
}
