/* =========================================================
   ATELIER MECABRO 77
   SIMULATEUR TARIFAIRE
   ========================================================= */


/* =========================================================
   VARIABLES
   ========================================================= */

:root {
    --sim-bg: #f4f4f1;
    --sim-white: #ffffff;
    --sim-black: #171717;
    --sim-text: #292929;
    --sim-grey: #666666;
    --sim-light-grey: #eeeeeb;
    --sim-border: #d8d8d3;
    --sim-red: #d71920;
    --sim-red-dark: #b9151b;
}


/* =========================================================
   INTRODUCTION
   ========================================================= */

.intro {
    background: var(--sim-bg);
    padding: 78px 0 52px;
}

.intro-content {
    max-width: 1115px;
}

.intro .eyebrow {
    margin: 0 0 12px;
    font-family: "Barlow Condensed", Arial, sans-serif;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--sim-red);
}

.intro h1 {
    max-width: 820px;
    margin: 0 0 18px;
    font-family: "Barlow Condensed", Arial, sans-serif;
    font-size: clamp(42px, 5vw, 68px);
    line-height: 0.98;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--sim-black);
}

.intro-content > p:not(.eyebrow) {
    max-width: 720px;
    margin: 0;
    font-family: "Barlow", Arial, sans-serif;
    font-size: 18px;
    line-height: 1.55;
    color: var(--sim-text);
}


/* =========================================================
   NOTICE INTRO
   ========================================================= */

.intro .notice {
    max-width: 820px;
    margin-top: 28px;
    padding: 17px 20px;
    border-left: 3px solid var(--sim-red);
    background: var(--sim-white);
    font-family: "Barlow", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.55;
    color: var(--sim-text);
}

.intro .notice strong {
    color: var(--sim-black);
}


/* =========================================================
   ZONE SIMULATEUR
   ========================================================= */

.simulator-section {
    padding: 0 0 90px;
    background: var(--sim-bg);
}

.simulator-section > .container {
    max-width: 1115px;
}


/* =========================================================
   PROGRESSION
   ========================================================= */

.progress {
    display: grid;
    grid-template-columns: auto minmax(40px, 1fr) auto minmax(40px, 1fr) auto;
    align-items: center;
    width: 100%;
    margin: 0 0 34px;
}

.progress-step {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
    color: #999999;
}

.progress-step span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;

    border: 1px solid #cfcfca;
    border-radius: 50%;

    background: var(--sim-bg);

    font-family: "Barlow Condensed", Arial, sans-serif;
    font-size: 17px;
    font-weight: 600;
}

.progress-step strong {
    font-family: "Barlow Condensed", Arial, sans-serif;
    font-size: 17px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.progress-step.active {
    color: var(--sim-black);
    background: var(--sim-white);
    box-shadow: 0 0 0 2px var(--sim-red);
}

.progress-step.active span {
    border-color: var(--sim-red);
    background: var(--sim-red);
    color: #ffffff;
}

.progress-step.completed {
    color: var(--sim-black);
}

.progress-step.completed span {
    border-color: var(--sim-black);
    background: var(--sim-black);
    color: #ffffff;
}

.progress-line {
    height: 1px;
    margin: 0 15px;
    background: var(--sim-border);
}


/* =========================================================
   ÉTAPES
   ========================================================= */

.simulator-step {
    display: none;
}

.simulator-step.active {
    display: block;
}


/* =========================================================
   CARTE PRINCIPALE
   ========================================================= */

.simulator-section .card {
    width: 100%;
    border: 1px solid var(--sim-border);
    background: var(--sim-white);
}


/* =========================================================
   EN-TÊTE DE CARTE
   ========================================================= */

.simulator-section .card-header,
.simulator-section .result-header {
    padding: 38px 42px 30px;
    border-bottom: 1px solid var(--sim-border);
}

.simulator-section .step-label {
    margin: 0 0 8px;
    font-family: "Barlow Condensed", Arial, sans-serif;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.12em;
    color: var(--sim-red);
}

.simulator-section .card-header h2,
.simulator-section .result-header h2 {
    margin: 0 0 8px;
    font-family: "Barlow Condensed", Arial, sans-serif;
    font-size: 34px;
    line-height: 1.05;
    font-weight: 600;
    color: var(--sim-black);
}

.simulator-section .card-header p:not(.step-label),
.simulator-section .result-header p:not(.step-label) {
    max-width: 700px;
    margin: 0;
    font-family: "Barlow", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--sim-grey);
}


/* =========================================================
   FORMULAIRE
   ========================================================= */

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px 26px;
    padding: 34px 42px 10px;
}

.form-group {
    min-width: 0;
}

.form-group-full {
    grid-column: 1 / -1;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-family: "Barlow Condensed", Arial, sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: var(--sim-black);
}

.form-group label span {
    color: var(--sim-red);
}

.form-group input,
.form-group select {
    width: 100%;
    min-height: 48px;
    padding: 11px 14px;

    border: 1px solid #cfcfca;
    border-radius: 0;

    background: #ffffff;

    font-family: "Barlow", Arial, sans-serif;
    font-size: 16px;
    color: var(--sim-black);

    outline: none;

    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

.form-group input::placeholder {
    color: #999999;
}

.form-group input:hover {
    border-color: #aaaaa5;
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--sim-red);
    box-shadow: 0 0 0 2px rgba(215, 25, 32, 0.08);
}


/* =========================================================
   ERREURS
   ========================================================= */

.simulator-section .form-error {
    display: none;
    margin: 20px 42px 0;
    padding: 12px 15px;
    border-left: 3px solid var(--sim-red);
    background: #faf3f3;
    font-family: "Barlow", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.45;
    color: #8f1116;
}

.simulator-section .form-error.visible {
    display: block;
}


/* =========================================================
   ACTIONS
   ========================================================= */

.simulator-section .actions {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 30px 42px 38px;
}

.simulator-section .actions-right {
    justify-content: flex-end;
}

.simulator-section .actions-between {
    justify-content: space-between;
}

.simulator-section .actions-center {
    justify-content: center;
}


/* =========================================================
   BOUTONS DU SIMULATEUR
   ========================================================= */

.simulator-section .actions .btn,
.simulator-section .quote-request .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    min-height: 46px;
    padding: 11px 20px;

    border: 1px solid transparent;
    border-radius: 0;

    font-family: "Barlow Condensed", Arial, sans-serif;
    font-size: 17px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;

    cursor: pointer;

    transition:
        background-color 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease;
}

.simulator-section .actions .btn-primary,
.simulator-section .quote-request .btn-primary {
    background: var(--sim-red);
    border-color: var(--sim-red);
    color: #ffffff;
}

.simulator-section .actions .btn-primary:hover,
.simulator-section .quote-request .btn-primary:hover {
    background: var(--sim-red-dark);
    border-color: var(--sim-red-dark);
}

.simulator-section .actions .btn-secondary {
    background: transparent;
    border-color: #bdbdb8;
    color: var(--sim-black);
}

.simulator-section .actions .btn-secondary:hover {
    border-color: var(--sim-black);
    background: var(--sim-black);
    color: #ffffff;
}

.simulator-section .btn-block {
    width: 100%;
}


/* =========================================================
   CATEGORIES
   ========================================================= */

.categories {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;

    padding: 34px 42px;
}

.category {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;

    min-height: 92px;
    padding: 17px 19px;

    border: 1px solid var(--sim-border);
    border-left: 3px solid transparent;
    border-radius: 0;

    background: #ffffff;

    text-align: left;
    cursor: pointer;

    transition:
        border-color 0.15s ease,
        background-color 0.15s ease;
}

.category:hover {
    border-color: #bdbdb8;
    border-left-color: var(--sim-red);
    background: #fafafa;
}

.category.selected,
.category.active {
    border-color: var(--sim-red);
    border-left-color: var(--sim-red);
    background: #fff7f7;
}

.category strong {
    display: block;
    margin-bottom: 5px;

    font-family: "Barlow Condensed", Arial, sans-serif;
    font-size: 21px;
    font-weight: 600;
    line-height: 1.1;
    color: var(--sim-black);
}

.category small {
    display: block;

    font-family: "Barlow", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.4;
    color: var(--sim-grey);
}


/* =========================================================
   CONTENEUR DES OPÉRATIONS
   ========================================================= */

.operations-container {
    margin: 0 42px 38px;
    padding-top: 28px;
    border-top: 1px solid var(--sim-border);
}

.operations-container[hidden] {
    display: none !important;
}

.back-link {
    display: inline-block;

    margin: 0 0 18px;
    padding: 0;

    border: 0;
    background: transparent;

    font-family: "Barlow Condensed", Arial, sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: var(--sim-grey);

    cursor: pointer;
}

.back-link:hover {
    color: var(--sim-red);
}

.operations-container h3 {
    margin: 0 0 5px;

    font-family: "Barlow Condensed", Arial, sans-serif;
    font-size: 27px;
    font-weight: 600;
    color: var(--sim-black);
}

.operations-help {
    margin: 0 0 18px;

    font-family: "Barlow", Arial, sans-serif;
    font-size: 14px;
    color: var(--sim-grey);
}


/* =========================================================
   OPERATIONS
   ========================================================= */

.operations {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.operation {
    display: block;
    cursor: pointer;
}

.operation input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.operation-content {
    display: flex;
    flex-direction: column;

    padding: 15px 17px;

    border: 1px solid var(--sim-border);
    border-left: 3px solid transparent;

    background: #ffffff;

    transition:
        border-color 0.15s ease,
        background-color 0.15s ease;
}

.operation:hover .operation-content {
    border-left-color: var(--sim-red);
    background: #fafafa;
}

.operation input:checked + .operation-content,
.operation.selected .operation-content,
.operation.active .operation-content {
    border-color: var(--sim-red);
    border-left-color: var(--sim-red);
    background: #fff7f7;
}

.operation-content strong {
    margin-bottom: 4px;

    font-family: "Barlow Condensed", Arial, sans-serif;
    font-size: 19px;
    font-weight: 600;
    color: var(--sim-black);
}

.operation-content small {
    font-family: "Barlow", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.4;
    color: var(--sim-grey);
}


/* =========================================================
   RESULTAT
   ========================================================= */

.result-card {
    overflow: hidden;
}

.estimate-box {
    margin: 34px 42px 0;
    padding: 30px;

    border: 1px solid var(--sim-border);

    background: var(--sim-black);

    text-align: center;
}

.estimate-label {
    margin: 0 0 12px;

    font-family: "Barlow Condensed", Arial, sans-serif;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.12em;
    color: #ffffff;
}

.estimate-price {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;

    font-family: "Barlow Condensed", Arial, sans-serif;
    font-size: clamp(34px, 5vw, 52px);
    line-height: 1;
    font-weight: 600;
    color: #ffffff;
}

.estimate-separator {
    font-size: 25px;
    font-weight: 400;
    opacity: 0.7;
}

.estimate-note {
    margin: 14px 0 0;

    font-family: "Barlow", Arial, sans-serif;
    font-size: 13px;
    line-height: 1.4;
    color: #cccccc;
}


/* =========================================================
   DÉTAILS DU PRIX
   ========================================================= */

.estimate-details {
    margin: 28px 42px 0;
    border-top: 1px solid var(--sim-border);
}

.detail-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    padding: 15px 0;

    border-bottom: 1px solid var(--sim-border);

    font-family: "Barlow", Arial, sans-serif;
    font-size: 15px;
    color: var(--sim-text);
}

.detail-row strong {
    font-family: "Barlow Condensed", Arial, sans-serif;
    font-size: 19px;
    font-weight: 600;
    color: var(--sim-black);
}

.detail-row.total-row {
    padding-top: 19px;
    padding-bottom: 19px;
}

.detail-row.total-row span {
    font-family: "Barlow Condensed", Arial, sans-serif;
    font-size: 20px;
    font-weight: 600;
    color: var(--sim-black);
}

.detail-row.total-row strong {
    font-size: 24px;
    color: var(--sim-red);
}


/* =========================================================
   RÉSUMÉ
   ========================================================= */

.summary {
    margin: 32px 42px 0;
    padding-top: 26px;
    border-top: 1px solid var(--sim-border);
}

.summary h3 {
    margin: 0 0 14px;

    font-family: "Barlow Condensed", Arial, sans-serif;
    font-size: 24px;
    font-weight: 600;
    color: var(--sim-black);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    gap: 30px;

    padding: 10px 0;

    font-family: "Barlow", Arial, sans-serif;
    font-size: 15px;
}

.summary-row + .summary-row {
    border-top: 1px solid var(--sim-light-grey);
}

.summary-row span {
    color: var(--sim-grey);
}

.summary-row strong {
    max-width: 65%;

    text-align: right;

    font-weight: 600;
    color: var(--sim-black);
}


/* =========================================================
   AVERTISSEMENT RÉSULTAT
   ========================================================= */

.result-notice {
    margin: 30px 42px 0;
    padding: 18px 20px;

    border-left: 3px solid var(--sim-red);

    background: var(--sim-bg);
}

.result-notice strong {
    display: block;
    margin-bottom: 5px;

    font-family: "Barlow Condensed", Arial, sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: var(--sim-black);
}

.result-notice p {
    margin: 0;

    font-family: "Barlow", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--sim-grey);
}


/* =========================================================
   DEMANDE DE DEVIS
   ========================================================= */

.quote-request {
    margin: 34px 42px 0;
    padding: 26px;

    border: 1px solid var(--sim-border);

    background: #fafaf8;
}

.quote-request h3 {
    margin: 0 0 7px;

    font-family: "Barlow Condensed", Arial, sans-serif;
    font-size: 25px;
    font-weight: 600;
    color: var(--sim-black);
}

.quote-request p {
    margin: 0 0 18px;

    font-family: "Barlow", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--sim-grey);
}


/* =========================================================
   RESPONSIVE — TABLETTE
   ========================================================= */

@media (max-width: 800px) {

    .intro {
        padding: 60px 0 40px;
    }

    .intro h1 {
        font-size: 48px;
    }

    .progress {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 5px;
        margin-bottom: 24px;
    }

    .progress-line {
        display: none;
    }

    .progress-step {
        min-width: 0;
        flex-direction: column;
        justify-content: center;
        gap: 5px;
        white-space: normal;
        text-align: center;
    }

    .progress-step span {
        width: 31px;
        height: 31px;
        flex-basis: 31px;
    }

    .progress-step strong {
        font-size: 15px;
    }

    .simulator-section .card-header,
    .simulator-section .result-header {
        padding: 30px;
    }

    .form-grid {
        padding: 28px 30px 8px;
    }

    .simulator-section .actions {
        padding-left: 30px;
        padding-right: 30px;
    }

    .categories {
        padding: 28px 30px;
    }

    .operations-container {
        margin-left: 30px;
        margin-right: 30px;
    }

    .estimate-box {
        margin-left: 30px;
        margin-right: 30px;
    }

    .estimate-details {
        margin-left: 30px;
        margin-right: 30px;
    }

    .summary {
        margin-left: 30px;
        margin-right: 30px;
    }

    .result-notice {
        margin-left: 30px;
        margin-right: 30px;
    }

    .quote-request {
        margin-left: 30px;
        margin-right: 30px;
    }

    .simulator-section .form-error {
        margin-left: 30px;
        margin-right: 30px;
    }
}


/* =========================================================
   RESPONSIVE — MOBILE
   ========================================================= */

@media (max-width: 600px) {

    .intro {
        padding: 45px 0 32px;
    }

    .intro h1 {
        font-size: 40px;
    }

    .intro-content > p:not(.eyebrow) {
        font-size: 16px;
    }

    .intro .notice {
        font-size: 14px;
    }


    /* Progression */

    .progress {
        grid-template-columns: repeat(3, 1fr);
        gap: 5px;
        margin-bottom: 24px;
    }

    .progress-line {
        display: none;
    }

    .progress-step {
        flex-direction: column;
        justify-content: center;
        gap: 5px;
        text-align: center;
    }

    .progress-step span {
        width: 31px;
        height: 31px;
        flex-basis: 31px;
    }

    .progress-step strong {
        font-size: 13px;
    }


    /* Carte */

    .simulator-section .card-header,
    .simulator-section .result-header {
        padding: 25px 20px;
    }

    .simulator-section .card-header h2,
    .simulator-section .result-header h2 {
        font-size: 29px;
    }


    /* Formulaire */

    .form-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 25px 20px 5px;
    }

    .form-group-full {
        grid-column: auto;
    }


    /* Catégories */

    .categories {
        grid-template-columns: 1fr;
        padding: 25px 20px;
        gap: 10px;
    }

    .category {
        min-height: 82px;
    }


    /* Opérations */

    .operations-container {
        margin: 0 20px 30px;
        padding-top: 22px;
    }


    /* Actions */

    .simulator-section .actions {
        flex-direction: column;
        align-items: stretch;
        padding: 25px 20px 30px;
    }

    .simulator-section .actions .btn {
        width: 100%;
    }

    .simulator-section .actions-between {
        flex-direction: column-reverse;
    }


    /* Erreurs */

    .simulator-section .form-error {
        margin-left: 20px;
        margin-right: 20px;
    }


    /* Estimation */

    .estimate-box {
        margin: 25px 20px 0;
        padding: 25px 15px;
    }

    .estimate-price {
        font-size: 37px;
        gap: 8px;
    }

    .estimate-separator {
        font-size: 20px;
    }

    .estimate-details {
        margin-left: 20px;
        margin-right: 20px;
    }

    .detail-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

    .detail-row strong {
        font-size: 18px;
    }


    /* Résumé */

    .summary {
        margin-left: 20px;
        margin-right: 20px;
    }

    .summary-row {
        flex-direction: column;
        gap: 3px;
    }

    .summary-row strong {
        max-width: 100%;
        text-align: left;
    }


    /* Avertissement */

    .result-notice {
        margin-left: 20px;
        margin-right: 20px;
    }


    /* Demande de devis */

    .quote-request {
        margin-left: 20px;
        margin-right: 20px;
        padding: 20px;
    }

    .quote-request h3 {
        font-size: 23px;
    }

}


/* =========================================================
   TRÈS PETITS ÉCRANS
   ========================================================= */

@media (max-width: 380px) {

    .intro h1 {
        font-size: 36px;
    }

    .progress-step strong {
        font-size: 12px;
    }

    .category strong {
        font-size: 19px;
    }

    .estimate-price {
        font-size: 32px;
    }

}
