/* ==========================================================================
   PAGE DÉDIÉE : MON BUDGET & PLAN DE FINANCEMENT (mon-budget.html)
   Inspiré des standards FinTech / Courtage Digital (Pretto, N26, Revolut)
   ========================================================================== */

.budget-page-container {
    max-width: 580px;
    margin: 0 auto;
    padding: 0.75rem 0.85rem 3rem 0.85rem;
    box-sizing: border-box;
    width: 100%;
}

/* 1. Fil d'Ariane / Indicateur d'étape compact */
.budget-stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.75rem;
    color: var(--text-muted, #8B939A);
}

.stepper-step {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 600;
}

.stepper-step.completed {
    color: #059669;
}

.stepper-step.active {
    color: var(--accent-purple, #6366f1);
    font-weight: 700;
}

.stepper-step-num {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.68rem;
    background: #E2E8F0;
    color: #475569;
}

.stepper-step.completed .stepper-step-num {
    background: #DCFCE7;
    color: #059669;
}

.stepper-step.active .stepper-step-num {
    background: var(--accent-purple, #6366f1);
    color: #FFFFFF;
}

.stepper-divider {
    color: #CBD5E1;
    font-size: 0.7rem;
}

/* 2. Carte Maîtresse : Révélation Budget */
.budget-hero-card {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 16px;
    padding: 1.25rem 1rem;
    text-align: center;
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.05), 0 4px 10px -2px rgba(15, 23, 42, 0.03);
    margin-bottom: 1rem;
    box-sizing: border-box;
}

.budget-hero-pill {
    display: inline-flex;
    align-items: center;
    background: rgba(99, 102, 241, 0.08);
    color: var(--accent-purple, #6366f1);
    padding: 0.3rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    margin-bottom: 0.5rem;
}

.budget-hero-amount {
    font-size: clamp(2.1rem, 7vw, 2.6rem);
    font-weight: 800;
    font-family: var(--font-display, sans-serif);
    color: #0F172A;
    line-height: 1.05;
    letter-spacing: -0.03em;
    margin: 0.2rem 0;
}

.budget-hero-subtitle {
    font-size: 0.8rem;
    color: #64748B;
    margin: 0 0 1rem 0;
}

/* 3. Jauge Horizontale Tricolore Segmentée */
.budget-breakdown-bar-wrapper {
    margin: 1.15rem 0 0.85rem 0;
    text-align: left;
}

.budget-stacked-bar {
    display: flex;
    height: 14px;
    border-radius: 999px;
    overflow: hidden;
    background: #F1F5F9;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.06);
    margin-bottom: 0.75rem;
}

.bar-segment {
    height: 100%;
    transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.bar-segment-loan {
    background: var(--accent-purple, #6366f1);
}

.bar-segment-ptz {
    background: #10B981;
}

.bar-segment-contrib {
    background: #F59E0B;
}

/* Légende détaillée sous la barre */
.budget-legend-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.budget-legend-item {
    display: flex;
    flex-direction: column;
    padding: 0.5rem;
    background: #F8FAFC;
    border-radius: 10px;
    border: 1px solid #E2E8F0;
    box-sizing: border-box;
}

.legend-head {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.68rem;
    font-weight: 700;
    color: #64748B;
    margin-bottom: 0.2rem;
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.legend-dot-loan { background: var(--accent-purple, #6366f1); }
.legend-dot-ptz { background: #10B981; }
.legend-dot-contrib { background: #F59E0B; }

.legend-val {
    font-size: 0.85rem;
    font-weight: 800;
    font-family: var(--font-mono, monospace);
    color: #0F172A;
    line-height: 1.15;
}

.legend-sub {
    font-size: 0.65rem;
    color: #64748B;
    margin-top: 0.15rem;
}

/* 4. Cartes des Métriques Bento Grid (FinTech Moderne) */
.budget-metrics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.metric-card {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 14px;
    padding: 0.95rem 0.85rem;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 106px;
    box-shadow: 0 4px 14px -3px rgba(15, 23, 42, 0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Micro-liserés verticaux distinctifs FinTech (Style Mercury / Pretto) */
.metric-card-loan {
    border-left: 3.5px solid var(--accent-purple, #6366f1);
}

.metric-card-rate {
    border-left: 3.5px solid #0284c7;
}

.metric-card-debt {
    border-left: 3.5px solid #10b981;
}

.metric-card-notary {
    border-left: 3.5px solid #059669;
}

/* En-tête interne de chaque carte (Label + Micro-tag dynamique) */
.metric-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem;
    margin-bottom: 0.2rem;
}

.metric-label {
    font-size: 0.72rem;
    color: #64748B;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.metric-tag {
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    line-height: 1.2;
}

.tag-purple {
    background: rgba(99, 102, 241, 0.08);
    color: var(--accent-purple, #6366f1);
}

.tag-blue {
    background: rgba(2, 132, 199, 0.08);
    color: #0284c7;
}

.tag-green {
    background: #DCFCE7;
    color: #15803D;
}

/* Point de statut actif "Live" pour la norme HCSF */
.metric-live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #10B981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
    animation: livePulse 2.5s infinite;
    flex-shrink: 0;
}

@keyframes livePulse {
    0%, 100% { box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25); }
    50% { box-shadow: 0 0 0 5px rgba(16, 185, 129, 0.08); }
}

.metric-val {
    font-size: 1.28rem;
    font-weight: 800;
    color: #0F172A;
    font-family: var(--font-mono, monospace);
    line-height: 1.05;
    margin: 0.1rem 0 0.05rem 0;
}

.metric-detail {
    font-size: 0.68rem;
    color: #64748B;
    line-height: 1.2;
    margin-top: 0;
}

.detail-success {
    color: #15803D;
    font-weight: 600;
}

/* Badges sobres pour Tier 2 */
.bento-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-size: 0.68rem;
    font-weight: 600;
    width: fit-content;
    margin-top: 0.15rem;
    line-height: 1.25;
}

.bento-badge-savings {
    background: #F0FDF4;
    color: #166534;
    border: 1px solid #86EFAC;
    font-family: var(--font-mono, monospace);
    font-weight: 700;
}

/* Tier 3 : Bannière Gain Intérêts PTZ */
.metric-card-ptz-banner {
    grid-column: span 2;
    background: linear-gradient(135deg, #ECFDF5 0%, #F0FDF4 100%);
    border: 1px solid #6EE7B7;
    border-radius: 14px;
    padding: 1rem;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.08);
}

.ptz-banner-badge {
    display: inline-block;
    background: #047857;
    color: #FFFFFF;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    margin-bottom: 0.55rem;
}

.ptz-banner-numbers {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.3rem;
}

.ptz-banner-val {
    font-size: 1.55rem;
    font-weight: 800;
    color: #065F46;
    font-family: var(--font-mono, monospace);
    line-height: 1;
}

.ptz-banner-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: #047857;
}

.ptz-banner-sub {
    font-size: 0.72rem;
    color: #065F46;
    margin: 0;
    line-height: 1.35;
}

/* 4bis. Encart FinTech Pliable (Accordéon Compact) */
.budget-boost-accordion {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    box-shadow: 0 2px 8px -2px rgba(15, 23, 42, 0.04);
    box-sizing: border-box;
    margin-bottom: 1rem;
    overflow: hidden;
    transition: all 0.2s ease;
}

.boost-accordion-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.7rem 0.85rem;
    cursor: pointer;
    user-select: none;
    list-style: none;
}

.boost-accordion-summary::-webkit-details-marker {
    display: none;
}

.boost-summary-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.boost-pill {
    display: inline-block;
    background: rgba(99, 102, 241, 0.08);
    color: var(--accent-purple, #6366f1);
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
}

.boost-summary-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: #1E293B;
}

.boost-chevron {
    color: #94A3B8;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.25s ease;
    flex-shrink: 0;
    margin-left: 0.5rem;
}

.budget-boost-accordion[open] .boost-chevron {
    transform: rotate(180deg);
}

.boost-accordion-body {
    padding: 0.75rem 0.85rem 0.85rem 0.85rem;
    border-top: 1px solid #F1F5F9;
    background: #FAFAFC;
    animation: fadeInAccordion 0.2s ease-out;
}

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

.boost-desc {
    font-size: 0.76rem;
    color: #475569;
    margin: 0 0 0.65rem 0;
    line-height: 1.45;
}

.boost-items-grid {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.boost-item {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    padding: 0.6rem 0.75rem;
    box-sizing: border-box;
}

.boost-item-action {
    border-left: 3.5px solid var(--accent-purple, #6366f1);
}

.boost-item-bank {
    border-left: 3.5px solid #0284c7;
}

.boost-item-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: #0F172A;
    display: block;
    margin-bottom: 0.15rem;
}

.boost-item-sub {
    font-size: 0.71rem;
    color: #64748B;
    display: block;
    line-height: 1.35;
}

/* 5. Bouton Primaire in-page */
.budget-cta-card {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 14px;
    padding: 1rem;
    text-align: center;
    box-shadow: 0 4px 15px rgba(15, 23, 42, 0.04);
    box-sizing: border-box;
    margin-top: 0.5rem;
}

.btn-proceed-results {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.95rem 1.25rem;
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
    color: #FFFFFF !important;
    font-size: 1rem;
    font-weight: 700;
    font-family: var(--font-display, sans-serif);
    border-radius: 12px;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.btn-proceed-results:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(99, 102, 241, 0.45);
}

.budget-cta-reassurance {
    font-size: 0.73rem;
    color: #64748B;
    margin-top: 0.55rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

/* Bouton secondaire pour modifier ses critères */
.btn-modify-criteria {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.65rem;
    background: none;
    border: none;
    color: var(--accent-purple, #6366f1);
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
    font-family: inherit;
}

/* 6. Mentions Légales & Disclaimer Simulation */
.budget-disclaimer {
    font-size: 0.68rem;
    color: #94A3B8;
    text-align: center;
    line-height: 1.45;
    margin: 1.25rem auto 0 auto;
    max-width: 520px;
}
