/* ══════════════════════════════════════════════════════════════════════════════
   ESTIMATION — formulaire en 3 étapes
   ══════════════════════════════════════════════════════════════════════════════ */

:root {
    --est-ink: #1d2433;
    --est-muted: #5f6675;
    --est-line: #d9dce3;
    --est-line-strong: #a9aebb;
    --est-soft: #f4f5f8;
    --est-primary: #012c69;
    --est-primary-hover: #164a88;
    --est-gold: #bba25c;
}

/* ── En-tête ─────────────────────────────────────────────────────────────── */

#estimHero {
    padding: 64px 24px 120px;
    background: var(--est-primary);
    color: #fff;
    text-align: center;
}

.estimKicker {
    margin: 0 0 14px;
    font-size: 1.3rem;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--est-gold);
}

#estimHero h1 {
    margin: 0 0 14px;
    font-size: clamp(3rem, 4vw, 4.4rem);
    font-weight: 500;
    line-height: 1.15;
    color: #fff;
}

#estimHero > p:last-child {
    max-width: 620px;
    margin: 0 auto;
    font-size: 1.7rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, .85);
}

/* ── Carte formulaire ────────────────────────────────────────────────────── */

#estimSection {
    padding: 0 16px 72px;
    background: linear-gradient(var(--est-primary) 0 88px, var(--est-soft) 88px);
}

.estimCard {
    max-width: 820px;
    margin: -88px auto 0;
    padding: 36px 44px 40px;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 20px 56px rgba(16, 24, 40, .14);
    color: var(--est-ink);
    text-align: left;
}

/* Progression */
.estimSteps {
    display: flex;
    gap: 8px;
    margin: 0 0 32px;
    padding: 0;
    list-style: none;
    counter-reset: none;
}

.estimSteps li {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 12px;
    border-top: 3px solid var(--est-line);
    font-size: 1.4rem;
    color: var(--est-muted);
}

.estimSteps li span {
    display: inline-grid;
    place-items: center;
    width: 26px;
    height: 26px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--est-soft);
    font-size: 1.3rem;
    font-weight: 600;
}

.estimSteps li.is-current,
.estimSteps li.is-done {
    border-top-color: var(--est-primary);
    color: var(--est-ink);
}

.estimSteps li.is-current {
    font-weight: 600;
}

.estimSteps li.is-current span,
.estimSteps li.is-done span {
    background: var(--est-primary);
    color: #fff;
}

.estimSteps[hidden] {
    display: none;
}

/* Étapes */
.estimStep {
    margin: 0;
    padding: 0;
    border: 0;
    min-width: 0;
}

.estimStep[hidden] {
    display: none;
}

.estimLabel,
.estimFieldLabel,
.estimField label {
    display: block;
    margin: 0 0 10px;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--est-ink);
}

.estimLabel {
    margin-top: 28px;
    font-size: 1.6rem;
}

.estimStep > .estimLabel:first-of-type {
    margin-top: 0;
}

.estimField label span[aria-hidden],
.estimFieldLabel span[aria-hidden] {
    color: var(--est-gold);
}

.estimOpt {
    font-weight: 400;
    color: var(--est-muted);
}

/* Tuiles (radios) */
.estimTiles {
    display: grid;
    gap: 12px;
}

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

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

.estimTiles--4 {
    grid-template-columns: repeat(4, 1fr);
}

.estimTile {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px 18px;
    border: 1px solid var(--est-line-strong);
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    transition: border-color .15s, background .15s, box-shadow .15s;
}

.estimTile--ico {
    align-items: center;
    gap: 10px;
    padding: 18px 10px;
    text-align: center;
}

.estimTile svg {
    width: 28px;
    height: 28px;
    color: var(--est-ink);
}

.estimTile strong {
    font-size: 1.5rem;
    font-weight: 600;
}

.estimTile small {
    font-size: 1.3rem;
    color: var(--est-muted);
}

.estimTile input,
.estimChip input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.estimTile:hover {
    border-color: var(--est-ink);
}

.estimTile:has(input:checked) {
    border: 2px solid var(--est-primary);
    background: #f1f5fb;
    padding: 15px 17px;
}

.estimTile--ico:has(input:checked) {
    padding: 17px 9px;
}

.estimTile:has(input:focus-visible),
.estimChip:has(input:focus-visible) {
    outline: 2px solid var(--est-primary);
    outline-offset: 2px;
}

.estimStep.is-checked .estimTiles:has(input:invalid) .estimTile,
.estimStep.is-checked .estimChips:has(input:invalid) .estimChip span {
    border-color: #b42318;
}

/* Champs */
.estimGrid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px 16px;
}

.estimField {
    min-width: 0;
}

.estimField--full {
    grid-column: 1 / -1;
}

.estimField--spaced {
    margin-top: 28px;
}

.estimField[hidden] {
    display: none;
}

.estimField input,
.estimField textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--est-line-strong);
    border-radius: 10px;
    background: #fff;
    font: inherit;
    font-size: 1.5rem;
    color: var(--est-ink);
    transition: border-color .15s, box-shadow .15s;
}

.estimField input {
    height: 48px;
}

.estimField textarea {
    min-height: 96px;
    resize: vertical;
}

.estimField input::placeholder,
.estimField textarea::placeholder {
    color: #9097a5;
}

.estimField input:focus,
.estimField textarea:focus {
    border-color: var(--est-primary);
    outline: 0;
    box-shadow: 0 0 0 3px rgba(1, 44, 105, .12);
}

.estimStep.is-checked .estimField input:invalid {
    border-color: #b42318;
}

.estimUnit {
    position: relative;
}

.estimUnit input {
    padding-right: 48px;
}

.estimUnit span {
    position: absolute;
    top: 50%;
    right: 16px;
    transform: translateY(-50%);
    font-size: 1.5rem;
    color: var(--est-muted);
}

/* Pastilles pièces */
.estimChips {
    display: flex;
    gap: 8px;
}

.estimChip {
    position: relative;
    flex: 1;
    cursor: pointer;
}

.estimChip span {
    display: grid;
    place-items: center;
    height: 48px;
    border: 1px solid var(--est-line-strong);
    border-radius: 10px;
    font-size: 1.5rem;
    transition: border-color .15s, background .15s, color .15s;
}

.estimChip:hover span {
    border-color: var(--est-ink);
}

.estimChip input:checked + span {
    border-color: var(--est-primary);
    background: var(--est-primary);
    color: #fff;
    font-weight: 600;
}

/* Récapitulatif + RGPD */
.estimRecap {
    margin-top: 28px;
    padding: 16px 18px;
    border-radius: 12px;
    background: var(--est-soft);
    font-size: 1.4rem;
}

.estimRecap p {
    margin: 0;
}

.estimRecap-title {
    margin-bottom: 4px !important;
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--est-muted);
}

.estimRecap-adresse {
    color: var(--est-muted);
}

.estimRgpd {
    margin: 18px 0 0;
    font-size: 1.25rem;
    line-height: 1.5;
    color: var(--est-muted);
}

.estimRgpd a {
    color: var(--est-primary);
    text-decoration: underline;
}

/* Erreur */
.estimErreur {
    margin: 24px 0 0;
    padding: 10px 14px;
    border-radius: 10px;
    background: #fef3f2;
    font-size: 1.4rem;
    color: #b42318;
}

.estimErreur[hidden] {
    display: none;
}

/* Navigation */
.estimNav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--est-line);
}

.estimBtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 50px;
    padding: 0 28px;
    border-radius: 999px;
    font: inherit;
    font-size: 1.6rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s;
}

.estimBtn[hidden] {
    display: none;
}

.estimBtn--primary {
    margin-left: auto;
    border: 0;
    background: var(--est-primary);
    color: #fff;
}

.estimBtn--primary:hover {
    background: var(--est-primary-hover);
}

.estimBtn--primary:disabled {
    opacity: .6;
    cursor: wait;
}

.estimBtn--ghost {
    padding: 0 8px;
    border: 0;
    background: transparent;
    color: var(--est-ink);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.estimBtn:focus-visible {
    outline: 2px solid var(--est-primary);
    outline-offset: 2px;
}

/* Confirmation */
#estimConfirm {
    padding: 24px 0 8px;
    text-align: center;
}

#estimConfirm[hidden] {
    display: none;
}

#estimConfirm svg {
    width: 60px;
    height: 60px;
    margin-bottom: 16px;
    color: #12805c;
}

#estimConfirm h2 {
    margin: 0 0 10px;
    font-size: 2.4rem;
    font-weight: 600;
    color: var(--est-ink);
}

#estimMsg {
    max-width: 440px;
    margin: 0 auto 20px;
    font-size: 1.6rem;
    line-height: 1.6;
    color: var(--est-muted);
}

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 760px) {
    #estimHero {
        padding: 40px 20px 100px;
    }

    .estimCard {
        padding: 24px 20px 28px;
    }

    .estimSteps li {
        font-size: 0;
        gap: 0;
    }

    .estimSteps li.is-current {
        flex: 2.4;
        font-size: 1.3rem;
        gap: 8px;
        line-height: 1.2;
        white-space: nowrap;
    }

    .estimKicker {
        line-height: 1.5;
    }

    .estimTiles--3,
    .estimTiles--2,
    .estimGrid {
        grid-template-columns: 1fr;
    }

    .estimTiles--4 {
        grid-template-columns: repeat(2, 1fr);
    }
}
