/**
 * Working Life - Simulateur de coût d'aménagement
 * Styles alignés sur l'identité visuelle workinglife.fr
 */

.wl-sim {
    --wl-accent: #ff184e;
    --wl-accent-soft: #ff184e15;
    --wl-gradient-from: #ff0084;
    --wl-gradient-to: #2c2cf8;
    --wl-text: #282828;
    --wl-muted: #666;
    --wl-dark: #191c20;
    --wl-bg: #ffffff;
    --wl-bg-alt: #fafafa;
    --wl-border: #e5e5e5;
    --wl-border-light: #f0f0f0;
    --wl-radius: 7px;
    --wl-radius-sm: 5px;
    --wl-shadow: 0 2px 12px #0000000d;
    --wl-shadow-hover: 0 4px 20px #00000014;
    --wl-h-family: 'Encode Sans Condensed', sans-serif;
    --wl-body-family: 'Oxygen', sans-serif;
    --wl-transition: all 0.2s cubic-bezier(0.32, 0.74, 0.57, 1);

    font-family: var(--wl-body-family);
    color: var(--wl-text);
    background: var(--wl-bg);
    border: 1px solid var(--wl-border);
    border-radius: var(--wl-radius);
    padding: 32px;
    margin: 32px 0;
    box-shadow: var(--wl-shadow);
    box-sizing: border-box;
}

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

/* === Header === */
.wl-sim__header {
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--wl-border-light);
}

.wl-sim__badge {
    display: inline-block;
    font-family: var(--wl-h-family);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: #fff;
    background: linear-gradient(90deg, var(--wl-gradient-from), var(--wl-gradient-to));
    padding: 5px 10px;
    border-radius: 3px;
    margin-bottom: 12px;
}

.wl-sim__title {
    font-family: var(--wl-h-family);
    font-size: 26px;
    font-weight: 700;
    line-height: 1.25;
    color: var(--wl-dark);
    margin: 0 0 8px;
}

.wl-sim__subtitle {
    font-size: 14px;
    color: var(--wl-muted);
    line-height: 1.5;
    margin: 0;
}

/* === Form === */
.wl-sim__form {
    display: flex;
    flex-direction: column;
    gap: 28px;
    margin-bottom: 32px;
}

.wl-sim__field {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Ligne 2 colonnes : surface + ville */
.wl-sim__row {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 20px;
}

.wl-sim__field--half {
    min-width: 0; /* permet aux enfants de bien shrink */
}

.wl-sim__label {
    font-family: var(--wl-h-family);
    font-size: 16px;
    font-weight: 700;
    color: var(--wl-dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.wl-sim__label-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--wl-accent);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.wl-sim__hint {
    font-size: 12px;
    color: var(--wl-muted);
    margin: 0;
}

/* === Segmenté usage (Bureau / Coworking) === */
.wl-sim__usage {
    display: inline-flex;
    background: var(--wl-bg-alt);
    border: 1px solid var(--wl-border);
    border-radius: var(--wl-radius-sm);
    padding: 4px;
    gap: 4px;
}

.wl-sim__usage-opt {
    cursor: pointer;
    margin: 0;
}

.wl-sim__usage-opt input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.wl-sim__usage-label {
    display: inline-block;
    font-family: var(--wl-h-family);
    font-size: 14px;
    font-weight: 600;
    color: var(--wl-muted);
    padding: 8px 18px;
    border-radius: 4px;
    transition: var(--wl-transition);
}

.wl-sim__usage-opt:hover .wl-sim__usage-label {
    color: var(--wl-dark);
}

.wl-sim__usage-opt input:checked + .wl-sim__usage-label {
    background: var(--wl-dark);
    color: #fff;
}

.wl-sim__usage-opt input:focus-visible + .wl-sim__usage-label {
    outline: 2px solid var(--wl-accent);
    outline-offset: 2px;
}

/* === Input surface === */
.wl-sim__input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.wl-sim__input {
    font-family: var(--wl-h-family);
    font-size: 22px;
    font-weight: 700;
    color: var(--wl-dark);
    width: 100%;
    padding: 12px 60px 12px 16px;
    border: 2px solid var(--wl-border);
    border-radius: var(--wl-radius-sm);
    background: #fff;
    transition: var(--wl-transition);
    -moz-appearance: textfield;
}

.wl-sim__input::-webkit-outer-spin-button,
.wl-sim__input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.wl-sim__input:focus {
    outline: none;
    border-color: var(--wl-accent);
    box-shadow: 0 0 0 3px var(--wl-accent-soft);
}

.wl-sim__input-suffix {
    position: absolute;
    right: 16px;
    font-family: var(--wl-h-family);
    font-size: 14px;
    font-weight: 600;
    color: var(--wl-muted);
    pointer-events: none;
}

/* === Select ville === */
.wl-sim__select-wrap {
    position: relative;
    width: 100%;
}

.wl-sim__select-wrap::after {
    content: '';
    position: absolute;
    right: 18px;
    top: 50%;
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--wl-dark);
    border-bottom: 2px solid var(--wl-dark);
    transform: translateY(-75%) rotate(45deg);
    pointer-events: none;
}

.wl-sim__select {
    font-family: var(--wl-h-family);
    font-size: 16px;
    font-weight: 600;
    color: var(--wl-dark);
    width: 100%;
    padding: 14px 40px 14px 16px;
    border: 2px solid var(--wl-border);
    border-radius: var(--wl-radius-sm);
    background: #fff;
    cursor: pointer;
    transition: var(--wl-transition);
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    line-height: 1.2;
}

.wl-sim__select:focus {
    outline: none;
    border-color: var(--wl-accent);
    box-shadow: 0 0 0 3px var(--wl-accent-soft);
}

.wl-sim__select:hover {
    border-color: #c5c5c5;
}

/* === Cards niveau === */
.wl-sim__cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.wl-sim__card {
    cursor: pointer;
    display: block;
}

.wl-sim__card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.wl-sim__card-inner {
    height: 100%;
    padding: 18px;
    border: 2px solid var(--wl-border);
    border-radius: var(--wl-radius-sm);
    background: #fff;
    transition: var(--wl-transition);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.wl-sim__card-tag {
    display: inline-block;
    align-self: flex-start;
    font-family: var(--wl-h-family);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--wl-dark);
    background: var(--wl-bg-alt);
    border: 1px solid var(--wl-border);
    padding: 4px 8px;
    border-radius: 3px;
}

.wl-sim__card-tag--reco {
    color: #fff;
    background: var(--wl-dark);
    border-color: var(--wl-dark);
}

.wl-sim__card-desc {
    font-size: 13px;
    line-height: 1.45;
    color: var(--wl-text);
    margin: 0;
    flex-grow: 1;
}

.wl-sim__card-price {
    font-family: var(--wl-h-family);
    font-size: 13px;
    color: var(--wl-muted);
    border-top: 1px solid var(--wl-border-light);
    padding-top: 10px;
}

.wl-sim__card-price strong {
    display: inline-block;
    font-size: 16px;
    color: var(--wl-dark);
    font-weight: 700;
}

.wl-sim__card:hover .wl-sim__card-inner {
    border-color: #c5c5c5;
    transform: translateY(-1px);
}

.wl-sim__card input:checked + .wl-sim__card-inner {
    border-color: var(--wl-accent);
    background: var(--wl-accent-soft);
    box-shadow: 0 0 0 1px var(--wl-accent);
}

.wl-sim__card input:focus-visible + .wl-sim__card-inner {
    outline: 2px solid var(--wl-accent);
    outline-offset: 2px;
}

/* === Bloc résultat === */
.wl-sim__result {
    background: var(--wl-bg-alt);
    border-radius: var(--wl-radius);
    padding: 28px;
    border: 1px solid var(--wl-border-light);
}

.wl-sim__total {
    text-align: center;
    padding-bottom: 24px;
    margin-bottom: 16px;
}

.wl-sim__total-label {
    display: block;
    font-family: var(--wl-h-family);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--wl-muted);
    margin-bottom: 8px;
}

.wl-sim__total-value {
    display: block;
    font-family: var(--wl-h-family);
    font-size: 42px;
    font-weight: 700;
    line-height: 1.1;
    background: linear-gradient(90deg, var(--wl-gradient-from), var(--wl-gradient-to));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: var(--wl-accent); /* fallback */
    margin-bottom: 6px;
}

.wl-sim__total-meta {
    display: block;
    font-family: var(--wl-h-family);
    font-size: 14px;
    font-weight: 600;
    color: var(--wl-muted);
}

/* === Bouton accordéon === */
.wl-sim__toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    margin: 0 0 20px;
    padding: 12px 16px;
    font-family: var(--wl-h-family);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--wl-dark);
    background: #fff;
    border: 1px solid var(--wl-border);
    border-radius: var(--wl-radius-sm);
    cursor: pointer;
    transition: var(--wl-transition);
}

.wl-sim__toggle:hover {
    border-color: var(--wl-accent);
    color: var(--wl-accent);
}

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

.wl-sim__toggle-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    font-size: 18px;
    font-weight: 400;
    color: #fff;
    background: var(--wl-dark);
    border-radius: 50%;
    line-height: 1;
    transition: var(--wl-transition);
}

.wl-sim__toggle[aria-expanded="true"] .wl-sim__toggle-icon {
    transform: rotate(45deg);
    background: var(--wl-accent);
}

.wl-sim__details--hidden {
    display: none !important;
}

.wl-sim__details {
    animation: wl-sim-fadein 0.25s ease;
}

@keyframes wl-sim-fadein {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* === Tableau de décomposition === */
.wl-sim__breakdown {
    margin-bottom: 24px;
}

.wl-sim__breakdown-title {
    font-family: var(--wl-h-family);
    font-size: 16px;
    font-weight: 700;
    color: var(--wl-dark);
    margin: 0 0 14px;
}

.wl-sim__table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid var(--wl-border);
    border-radius: var(--wl-radius-sm);
    overflow: hidden;
    font-size: 14px;
}

.wl-sim__table thead th {
    font-family: var(--wl-h-family);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--wl-muted);
    text-align: left;
    padding: 12px 16px;
    background: var(--wl-bg-alt);
    border-bottom: 1px solid var(--wl-border);
}

.wl-sim__table thead th:nth-child(2),
.wl-sim__table thead th:nth-child(3),
.wl-sim__table thead th:nth-child(4) {
    text-align: right;
}

.wl-sim__table tbody th {
    font-family: var(--wl-body-family);
    font-weight: 700;
    color: var(--wl-dark);
    text-align: left;
    padding: 14px 16px;
    border-bottom: 1px solid var(--wl-border-light);
    line-height: 1.3;
}

.wl-sim__table tbody th em {
    display: block;
    font-style: normal;
    font-size: 12px;
    font-weight: 400;
    color: var(--wl-muted);
    margin-top: 2px;
}

.wl-sim__table tbody td {
    padding: 14px 16px;
    text-align: right;
    border-bottom: 1px solid var(--wl-border-light);
    font-variant-numeric: tabular-nums;
    color: var(--wl-text);
}

.wl-sim__cell-total {
    font-weight: 700;
    color: var(--wl-dark);
}

.wl-sim__table tbody tr:last-child th,
.wl-sim__table tbody tr:last-child td {
    border-bottom: none;
}

.wl-sim__table tfoot th,
.wl-sim__table tfoot td {
    font-family: var(--wl-h-family);
    font-weight: 700;
    color: var(--wl-dark);
    padding: 14px 16px;
    background: var(--wl-bg-alt);
    border-top: 2px solid var(--wl-border);
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.wl-sim__table tfoot th {
    text-align: left;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.07em;
}

/* === Bloc contexte === */
.wl-sim__context {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.wl-sim__context-item {
    background: #fff;
    border: 1px solid var(--wl-border);
    border-radius: var(--wl-radius-sm);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.wl-sim__context-label {
    font-family: var(--wl-h-family);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--wl-muted);
}

.wl-sim__context-value {
    font-family: var(--wl-h-family);
    font-size: 18px;
    font-weight: 700;
    color: var(--wl-dark);
}

.wl-sim__context-meta {
    font-size: 12px;
    color: var(--wl-muted);
}

/* === Disclaimer === */
.wl-sim__disclaimer {
    font-size: 12px;
    line-height: 1.5;
    color: var(--wl-muted);
    background: #fff;
    border-left: 3px solid var(--wl-accent);
    padding: 12px 16px;
    border-radius: 0 var(--wl-radius-sm) var(--wl-radius-sm) 0;
}

.wl-sim__disclaimer strong {
    color: var(--wl-dark);
}

/* === Responsive === */
@media (max-width: 768px) {
    .wl-sim {
        padding: 20px;
    }

    .wl-sim__title {
        font-size: 22px;
    }

    .wl-sim__total-value {
        font-size: 32px;
    }

    .wl-sim__row {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .wl-sim__usage {
        display: flex;
        width: 100%;
    }

    .wl-sim__usage-opt {
        flex: 1;
        text-align: center;
    }

    .wl-sim__usage-label {
        display: block;
        padding: 10px 12px;
    }

    .wl-sim__cards {
        grid-template-columns: 1fr;
    }

    .wl-sim__context {
        grid-template-columns: 1fr;
    }

    .wl-sim__result {
        padding: 20px;
    }

    /* Tableau scrollable horizontalement sur mobile */
    .wl-sim__breakdown {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .wl-sim__table {
        min-width: 480px;
    }
}

@media (max-width: 480px) {
    .wl-sim {
        padding: 16px;
        margin: 20px 0;
    }

    .wl-sim__title {
        font-size: 20px;
    }

    .wl-sim__total-value {
        font-size: 28px;
    }
}
