/* Simulateur Crédit Immobilier - Styles adaptés à la charte RentaLab */

/* HERO SIMULATEUR */
.credit-hero {
    margin-top: 60px;
    padding: 80px 22px 60px;
    background: linear-gradient(135deg, #f5f5f7 0%, #e8f4fd 100%);
    text-align: center;
}

.credit-hero-content {
    max-width: 680px;
    margin: 0 auto;
}

.credit-hero .hero-badge {
    display: inline-block;
    background: rgba(0, 113, 227, 0.1);
    color: var(--color-primary);
    font-size: 13px;
    font-weight: 600;
    padding: 6px 16px;
    border-radius: 20px;
    margin-bottom: 20px;
}

.credit-hero h1 {
    font-size: 42px;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
    color: var(--color-text);
}

.credit-hero p {
    font-size: 18px;
    color: var(--color-text-light);
    line-height: 1.6;
}

/* MAIN LAYOUT */
.credit-main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 50px 22px 100px;
}

.credit-grid {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 32px;
    align-items: start;
}

/* PANEL */
.credit-panel {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.panel-header {
    background: var(--color-primary);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.panel-header .icon {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.panel-header h2 {
    font-size: 16px;
    font-weight: 600;
    color: white;
}

.panel-body {
    padding: 28px 24px;
}

/* FORM */
.credit-field {
    margin-bottom: 24px;
}

.credit-field:last-child {
    margin-bottom: 0;
}

.credit-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 8px;
}

.input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrap input[type="number"] {
    width: 100%;
    padding: 12px 50px 12px 16px;
    border: 1.5px solid #e0e0e0;
    border-radius: 10px;
    font-family: inherit;
    font-size: 17px;
    font-weight: 600;
    color: var(--color-text);
    background: #fafafa;
    transition: all 0.2s ease;
    outline: none;
    -moz-appearance: textfield;
}

.input-wrap input[type="number"]::-webkit-outer-spin-button,
.input-wrap input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.input-wrap input[type="number"]:focus {
    border-color: var(--color-primary);
    background: white;
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.1);
}

.input-unit {
    position: absolute;
    right: 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-light);
    pointer-events: none;
}

/* Slider */
.slider-wrap {
    margin-top: 10px;
}

input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 5px;
    border-radius: 3px;
    background: #e0e0e0;
    outline: none;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--color-primary);
    box-shadow: 0 2px 6px rgba(0, 113, 227, 0.3);
    cursor: pointer;
    transition: transform 0.15s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--color-primary);
    border: none;
    cursor: pointer;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--color-text-light);
    margin-top: 6px;
}

/* RÉSULTATS */
.results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.kpi {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.kpi:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.kpi.primary {
    background: linear-gradient(135deg, var(--color-primary) 0%, #0051a5 100%);
    border: none;
    grid-column: 1 / -1;
    padding: 28px;
}

.kpi-label {
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.kpi.primary .kpi-label {
    color: rgba(255, 255, 255, 0.8);
}

.kpi-value {
    font-size: 28px;
    font-weight: 600;
    color: #111827;
    letter-spacing: -0.02em;
    line-height: 1;
}

.kpi.primary .kpi-value {
    color: white;
    font-size: 36px;
}

.kpi-sub {
    font-size: 12px;
    color: #6b7280;
    margin-top: 6px;
}

.kpi.primary .kpi-sub {
    color: rgba(255, 255, 255, 0.7);
}

/* CHART */
.chart-wrap {
    padding: 24px;
    background: #f5f5f7;
    border-top: 1px solid #e8e8ed;
}

.chart-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 20px;
}

.chart-container {
    display: flex;
    align-items: center;
    gap: 32px;
}

.chart-canvas-wrap {
    width: 180px;
    height: 180px;
    flex-shrink: 0;
}

.chart-legend {
    flex: 1;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: white;
    border-radius: 10px;
    margin-bottom: 10px;
    border: 1px solid #e8e8ed;
}

.legend-item:last-child {
    margin-bottom: 0;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 4px;
    flex-shrink: 0;
}

.legend-info {
    flex: 1;
}

.legend-label {
    font-size: 12px;
    color: var(--color-text-light);
    font-weight: 500;
    margin-bottom: 2px;
}

.legend-val {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text);
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.legend-pct {
    font-size: 12px;
    color: var(--color-text-light);
    font-weight: 500;
}

/* CTA BLOC */
.credit-cta {
    background: linear-gradient(135deg, var(--color-primary) 0%, #0051a5 100%);
    border-radius: 16px;
    padding: 40px 32px;
    text-align: center;
    margin-top: 32px;
}

.credit-cta h3 {
    font-size: 22px;
    font-weight: 600;
    color: white;
    margin-bottom: 10px;
}

.credit-cta p {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 28px;
    line-height: 1.6;
}

.cta-buttons {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-cta-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: white;
    color: var(--color-primary);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-cta-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.btn-cta-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-cta-secondary:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

/* DISCLAIMER */
.credit-disclaimer {
    background: #f5f5f7;
    border: 1px solid #e8e8ed;
    border-radius: 12px;
    padding: 20px 24px;
    margin-top: 24px;
    font-size: 13px;
    color: var(--color-text-light);
    line-height: 1.7;
}

.credit-disclaimer strong {
    color: var(--color-text);
}

/* RESPONSIVE */
@media (max-width: 900px) {
    .credit-grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }
}

@media (max-width: 768px) {
    .credit-hero {
        padding: 60px 22px 50px;
    }

    .credit-hero h1 {
        font-size: 32px;
    }

    .credit-hero p {
        font-size: 16px;
    }

    .credit-main {
        padding: 40px 22px 80px;
    }

    .panel-body {
        padding: 24px 20px;
    }

    .results-grid {
        grid-template-columns: 1fr 1fr;
    }

    .kpi {
        padding: 16px;
    }

    .kpi-value {
        font-size: 24px;
    }

    .kpi.primary .kpi-value {
        font-size: 30px;
    }

    .chart-container {
        flex-direction: column;
        gap: 20px;
    }

    .chart-canvas-wrap {
        width: 160px;
        height: 160px;
    }

    .credit-cta {
        padding: 32px 24px;
    }

    .cta-buttons {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-cta-primary,
    .btn-cta-secondary {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .credit-hero h1 {
        font-size: 28px;
    }

    .results-grid {
        grid-template-columns: 1fr;
    }
}
