/**
 * Simulateur de tarifs C'Cash - refonte 2026.
 *
 * Layout : grille 2 colonnes desktop (formulaire blanc / résultat dégradé),
 * stack mobile. Les sélecteurs et IDs sont identiques à l'ancien CSS pour
 * que le JS (ccash-simulator.js) continue de fonctionner sans modif.
 */

/* Section racine */
.ccash-simulator {
    padding: 0 0 80px;
}

.ccash-simulator__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: 28px;
    margin-top: 28px;
}

/* Carte FORMULAIRE */
.ccash-simulator__form {
    position: relative;
    background: #fff;
    border-radius: 20px;
    padding: 32px;
    border: 0;
    display: flex;
    flex-direction: column;
    gap: 26px;
}

/* Liseré primary en haut de la carte - touche signature */
.ccash-simulator__form::before {
    content: "";
    position: absolute;
    top: 0;
    left: 24px;
    right: 24px;
    height: 3px;
    background: linear-gradient(90deg,
        var(--bs-primary) 0%,
        rgba(var(--bs-primary-rgb), 0.4) 100%);
    border-radius: 0 0 4px 4px;
}

.ccash-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.ccash-field__label {
    font-family: 'Gotham', sans-serif;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--cw-text-muted);
}
.ccash-field__hint {
    font-size: 13px;
    color: var(--cw-text-muted);
    margin: 0 0 0;
    min-height: 0;
    font-weight: 500;
    line-height: 1.5;
}

.ccash-field__hint:empty {
    display: none;
}

/* SELECT - style natif raffiné */
.ccash-field select.form-select {
    appearance: none;
    -webkit-appearance: none;
    background-color: #f8fafc;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231D3D70' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px;
    border: 1.5px solid #e2e8f0;
    border-radius: 20px;
    padding: 14px 44px 14px 16px;
    font-size: 15px;
    font-weight: 500;
    color: var(--bs-secondary);
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}
.ccash-field select.form-select:hover {
    border-color: var(--bs-primary);
    background-color: #fff;
}
.ccash-field select.form-select:focus {
    outline: 0;
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 4px rgba(var(--bs-primary-rgb), 0.12);
    background-color: #fff;
}

/* INPUT MONTANT */
.ccash-amount-input {
    position: relative;
}
.ccash-amount-input input.form-control {
    width: 100%;
    background-color: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 20px;
    padding: 16px 84px 16px 18px;
    font-size: 22px;
    font-weight: 700;
    color: var(--bs-secondary);
    font-family: 'Gotham', sans-serif;
    letter-spacing: -0.01em;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}
.ccash-amount-input input.form-control::placeholder {
    color: #cbd5e1;
    font-weight: 600;
}
.ccash-amount-input input.form-control:hover {
    border-color: var(--bs-primary);
    background-color: #fff;
}
.ccash-amount-input input.form-control:focus {
    outline: 0;
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 4px rgba(var(--bs-primary-rgb), 0.12);
    background-color: #fff;
}
.ccash-amount-input__suffix {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--bs-secondary);
    font-family: 'Gotham', sans-serif;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
    background: rgba(var(--bs-primary-rgb), 0.15);
    padding: 4px 10px;
    border-radius: 6px;
    pointer-events: none;
}
/* Cache les spinners natifs (Webkit + Firefox) */
.ccash-amount-input input[type="number"]::-webkit-outer-spin-button,
.ccash-amount-input input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.ccash-amount-input input[type="number"] {
    -moz-appearance: textfield;
}

/* CHIPS - montants rapides */
.ccash-quick-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}
.ccash-chip {
    background: #fff;
    color: var(--bs-secondary);
    border: 1.5px solid #e2e8f0;
    border-radius: 18px;
    padding: 8px 14px;
    font-family: 'Gotham', sans-serif;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
.ccash-chip:hover {
    background: rgba(var(--bs-primary-rgb), 0.08);
    border-color: var(--bs-primary);
    transform: translateY(-1px);
}
.ccash-chip:active {
    transform: translateY(0);
    background: rgba(var(--bs-primary-rgb), 0.18);
}

/* RESET */
.ccash-reset {
    align-self: flex-start;
    background: transparent;
    color: var(--cw-text-muted);
    border: 0;
    border-radius: 8px;
    padding: 8px 12px;
    font-family: 'Gotham', sans-serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color 0.15s ease, background 0.15s ease;
}
.ccash-reset:hover {
    color: var(--bs-secondary);
    background: #f1f5f9;
}
.ccash-reset i {
    font-size: 14px;
}

/* Carte RÉSULTAT */
.ccash-simulator__result {
    position: sticky;
    top: calc(var(--cw-header-height, 90px) + 20px);
    background:
        radial-gradient(ellipse 80% 60% at top right, rgba(var(--bs-primary-rgb), 0.22) 0%, transparent 60%),
        linear-gradient(135deg, var(--bs-secondary) 0%, #102544 100%);
    color: #fff;
    border-radius: 20px;
    padding: 32px;
    min-height: 320px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.04),
        0 20px 40px -12px rgba(15, 23, 42, 0.25);
    overflow: hidden;
}

/* Placeholder vide */
.ccash-result__placeholder {
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
}
.ccash-result__placeholder p {
    margin: 0;
    font-size: 14px;
    max-width: 240px;
    margin: 0 auto;
    line-height: 1.6;
}
.ccash-result__placeholder::before {
    content: "";
    display: block;
    width: 56px;
    height: 56px;
    margin: 0 auto 18px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238DC63F' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='16' rx='2'/%3E%3Cpath d='M7 8h10M7 12h6M7 16h4'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.9;
}

/* Panel rempli */
.ccash-result__panel {
    animation: ccashResultIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes ccashResultIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.ccash-result__title {
    color: #fff;
    font-family: 'Gotham', sans-serif;
    font-size: 18px;
    font-weight: 500;
    line-height: 1.3;
    margin: 0 0 24px;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    letter-spacing: -0.01em;
}

.ccash-result__rows {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.ccash-result__row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
}
.ccash-result__label {
    color: rgba(255, 255, 255, 0.65);
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.ccash-result__value {
    font-family: 'Gotham', sans-serif;
    font-weight: 800;
    font-size: 18px;
    color: #fff;
    letter-spacing: -0.01em;
    text-align: right;
}

/* Ligne "Frais" - accent primary */
.ccash-result__row--fee .ccash-result__value {
    color: var(--bs-primary);
}

/* Ligne "Total" - la plus mise en avant */
.ccash-result__row--total {
    margin-top: 12px;
    padding: 18px 0 0;
    border-top: 1px dashed rgba(255, 255, 255, 0.2);
}
.ccash-result__row--total .ccash-result__label {
    color: rgba(255, 255, 255, 0.85);
    font-size: 12px;
}
.ccash-result__row--total .ccash-result__value {
    font-size: 28px;
    color: var(--bs-primary);
    line-height: 1;
}

.ccash-result__note {
    margin: 22px 0 0;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.06);
    border-left: 3px solid var(--bs-primary);
    border-radius: 0 8px 8px 0;
    color: rgba(255, 255, 255, 0.85);
    font-size: 12px;
    line-height: 1.6;
}
.ccash-result__note:empty {
    display: none;
}

.ccash-result__error {
    background: rgba(255, 205, 0, 0.12);
    color: #fff;
    border: 1px solid rgba(255, 205, 0, 0.45);
    border-radius: 12px;
    padding: 18px 20px;
    text-align: center;
    font-weight: 500;
    font-size: 14px;
    line-height: 1.5;
}

.ccash-simulator__detail {
    margin-top: 64px;
    border-radius: 20px;
    border: 0;
    padding: 36px;
}

.ccash-simulator__detail > .celtiis-title {
    margin-bottom: 24px;
}

.ccash-simulator__detail-body {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
}

/* Carte grille tarifaire (un service tiered) */
.ccash-grid {
    background: #f8fafc;
    border-radius: 14px;
    padding: 0 0 4px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    transition: border-color 0.2s ease, transform 0.2s ease;
}
.ccash-grid:hover {
    border-color: var(--bs-primary);
}

.ccash-grid__title {
    display: block;
    background: linear-gradient(90deg,
        var(--bs-primary) 0%,
        rgba(var(--bs-primary-rgb), 0.85) 100%);
    color: var(--bs-secondary);
    font-family: 'Gotham', sans-serif;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
    margin: 0;
    padding: 14px 20px;
    clip-path: none;
}

.ccash-grid__table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    font-family: 'Montserrat', sans-serif;
}
.ccash-grid__table th,
.ccash-grid__table td {
    padding: 10px 16px;
    border-bottom: 1px solid #e2e8f0;
    text-align: right;
    color: var(--bs-secondary);
}
.ccash-grid__table thead th {
    background: #fff;
    text-align: right;
    color: var(--cw-text-muted);
    font-weight: 700;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-bottom: 2px solid #e2e8f0;
}
.ccash-grid__table th:first-child,
.ccash-grid__table td:first-child { text-align: left; }
.ccash-grid__table tbody tr:last-child td { border-bottom: 0; }
.ccash-grid__table tbody tr {
    transition: background 0.12s ease;
}
.ccash-grid__table tbody tr:hover {
    background: rgba(var(--bs-primary-rgb), 0.06);
}
.ccash-grid__table td strong {
    color: var(--bs-secondary);
    font-weight: 800;
    font-family: 'Gotham', sans-serif;
}

/* Responsive */
@media (max-width: 991.98px) {
    .ccash-simulator__grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .ccash-simulator__result {
        position: static;
        min-height: 240px;
    }
    .ccash-simulator__detail {
        padding: 24px;
        margin-top: 40px;
    }
}

@media (max-width: 575.98px) {
    .ccash-simulator {
        padding: 0 0 48px;
    }
    .ccash-simulator__form,
    .ccash-simulator__result {
        padding: 22px;
        border-radius: 16px;
    }
    .ccash-simulator__form {
        gap: 22px;
    }
    .ccash-amount-input input.form-control {
        font-size: 18px;
        padding: 14px 76px 14px 14px;
    }
    .ccash-result__title {
        font-size: 16px;
    }
    .ccash-result__value {
        font-size: 16px;
    }
    .ccash-result__row--total .ccash-result__value {
        font-size: 22px;
    }
    .ccash-simulator__detail {
        padding: 20px;
        border-radius: 16px;
    }
    .ccash-simulator__detail-body {
        grid-template-columns: 1fr;
    }
}
