/* Polices auto-hébergées (licence SIL OFL) : aucun appel à Google Fonts */
@font-face { font-family: "Inter"; src: url("../fonts/inter-latin.woff2") format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Archivo"; src: url("../fonts/archivo-latin.woff2") format("woff2"); font-weight: 600 800; font-style: normal; font-display: swap; }

:root {
    --navy: #0b3b6f;
    --navy-dark: #082c54;
    --navy-soft: #e6edf6;
    --on-navy: #ffffff;
    --on-navy-muted: #c9d7e8;
    --highlight: #ffc285;
    --cta: #c2410c;
    --cta-hover: #a8380a;
    --text: #16202e;
    --text-2: #344050;
    --muted: #4a5462;
    --subtle: #5b6472;
    --placeholder: #6b7380;
    --border: #c5ccd6;
    --divider: #e3e7ed;
    --bg: #eef1f5;
    --card: #ffffff;
    --error: #b42318;
    --success: #157347;
    --radius: 14px;
    --radius-sm: 8px;
    --shadow: 0 1px 2px rgba(16, 32, 46, .06), 0 8px 24px rgba(16, 32, 46, .06);
    --font-display: "Archivo", system-ui, sans-serif;
    --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font-body); font-size: 16px; line-height: 1.5; color: var(--text); background: var(--bg); }
body.is-embed { background: transparent; }
a { color: var(--navy); }
a:hover { color: var(--navy-dark); }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.is-embed .wrap { padding: 0 4px; }
.icon { flex-shrink: 0; }

/* --- En-tête ------------------------------------------------------------- */
.site-header { background: var(--navy); color: var(--on-navy); }
.site-header-inner { display: flex; align-items: center; gap: 8px 24px; padding-top: 14px; padding-bottom: 14px; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-icon { color: #ffb35c; }
.brand-name { font-family: var(--font-display); font-weight: 800; font-size: 18px; letter-spacing: .04em; line-height: 1.2; }
.brand-tagline { font-size: 13px; color: var(--on-navy-muted); }
.header-phone { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--on-navy); font-weight: 600; text-decoration: none; }
.header-phone:hover { color: var(--on-navy); text-decoration: underline; }

/* --- Introduction -------------------------------------------------------- */
.hero { padding-top: 48px; padding-bottom: 28px; }
.hero h1 { margin: 0 0 10px; font-family: var(--font-display); font-weight: 800; font-size: 40px; line-height: 1.1; color: var(--navy); }
.hero p { margin: 0; max-width: 640px; font-size: 17px; line-height: 1.55; color: var(--muted); }
.is-embed .hero { padding-top: 8px; padding-bottom: 20px; }
.is-embed .hero h1 { font-size: 30px; }

/* --- Mise en page -------------------------------------------------------- */
.layout { padding-bottom: 64px; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.form-card { padding: 32px; display: flex; flex-direction: column; gap: 32px; }
.aside { display: none; }

@media (min-width: 960px) {
    .layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
    .aside { display: flex; flex-direction: column; gap: 20px; position: sticky; top: 24px; }
    .estimate--inline { display: none !important; }
}

/* --- Formulaire ---------------------------------------------------------- */
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
legend { padding: 0; margin-bottom: 18px; display: flex; align-items: center; gap: 12px; font-family: var(--font-display); font-weight: 700; font-size: 20px; color: var(--navy); }
.step { width: 30px; height: 30px; border-radius: 50%; background: var(--navy); color: var(--on-navy); font-size: 15px; display: inline-flex; align-items: center; justify-content: center; }
.sep { border: 0; height: 1px; background: var(--divider); margin: 0; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field-label { font-weight: 600; font-size: 14px; }
.req { color: var(--error); }

input[type=text], input[type=email], input[type=tel], input[type=number], input[type=date], textarea {
    width: 100%; min-height: 46px; padding: 11px 14px; font: inherit; font-size: 16px; color: var(--text);
    background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm);
}
input::placeholder, textarea::placeholder { color: var(--placeholder); }
textarea { resize: vertical; }
input:focus-visible, textarea:focus-visible { outline: 2px solid var(--navy); outline-offset: 1px; border-color: var(--navy); }
.has-error input, .has-error textarea { border-color: var(--error); }

.help { margin: 0; font-size: 13px; color: var(--subtle); display: flex; align-items: center; gap: 6px; }
.help.is-auto { color: var(--success); }
.help.is-auto::before {
    content: ""; width: 15px; height: 15px; flex-shrink: 0; background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E") center / contain no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E") center / contain no-repeat;
}
.errors { list-style: none; margin: 0; padding: 0; color: var(--error); font-size: 14px; }
.form-card > .errors { background: #fef3f2; border: 1px solid #fecdca; padding: 12px 14px; border-radius: var(--radius-sm); }

.grid-2 { display: grid; gap: 18px; }
@media (min-width: 600px) { .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Trajet départ → livraison */
.route { display: flex; gap: 14px; }
.route-line { display: flex; flex-direction: column; align-items: center; gap: 4px; padding-top: 40px; padding-bottom: 17px; }
.route-start, .route-end { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.route-start { border: 3px solid var(--navy); }
.route-end { background: var(--cta); }
.route-dots { flex: 1; width: 2px; background: repeating-linear-gradient(#9aa6b5 0 4px, transparent 4px 8px); }
.route-fields { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.route-stop { display: grid; gap: 18px; }
@media (min-width: 600px) { .route-stop { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); } }
.field-city { position: relative; }

/* Suggestions de villes */
.suggestions { position: absolute; z-index: 10; left: 0; right: 0; top: 100%; margin: 4px 0 0; padding: 0; list-style: none; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: 0 6px 18px rgba(16, 32, 46, .12); overflow: hidden; }
.suggestions li { display: flex; align-items: center; gap: 10px; padding: 12px 14px; font-size: 15px; cursor: pointer; border-top: 1px solid var(--divider); }
.suggestions li:first-child { border-top: 0; }
.suggestions li .icon { color: var(--subtle); }
.suggestions li[aria-selected=true], .suggestions li:hover { background: var(--navy-soft); }
.suggestions li[aria-selected=true] .icon { color: var(--navy); }

/* Unités en pastilles */
.qty-unit { display: grid; grid-template-columns: minmax(96px, 180px) minmax(0, 1fr); gap: 12px 18px; align-items: start; }
.pills { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 600px) { .pills { display: flex; flex-wrap: wrap; } }
@media (max-width: 599px) {
    .qty-unit { grid-template-columns: 88px minmax(0, 1fr); gap: 12px; }
    .pills { gap: 6px; }
    .pill { padding: 0 4px; font-size: 14px; white-space: nowrap; }
}
@media (max-width: 359px) {
    .qty-unit { grid-template-columns: 76px minmax(0, 1fr); gap: 8px; }
    .pills { gap: 4px; }
    .pill { font-size: 12px; }
}
.pill-input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.pill { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--border); background: #fff; color: var(--text); font-size: 15px; font-weight: 600; cursor: pointer; user-select: none; }
.pill:hover { border-color: var(--navy); }
.pill-input:checked + .pill { background: var(--navy); border-color: var(--navy); color: var(--on-navy); }
.pill-input:focus-visible + .pill { outline: 2px solid var(--navy); outline-offset: 2px; }

/* Consentement + envoi */
.submit-zone { display: flex; flex-direction: column; gap: 18px; }
.field-checkbox label { display: flex; gap: 12px; align-items: flex-start; font-weight: 400; font-size: 14px; line-height: 1.5; color: var(--text-2); cursor: pointer; }
.field-checkbox input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--navy); flex-shrink: 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 54px; padding: 0 24px; border: 0; border-radius: 10px; background: var(--cta); color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 18px; letter-spacing: .01em; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--cta-hover); color: #fff; }
.btn:focus-visible { outline: 3px solid var(--navy); outline-offset: 2px; }
.btn[disabled] { opacity: .7; cursor: wait; }
.btn-secondary { width: auto; min-height: 48px; font-size: 16px; background: var(--navy); }
.btn-secondary:hover { background: var(--navy-dark); }
.legal { margin: 0; font-size: 13px; color: var(--subtle); }
.hp { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }

/* --- Estimation ---------------------------------------------------------- */
.estimate { background: var(--navy); color: var(--on-navy); border-radius: var(--radius); padding: 28px; display: flex; flex-direction: column; gap: 6px; transition: opacity .15s; }
.estimate.is-loading { opacity: .75; }
.estimate-label { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--highlight); margin-bottom: 8px; }
.estimate-amount { font-family: var(--font-display); font-weight: 800; font-size: 52px; line-height: 1; }
.estimate-amount small { font-family: var(--font-body); font-size: 15px; font-weight: 400; color: var(--on-navy-muted); }
.estimate-ttc { font-size: 15px; color: var(--on-navy-muted); }
.estimate-lines { margin: 12px 0 0; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, .18); display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.estimate-lines > div { display: flex; justify-content: space-between; gap: 12px; }
.estimate-lines dt { color: var(--on-navy-muted); }
.estimate-lines dd { margin: 0; white-space: nowrap; }
.estimate-lines .estimate-minimum { color: var(--highlight); }
.estimate-empty { margin: 12px 0 0; font-size: 14px; color: var(--on-navy-muted); }
.estimate-note { margin: 12px 0 0; font-size: 13px; line-height: 1.5; color: var(--on-navy-muted); }

.estimate--inline { display: none; padding: 20px; border-radius: 12px; }
.estimate--inline.is-visible { display: flex; }
.estimate--inline .estimate-amount { font-size: 40px; }
.estimate--inline .estimate-note { font-size: 12px; margin-top: 8px; }

/* --- Colonne « Comment ça marche ? » -------------------------------------- */
.how { padding: 24px; }
.how h2 { margin: 0 0 16px; font-family: var(--font-display); font-weight: 700; font-size: 17px; color: var(--navy); }
.how ol { margin: 0; padding: 0; list-style: none; counter-reset: how; display: flex; flex-direction: column; gap: 16px; }
.how li { counter-increment: how; display: flex; gap: 12px; align-items: flex-start; font-size: 14px; line-height: 1.5; }
.how li::before { content: counter(how); flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--navy-soft); color: var(--navy); font-weight: 700; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; }

/* --- Remerciement -------------------------------------------------------- */
.thanks-wrap { padding-top: 48px; padding-bottom: 64px; }
.thanks { max-width: 640px; margin: 0 auto; padding: 40px 32px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.thanks h1 { margin: 0 0 4px; font-family: var(--font-display); font-weight: 800; font-size: 30px; line-height: 1.15; color: var(--navy); }
.thanks p { margin: 8px 0; color: var(--muted); }
.thanks-ref strong { color: var(--text); letter-spacing: .03em; }
.thanks-check { width: 60px; height: 60px; margin-bottom: 14px; border-radius: 50%; background: var(--success); color: #fff; display: flex; align-items: center; justify-content: center; }
.thanks .estimate { width: 100%; margin: 16px 0 8px; text-align: left; }

/* --- Pied de page -------------------------------------------------------- */
.site-footer { padding: 0 16px 32px; text-align: center; font-size: 13px; color: var(--subtle); }

/* --- Téléphone ----------------------------------------------------------- */
@media (max-width: 599px) {
    .wrap { padding: 0 12px; }
    .site-header-inner { padding-left: 16px; padding-right: 16px; }
    .brand-name { font-size: 15px; }
    .brand-tagline, .header-phone-number { display: none; }
    .header-phone { width: 44px; height: 44px; justify-content: center; border-radius: 50%; background: rgba(255, 255, 255, .12); }
    .hero { padding: 26px 16px 18px; }
    .hero h1 { font-size: 30px; line-height: 1.12; }
    .hero p { font-size: 15px; }
    .form-card { padding: 22px 16px; gap: 26px; }
    legend { font-size: 18px; }
    .route-line { display: none; }
    .thanks { padding: 32px 18px; }
    .thanks h1 { font-size: 24px; }
}
