/* M2C atelier3D — direction artistique « Hexagone » */
:root {
  --bg: #F4F1EA;        /* crème */
  --paper: #FBFAF6;     /* cartes */
  --ink: #16181D;       /* anthracite */
  --muted: #5A5750;     /* texte secondaire (contraste AA sur crème) */
  --line: #D9D4C8;
  --accent: #E0561A;    /* orange filament (décor, grands éléments) */
  --accent-ink: #A83E0C;/* orange foncé pour petits textes */
  --error: #B42318;
  --radius: 14px;
  --font: 'Space Grotesk', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
}
.wrap { width: min(1040px, 100% - 40px); margin-inline: auto; }
.mono { font-family: var(--mono); font-weight: 500; letter-spacing: .02em; }
.accent { color: var(--accent); }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.hp { position: absolute; left: -9999px; }

/* ---------- En-tête ---------- */
.hero { padding: 56px 0 40px; border-bottom: 2px solid var(--ink); }
.hero__inner { display: flex; flex-wrap: wrap; gap: 48px; align-items: center; }
.brand { display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; flex: 0 0 auto; }
.brand__hex { width: 168px; height: 168px; }
.brand__word { font-family: var(--mono); font-weight: 500; font-size: 18px; letter-spacing: .5em; padding-left: .5em; }
.hero__text { flex: 1 1 420px; min-width: 0; }
.eyebrow { font-family: var(--mono); font-size: 14px; letter-spacing: .2em; text-transform: uppercase; color: var(--accent-ink); margin: 0 0 8px; }
h1 { font-size: clamp(34px, 5vw, 52px); line-height: 1.05; letter-spacing: -.02em; margin: 0 0 16px; }
.lead { font-size: 19px; color: var(--muted); margin: 0 0 22px; max-width: 58ch; }
.specs { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.specs li { border: 1.5px dashed var(--accent); border-radius: 999px; padding: 6px 14px; font-size: 15px; background: var(--paper); }

/* ---------- Formulaire ---------- */
.form { padding: 40px 0 24px; display: flex; flex-direction: column; gap: 28px; }
.step {
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  padding: clamp(20px, 4vw, 36px);
  box-shadow: 6px 6px 0 var(--ink);
}
.step h2 { display: flex; align-items: center; gap: 14px; font-size: clamp(22px, 3vw, 28px); margin: 0 0 6px; letter-spacing: -.01em; }
.step__num {
  font-family: var(--mono); font-size: 15px; color: var(--paper); background: var(--ink);
  width: 44px; height: 40px; display: inline-grid; place-items: center; flex: 0 0 auto;
  clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
}
.hint { color: var(--muted); margin: 0 0 18px; font-size: 15px; }
.note { margin: 6px 0 0; padding: 12px 16px; border-left: 0; background: #FFF4EC; border: 1.5px dashed var(--accent); border-radius: 10px; font-size: 15px; }

fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend, .label, .field > label { display: block; font-weight: 500; margin-bottom: 8px; }
.req { color: var(--accent-ink); }
.opt { color: var(--muted); font-weight: 400; font-size: 14px; }

.field { margin-top: 18px; display: flex; flex-direction: column; min-width: 0; }
.row { display: flex; flex-wrap: wrap; gap: 0 20px; }
.row > .field { flex: 1 1 260px; }
.row > .field--small { flex: 0 1 140px; }

input[type=text], input[type=email], input[type=tel], input[type=url], input[type=number], input[type=date], select, textarea {
  font: inherit; color: var(--ink); width: 100%;
  background: #fff; border: 1.5px solid var(--ink); border-radius: 10px;
  padding: 12px 14px; min-height: 48px;
}
textarea { resize: vertical; min-height: 130px; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 40px; }
input:focus-visible, select:focus-visible, textarea:focus-visible, .tile:has(input:focus-visible), .pill:has(input:focus-visible), .drop:has(input:focus-visible), .btn:focus-visible {
  outline: 3px solid var(--accent); outline-offset: 2px;
}
::placeholder { color: #8A867D; }
.dims { display: flex; align-items: center; gap: 8px; }
.dims input { flex: 1 1 0; min-width: 0; }
.dims span { color: var(--muted); }

/* Tuiles (services, matières) */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.tiles--4 { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); margin-top: 18px; }
.tiles--4 > legend { grid-column: 1 / -1; }
.tile {
  position: relative; cursor: pointer; display: flex; flex-direction: column; gap: 4px;
  padding: 18px 16px 16px; border: 1.5px solid var(--ink); border-radius: 12px; background: #fff;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.tile:hover { transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--ink); }
.tile input { position: absolute; opacity: 0; pointer-events: none; }
.tile svg { width: 30px; height: 30px; fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 6px; }
.tile__title { font-weight: 700; font-size: 17px; }
.tile__desc { font-size: 14px; color: var(--muted); line-height: 1.4; }
.tile::after {
  content: ""; position: absolute; top: 12px; right: 12px; width: 18px; height: 18px;
  border: 1.5px solid var(--ink); border-radius: 5px; background: #fff;
}
.tile:has(input[type=radio])::after { border-radius: 50%; }
.tile:has(input:checked) { background: #FFF4EC; box-shadow: 4px 4px 0 var(--accent); border-color: var(--accent); }
.tile:has(input:checked)::after { background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12l5 5 9-10' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/14px no-repeat; border-color: var(--accent); }
.tile:has(input:checked) svg { stroke: var(--accent-ink); }

/* Pastilles */
.pills { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.pills > legend { width: 100%; }
.pill {
  cursor: pointer; display: inline-flex; align-items: center; gap: 8px; min-height: 44px;
  padding: 8px 16px; border: 1.5px solid var(--ink); border-radius: 999px; background: #fff; font-size: 15px;
}
.pill input { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; }
.pill:has(input:checked) { background: var(--ink); color: var(--paper); }
.cond { margin-top: 4px; }

/* Envois de fichiers */
.uploads { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.drop {
  cursor: pointer; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 4px;
  min-height: 120px; padding: 16px; text-align: center; border: 2px dashed var(--ink); border-radius: 12px; background: #fff;
  background-size: cover; background-position: center; position: relative; overflow: hidden;
}
.drop:hover { border-color: var(--accent); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop__title { font-family: var(--mono); font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.drop__file { font-weight: 500; font-size: 15px; word-break: break-word; }
.drop.has-file { border-style: solid; border-color: var(--accent); }
.drop.has-file .drop__title, .drop.has-file .drop__file { background: rgba(251, 250, 246, .92); padding: 2px 8px; border-radius: 6px; }
.drop--wide { min-height: 84px; flex-direction: row; gap: 12px; }

/* Curseur de budget */
.field > label[for=budget-range] { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.budget__value { font-size: 16px; color: var(--paper); background: var(--ink); padding: 2px 10px; border-radius: 8px; white-space: nowrap; }
.range { -webkit-appearance: none; appearance: none; width: 100%; height: 44px; background: transparent; margin: 4px 0 0; cursor: pointer; }
.range::-webkit-slider-runnable-track { height: 8px; border-radius: 999px; border: 1.5px solid var(--ink); background: linear-gradient(to right, var(--accent) var(--fill, 9%), #fff var(--fill, 9%)); }
.range::-moz-range-track { height: 8px; border-radius: 999px; border: 1.5px solid var(--ink); background: #fff; }
.range::-moz-range-progress { height: 8px; border-radius: 999px; background: var(--accent); }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; margin-top: -10px; background: var(--ink); border: 3px solid var(--paper); clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%); }
.range::-moz-range-thumb { width: 24px; height: 24px; background: var(--ink); border: 0; border-radius: 0; clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%); }
.range:disabled { opacity: .35; cursor: not-allowed; }
.budget__scale { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.pill--inline { align-self: flex-start; }
.budget--off .budget__value { background: var(--muted); }

/* Envoi */
.send { display: flex; flex-direction: column; gap: 16px; align-items: flex-start; padding: 8px 0 0; }
.consent { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; max-width: 70ch; cursor: pointer; }
.consent input { accent-color: var(--accent); width: 20px; height: 20px; margin: 2px 0 0; flex: 0 0 auto; }
.btn {
  font: inherit; font-weight: 700; font-size: 18px; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; gap: 12px; min-height: 56px; padding: 14px 28px;
  color: var(--paper); background: var(--ink); border: 2px solid var(--ink); border-radius: 12px;
  box-shadow: 5px 5px 0 var(--accent); transition: transform .12s ease, box-shadow .12s ease;
}
.btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.btn:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--accent); }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--accent); }
.btn[disabled] { opacity: .7; cursor: progress; transform: none; }
.btn--ghost { background: transparent; color: var(--ink); }

.error { color: var(--error); font-size: 14px; font-weight: 500; margin: 8px 0 0; }
.error--global { font-size: 15px; }
.is-invalid { border-color: var(--error) !important; box-shadow: 0 0 0 2px rgba(180, 35, 24, .15); }

/* Merci */
.thanks { text-align: center; padding: 72px 20px 96px; display: flex; flex-direction: column; align-items: center; gap: 8px; outline: none; }
.thanks__hex { width: 120px; height: 120px; color: var(--ink); margin-bottom: 12px; }
.thanks h2 { font-size: clamp(28px, 4vw, 40px); margin: 0; }
.thanks p { color: var(--muted); max-width: 46ch; margin: 0 0 20px; }

/* Pied de page */
.foot { border-top: 2px solid var(--ink); margin-top: 48px; padding: 24px 0 32px; font-size: 14px; color: var(--muted); }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }
.foot .mono { color: var(--ink); letter-spacing: .3em; }

@media (max-width: 560px) {
  body { font-size: 16px; }
  .hero { padding-top: 36px; }
  .hero__inner { gap: 24px; justify-content: center; }
  .brand__hex { width: 128px; height: 128px; }
  .step { box-shadow: 4px 4px 0 var(--ink); }
  .btn { width: 100%; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
