/* =========================================
   COMPAS PATRIMONIAL I.A.
   Premium Interactive Simulator
   Glassmorphism · Animated · Cycle-Aware
   ========================================= */

/* ── Section (merged with cycle above) ── */
.compas-section {
    position: relative;
    padding: 50px 0 60px;
    background: transparent;
    overflow: hidden;
}

/* Decorative Orbs */
.compas-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(35px);
    opacity: 0.15;
    pointer-events: none;
    z-index: 0;
}

.compas-orb-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, #0077b6, transparent);
    top: -100px;
    right: -150px;
}

.compas-orb-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, #00b4d8, transparent);
    bottom: -100px;
    left: -100px;
}

/* ── Header ── */
.compas-header {
    text-align: center;
    margin-bottom: 14px;
    position: relative;
    z-index: 2;
    transform: scale(0.9);
    opacity: 0.8;
}

.compas-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(0, 119, 182, .08), rgba(0, 180, 216, .08));
    border: 1px solid rgba(0, 119, 182, .12);
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 0.82rem;
    font-weight: 700;
    color: #0077b6;
    margin-bottom: 12px;
    letter-spacing: 0.03em;
    padding: 8px 20px;
    font-size: 0.82rem;
}

.compas-badge i,
.compas-badge svg {
    width: 15px;
    height: 15px;
}

.compas-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #3b5b6f;
    margin-bottom: 8px;
    line-height: 1.2;
}

.compas-header p {
    font-size: 0.95rem;
    color: #7a9cb5;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.5;
}

/* ── Main Glass Container ── */
.compas-glass {
    position: relative;
    z-index: 2;
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(24px) saturate(1.8);
    -webkit-backdrop-filter: blur(24px) saturate(1.8);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    box-shadow:
        0 20px 60px rgba(0, 40, 80, 0.06),
        0 4px 16px rgba(0, 40, 80, 0.03),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    padding: 32px;
    overflow: hidden;
}

/* Animated border glow */
.compas-glass::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 26px;
    background: linear-gradient(135deg, transparent 30%, rgba(0, 119, 182, 0.15) 50%, transparent 70%);
    background-size: 300% 300%;
    animation: none;
    z-index: -1;
}

@keyframes compasGlow {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

/* ── Layout ── */
.compas-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 32px;
    align-items: start;
}

/* ── Controls Panel (Left) ── */
.compas-controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Cycle Indicator */
.compas-cycle-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 119, 182, 0.04);
    border: 1px solid rgba(0, 119, 182, 0.1);
    border-radius: 12px;
    padding: 10px 14px;
    transition: all 0.4s ease;
    cursor: pointer;
}

.compas-cycle-indicator:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.compas-cycle-indicator.expansion {
    border-color: rgba(16, 185, 129, 0.2);
    background: rgba(16, 185, 129, 0.04);
}

.compas-cycle-indicator.surchauffe {
    border-color: rgba(245, 158, 11, 0.2);
    background: rgba(245, 158, 11, 0.04);
}

.compas-cycle-indicator.recession {
    border-color: rgba(239, 68, 68, 0.2);
    background: rgba(239, 68, 68, 0.04);
}

.compas-cycle-indicator.reprise {
    border-color: rgba(59, 130, 246, 0.2);
    background: rgba(59, 130, 246, 0.04);
}

.cycle-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #0077b6;
    animation: none;
    flex-shrink: 0;
}

.compas-cycle-indicator.expansion .cycle-dot {
    background: #10b981;
}

.compas-cycle-indicator.surchauffe .cycle-dot {
    background: #f59e0b;
}

.compas-cycle-indicator.recession .cycle-dot {
    background: #ef4444;
}

.compas-cycle-indicator.reprise .cycle-dot {
    background: #3b82f6;
}

@keyframes cycleDotPulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(0, 119, 182, 0.3);
    }

    50% {
        box-shadow: 0 0 0 6px rgba(0, 119, 182, 0);
    }
}

.cycle-indicator-text {
    font-size: 0.75rem;
    color: #5a7d95;
    line-height: 1.3;
    flex: 1;
}

.cycle-indicator-text strong {
    display: block;
    color: #0a2540;
    font-size: 0.8rem;
    margin-bottom: 1px;
}

.cycle-hint {
    font-size: 0.7rem;
    color: #0077b6;
    opacity: 0.7;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 3px;
}

.cycle-hint i,
.cycle-hint svg {
    width: 11px;
    height: 11px;
}

/* Slider Groups */
.compas-slider-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.slider-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.78rem;
    font-weight: 600;
    color: #3a5a6e;
}

.slider-value {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 1.1rem;
    color: #0077b6;
    letter-spacing: -0.02em;
}

/* Custom Range Slider */
.compas-range {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 6px;
    background: linear-gradient(90deg, #0077b6 0%, #e2ecf2 0%);
    outline: none;
    cursor: pointer;
    transition: background 0.1s;
}

.compas-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0077b6, #00b4d8);
    border: 2px solid #fff;
    box-shadow: 0 2px 10px rgba(0, 119, 182, 0.3);
    cursor: grab;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.compas-range::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 18px rgba(0, 119, 182, 0.4);
}

.compas-range::-webkit-slider-thumb:active {
    cursor: grabbing;
    transform: scale(1.05);
}

/* Risk Profile Toggle */
.compas-profile-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.profile-buttons {
    display: flex;
    gap: 5px;
}

.profile-btn {
    flex: 1;
    padding: 8px 6px;
    border: 1.5px solid rgba(0, 119, 182, 0.12);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.6);
    color: #5a7d95;
    font-size: 0.72rem;
    font-weight: 700;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.profile-btn:hover {
    border-color: rgba(0, 119, 182, 0.25);
    background: rgba(0, 119, 182, 0.04);
}

.profile-btn.active {
    background: linear-gradient(135deg, #0077b6, #00a8cc);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 14px rgba(0, 119, 182, 0.25);
}

/* Editable slider value inputs */
.slider-value-input {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.82rem;
    font-weight: 700;
    color: #0077b6;
    background: transparent;
    border: 1.5px solid transparent;
    border-radius: 6px;
    padding: 2px 8px;
    text-align: right;
    min-width: 90px;
    max-width: 140px;
    transition: all 0.25s ease;
    cursor: text;
    outline: none;
}

.slider-value-input:hover {
    background: rgba(0, 119, 182, 0.04);
    border-color: rgba(0, 119, 182, 0.15);
}

.slider-value-input:focus {
    background: #fff;
    border-color: #00b4d8;
    box-shadow: 0 0 0 3px rgba(0, 180, 216, 0.12);
    color: #03045e;
}

/* Custom Return Rate */
.compas-return-group {
    margin-top: 2px;
}

.compas-return-source {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 4px;
    padding: 5px 10px;
    background: linear-gradient(135deg, rgba(0, 119, 182, 0.04), rgba(0, 180, 216, 0.04));
    border: 1px solid rgba(0, 119, 182, 0.08);
    border-radius: 6px;
    font-size: 0.68rem;
    color: #586e82;
    line-height: 1.3;
}

.compas-return-source.custom-active {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.06), rgba(245, 158, 11, 0.03));
    border-color: rgba(245, 158, 11, 0.15);
    color: #92600a;
}

/* Cycle context note */
.compas-cycle-note {
    display: none;
    margin-top: 5px;
    padding: 7px 11px;
    border-radius: 7px;
    font-size: 0.7rem;
    line-height: 1.45;
    color: #3a4f63;
    border-left: 3px solid var(--cyan);
    background: rgba(255, 255, 255, 0.5);
    animation: cycleNoteIn 0.3s ease;
}

.compas-cycle-note.visible {
    display: none;
}

.compas-cycle-note .cycle-note-title {
    font-weight: 700;
    margin-bottom: 2px;
}

.compas-cycle-note.cycle-expansion { border-left-color: #10b981; }
.compas-cycle-note.cycle-surchauffe { border-left-color: #f59e0b; }
.compas-cycle-note.cycle-recession { border-left-color: #ef4444; }
.compas-cycle-note.cycle-reprise { border-left-color: #3b82f6; }

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

/* CTA */
.compas-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #0077b6, #00a8cc);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 18px rgba(0, 119, 182, 0.2);
    text-decoration: none;
}

.compas-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(0, 119, 182, 0.3);
}

.compas-cta i,
.compas-cta svg {
    width: 18px;
    height: 18px;
}

/* ── Results Panel (Right) ── */
.compas-results {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Growth Projection */
.compas-projection {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(0, 119, 182, 0.08);
    border-radius: 14px;
    padding: 18px 22px;
}

.projection-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.projection-header h3 {
    font-size: 0.85rem;
    font-weight: 700;
    color: #0a2540;
    display: flex;
    align-items: center;
    gap: 8px;
}

.projection-header h3 i,
.projection-header h3 svg {
    width: 16px;
    height: 16px;
    color: #0077b6;
}

.projection-final {
    text-align: right;
}

.projection-final .big-number {
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(1.4rem, 2.5vw, 1.8rem);
    font-weight: 800;
    color: #0077b6;
    line-height: 1.1;
    letter-spacing: -0.03em;
}

.projection-final .subtitle {
    font-size: 0.72rem;
    color: #8ba3b5;
    margin-top: 2px;
}

/* SVG Chart */
.compas-chart-wrap {
    position: relative;
    height: 220px;
    width: 100%;
    cursor: crosshair;
}

.compas-chart-wrap svg {
    width: 100%;
    height: 100%;
}

/* ── Chart Tooltip Overlay ── */
.chart-crosshair {
    position: absolute;
    top: 0;
    bottom: 30px;
    width: 1px;
    border-left: 1px dashed rgba(10, 37, 64, 0.25);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: 5;
}

.chart-crosshair.visible {
    opacity: 1;
}

.chart-hover-dot {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
    pointer-events: none;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: 6;
}

.chart-hover-dot.visible {
    opacity: 1;
}

.chart-tooltip {
    position: absolute;
    background: rgba(10, 37, 64, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #fff;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.78rem;
    line-height: 1.5;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: 10;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
}

.chart-tooltip.visible {
    opacity: 1;
}

.chart-tooltip-year {
    font-weight: 700;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 2px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.chart-tooltip-value {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 0.95rem;
    color: #fff;
}

.chart-tooltip-range {
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.55);
    margin-top: 2px;
}

.chart-line {
    fill: none;
    stroke: url(#compas-gradient);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 2px 4px rgba(0, 119, 182, 0.2));
    transition: d 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.chart-area {
    fill: url(#compas-area-gradient);
    opacity: 0.3;
    transition: d 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.chart-gridline {
    stroke: rgba(0, 119, 182, 0.08);
    stroke-width: 1;
    stroke-dasharray: 5, 5;
}

.chart-y-label {
    font-size: 9px;
    fill: #8ba3b5;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    text-anchor: end;
}

.chart-label {
    font-size: 11px;
    fill: #8ba3b5;
    font-family: 'Open Sans', sans-serif;
}

/* Year markers at bottom of chart */
.chart-year-label {
    font-size: 9px;
    fill: #8ba3b5;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    text-anchor: middle;
}

/* Capital invested baseline */
.chart-capital-line {
    stroke: #8ba3b5;
    stroke-width: 1.5;
    stroke-dasharray: 6, 5;
    opacity: 0.45;
    fill: none;
    transition: d 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.chart-capital-label {
    font-size: 8px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    fill: #8ba3b5;
    text-anchor: start;
    opacity: 0.7;
}

/* Start & end dots */
.chart-dot-start {
    fill: #8ba3b5;
}

.chart-dot-end {
    fill: #0077b6;
    filter: drop-shadow(0 0 4px rgba(0, 119, 182, 0.4));
}

.chart-dot-end-ring {
    fill: none;
    stroke: rgba(0, 119, 182, 0.25);
    stroke-width: 1.5;
    animation: none;
}

@keyframes endDotPulse {
    0%, 100% { r: 6; opacity: 0.5; }
    50% { r: 10; opacity: 0; }
}

/* ── AI Analysis Box ── */
.compas-ai-box {
    position: relative;
    background: linear-gradient(135deg, rgba(10, 37, 64, 0.03), rgba(0, 119, 182, 0.04));
    border: 1px solid rgba(0, 119, 182, 0.1);
    border-radius: 14px;
    padding: 18px 22px;
    overflow: hidden;
}

/* Scanner sweep effect */
.compas-ai-box::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 119, 182, 0.06), transparent);
    animation: none;
    pointer-events: none;
}

@keyframes compasScanner {
    0% {
        left: -50%;
    }

    100% {
        left: 150%;
    }
}

.ai-box-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.ai-icon-ring {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0077b6, #00b4d8);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    animation: aiBobbing 3s ease-in-out 2;
}

@keyframes aiBobbing {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-3px);
    }
}

.ai-icon-ring i,
.ai-icon-ring svg {
    width: 15px;
    height: 15px;
    color: #fff;
}

.ai-box-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: #0a2540;
}

.ai-box-subtitle {
    font-size: 0.68rem;
    color: #8ba3b5;
}

#compas-ai-text {
    font-size: 0.82rem;
    line-height: 1.55;
    color: #2c4a5e;
    min-height: 50px;
    transition: opacity 0.3s ease;
}

#compas-ai-text strong {
    color: #0077b6;
}

#compas-ai-text .ai-emoji {
    font-size: 1.1rem;
    margin-right: 4px;
}

/* Stats Row */
.compas-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.compas-stat {
    text-align: center;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(0, 119, 182, 0.06);
    border-radius: 12px;
    padding: 12px 10px;
}

.compas-stat .stat-value {
    font-family: 'Montserrat', sans-serif;
    font-size: 1rem;
    font-weight: 800;
    color: #0077b6;
    margin-bottom: 3px;
}

.compas-stat .stat-label {
    font-size: 0.68rem;
    color: #8ba3b5;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ── Fourchette estimée ── */
.stat-value--animated {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0;
}

.stat-num {
    display: inline-block;
    min-width: 1.2em;
    text-align: center;
}

.stat-separator {
    color: #a0b4c4;
    font-weight: 400;
}

/* ── Benchmark Comparison Panel ── */
.benchmark-panel {
    margin-top: 10px;
    background: rgba(255, 255, 255, 0.45);
    border: 1px solid rgba(0, 119, 182, 0.08);
    border-radius: 12px;
    padding: 12px 14px 14px;
    transition: border-color 0.3s;
}

/* Hover link: highlight fourchette stat when hovering panel */
.benchmark-panel:hover {
    border-color: rgba(0, 119, 182, 0.2);
}

.benchmark-panel:hover ~ .compas-stats .compas-stat--fourchette,
.benchmark-panel-linked {
    border-color: rgba(0, 119, 182, 0.25) !important;
    box-shadow: 0 0 0 2px rgba(0, 180, 216, 0.1);
}

.compas-stat--fourchette {
    transition: border-color 0.3s, box-shadow 0.3s;
    cursor: default;
}

.benchmark-panel-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #5a7d95;
    margin-bottom: 10px;
    line-height: 1.4;
}

.benchmark-panel-title strong {
    color: #0077b6;
    font-weight: 800;
}

.benchmark-rows {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.benchmark-row {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(0, 119, 182, 0.05);
    border-radius: 10px;
    padding: 10px 12px;
}

.bench-row-top {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.bench-flag {
    font-size: 1.05rem;
    line-height: 1;
}

.bench-name {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    color: #0a2540;
    margin-right: auto;
}

.bench-val {
    display: flex;
    align-items: baseline;
    gap: 3px;
}

.bench-pct {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.8rem;
    font-weight: 800;
    color: #0077b6;
}

.bench-val small {
    font-size: 0.58rem;
    color: #8ba3b5;
    font-weight: 500;
}

.bench-explain {
    margin: 5px 0 0;
    font-size: 0.68rem;
    line-height: 1.45;
    color: #5a7d95;
    padding-left: 28px;
    transition: color 0.3s;
}

.bench-explain strong {
    font-weight: 700;
    color: #0077b6;
}

/* ── Disclaimer ── */
.compas-disclaimer {
    text-align: center;
    font-size: 0.68rem;
    color: #a0b4c4;
    margin-top: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.compas-disclaimer i,
.compas-disclaimer svg {
    width: 12px;
    height: 12px;
}

/* ── Mobile Responsive ── */
@media (max-width: 968px) {
    .compas-section {
        padding: 40px 0 50px;
    }

    .compas-glass {
        padding: 22px 16px;
        border-radius: 18px;
    }

    .compas-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .compas-stats {
        grid-template-columns: repeat(3, 1fr);
    }

    .compas-chart-wrap {
        height: 190px;
    }



    .chart-tooltip {
        font-size: 0.72rem;
        padding: 8px 10px;
    }

    .chart-tooltip-value {
        font-size: 0.85rem;
    }

    .compas-pdf-btn {
        width: 100%;
    }
}

/* =========================================
   MOBILE — Clean, touch-friendly, minimal
   ========================================= */
@media (max-width: 768px) {

    /* ── Hide secondary elements ── */
    .compas-cycle-indicator,
    .compas-goal-group,
    .compas-discover-btn,
    .compas-pdf-group,
    .benchmark-panel,
    .compas-stat--fourchette,
    .chart-legend-bar,
    .compas-disclaimer,
    .compas-header p,
    .goal-badge { display: none !important; }

    /* ── Toggles — compact on mobile ── */
    .compas-toggle-group {
        padding: 6px 0;
    }
    .compas-toggle-group .toggle-label {
        font-size: 0.78rem;
    }

    /* ── Return slider — compact ── */
    .compas-return-group .compas-return-source {
        font-size: 0.68rem;
    }

    /* ── Monte Carlo panel — compact on mobile ── */
    .mc-panel {
        padding: 12px 14px;
        border-radius: 12px;
    }
    .mc-explanation {
        font-size: 0.68rem;
    }
    .mc-scenario-value {
        font-size: 0.78rem;
    }

    /* ── AI Box — collapsible on mobile ── */
    .compas-ai-box {
        padding: 0 !important;
        background: none !important;
        border: none !important;
        overflow: visible !important;
    }
    .compas-ai-box::after { display: none; }

    .ai-box-header {
        background: linear-gradient(135deg, rgba(10, 37, 64, 0.03), rgba(0, 119, 182, 0.04));
        border: 1px solid rgba(0, 119, 182, 0.1);
        border-radius: 12px;
        padding: 12px 16px;
        margin-bottom: 0;
        cursor: pointer;
        position: relative;
    }
    .ai-box-header::after {
        content: '▼';
        position: absolute;
        right: 14px;
        top: 50%;
        transform: translateY(-50%);
        font-size: 0.6rem;
        color: #8ba3b5;
        transition: transform 0.3s ease;
    }
    .compas-ai-box.ai-open .ai-box-header::after {
        transform: translateY(-50%) rotate(180deg);
    }

    #compas-ai-text {
        display: none;
        background: linear-gradient(135deg, rgba(10, 37, 64, 0.03), rgba(0, 119, 182, 0.04));
        border: 1px solid rgba(0, 119, 182, 0.1);
        border-top: none;
        border-radius: 0 0 12px 12px;
        padding: 12px 16px;
        font-size: 0.78rem;
        line-height: 1.5;
    }
    .compas-ai-box.ai-open #compas-ai-text {
        display: block;
    }
    .compas-ai-box.ai-open .ai-box-header {
        border-radius: 12px 12px 0 0;
    }

    /* ── Section breathing room ── */
    .compas-section { padding: 30px 0 40px; }

    /* ── Header — compact ── */
    .compas-header { margin-bottom: 16px !important; }
    .compas-header h2 { font-size: 1.25rem !important; margin-bottom: 0 !important; }

    /* ── Glass card — tight padding ── */
    .compas-glass {
        padding: 16px 14px;
        border-radius: 18px;
    }

    /* ── Layout — results first on mobile ── */
    .compas-layout {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .compas-results { order: -1; }

    /* ── Big number — hero prominence ── */
    .compas-projection { margin-bottom: 0; }
    .projection-header {
        flex-direction: column;
        align-items: center !important;
        text-align: center;
        gap: 4px;
    }
    .projection-header h3 { font-size: 0.78rem; }
    .projection-final { text-align: center; }
    .big-number {
        font-size: 2rem !important;
        letter-spacing: -0.03em;
    }
    .subtitle { font-size: 0.72rem !important; }

    /* ── Chart — full width, good height ── */
    .compas-chart-wrap {
        height: 170px;
        margin-top: 8px;
        border-radius: 12px;
    }

    /* ── Stats — 2 cols, compact ── */
    .compas-stats {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        margin-top: 4px;
    }
    .compas-stat {
        padding: 10px 8px !important;
        border-radius: 10px !important;
    }
    .stat-value { font-size: 0.95rem !important; }
    .stat-label { font-size: 0.65rem !important; }

    /* ── Controls — compact spacing ── */
    .compas-controls { gap: 12px; }

    /* ── Slider labels — bigger text, more readable ── */
    .slider-label {
        font-size: 0.82rem;
    }
    .slider-label span { display: flex; align-items: center; gap: 5px; }

    /* ── Hide tooltip triggers on mobile (? buttons) ── */
    .compas-controls .tooltip-trigger { display: none; }

    /* ── Slider value input — bigger for touch ── */
    .slider-value-input {
        font-size: 0.88rem;
        padding: 4px 10px;
        min-width: 100px;
        border: 1.5px solid rgba(0, 119, 182, 0.12);
        border-radius: 8px;
        background: rgba(0, 119, 182, 0.03);
    }

    /* ── Range slider — fatter track + bigger thumb for touch ── */
    .compas-range {
        height: 10px;
        border-radius: 10px;
    }
    .compas-range::-webkit-slider-thumb {
        width: 28px;
        height: 28px;
        border: 3px solid #fff;
        box-shadow: 0 2px 12px rgba(0, 119, 182, 0.35);
    }
    .compas-range::-moz-range-thumb {
        width: 28px;
        height: 28px;
        border: 3px solid #fff;
        border-radius: 50%;
        background: linear-gradient(135deg, #0077b6, #00b4d8);
        box-shadow: 0 2px 12px rgba(0, 119, 182, 0.35);
    }

    /* ── Profile buttons — horizontal, bigger touch targets ── */
    .profile-buttons {
        flex-direction: row;
        gap: 6px;
    }
    .profile-btn {
        padding: 12px 8px;
        font-size: 0.75rem;
        border-radius: 12px;
    }
    .profile-btn i, .profile-btn svg {
        width: 16px !important;
        height: 16px !important;
    }

    /* ── CTA — full width, prominent ── */
    .compas-cta {
        width: 100%;
        padding: 14px 20px;
        font-size: 0.88rem;
        border-radius: 14px;
        margin-top: 4px;
    }
}

@media (max-width: 480px) {
    .compas-glass {
        padding: 18px 12px;
    }

    .profile-buttons {
        flex-direction: column;
        gap: 6px;
    }

    .compas-stats {
        grid-template-columns: 1fr 1fr;
    }

    .projection-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .projection-final {
        text-align: left;
    }

    .bench-row-top {
        flex-wrap: wrap;
        gap: 5px;
    }

    .bench-explain {
        padding-left: 0;
        font-size: 0.63rem;
    }

    .benchmark-panel-title {
        font-size: 0.65rem;
    }

    .compas-stat--return .tooltip-bubble {
        width: 180px;
        left: auto;
        right: -10px;
        transform: translateX(0) translateY(5px);
    }

    .compas-stat--return .tooltip-trigger:hover .tooltip-bubble {
        transform: translateX(0) translateY(0);
    }

    .quiz-card {
        padding: 24px 16px;
    }

    .quiz-option {
        padding: 14px 16px;
        font-size: 0.88rem;
    }
}

/* =========================================
   V2 — QUESTIONNAIRE MODAL
   ========================================= */

/* Discover button */
.compas-discover-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.6);
    border: 1.5px dashed rgba(0, 119, 182, 0.25);
    border-radius: 14px;
    color: #0077b6;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.compas-discover-btn:hover {
    background: rgba(0, 119, 182, 0.06);
    border-style: solid;
    border-color: rgba(0, 119, 182, 0.35);
    transform: translateY(-1px);
}

.compas-discover-btn i,
.compas-discover-btn svg {
    width: 16px;
    height: 16px;
}

/* Modal Overlay */
.quiz-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(10, 37, 64, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
    padding: 20px;
}

.quiz-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* Modal Container */
.quiz-modal {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 24px 80px rgba(0, 40, 80, 0.15);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: translateY(20px) scale(0.96);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.quiz-overlay.active .quiz-modal {
    transform: translateY(0) scale(1);
}

/* Close button */
.quiz-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(0, 40, 80, 0.05);
    border: none;
    padding: 10px;
    border-radius: 12px;
    cursor: pointer;
    color: #5a7d95;
    transition: all 0.25s;
    z-index: 2;
}

.quiz-close:hover {
    background: rgba(0, 119, 182, 0.1);
    color: #0077b6;
}

.quiz-close i,
.quiz-close svg {
    width: 18px;
    height: 18px;
}

/* Progress Bar */
.quiz-progress {
    padding: 24px 32px 0;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    font-weight: 600;
    color: #8ba3b5;
    margin-bottom: 8px;
}

.progress-bar {
    height: 4px;
    background: #e8f0f5;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #0077b6, #00b4d8);
    border-radius: 4px;
    transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Quiz Card (each question) */
.quiz-card {
    padding: 32px;
    display: none;
}

.quiz-card.active {
    display: block;
    animation: quizSlideIn 0.4s ease;
}

@keyframes quizSlideIn {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.quiz-card h3 {
    font-size: 1.15rem;
    font-weight: 800;
    color: #0a2540;
    margin-bottom: 6px;
    line-height: 1.3;
}

.quiz-card .quiz-subtitle {
    font-size: 0.82rem;
    color: #8ba3b5;
    margin-bottom: 24px;
}

/* Answer Options */
.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.quiz-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.7);
    border: 1.5px solid rgba(0, 119, 182, 0.08);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.25s ease;
    font-size: 0.92rem;
    font-weight: 600;
    color: #2c4a5e;
}

.quiz-option:hover {
    border-color: rgba(0, 119, 182, 0.2);
    background: rgba(0, 119, 182, 0.03);
    transform: translateX(4px);
}

.quiz-option.selected {
    border-color: #0077b6;
    background: rgba(0, 119, 182, 0.06);
    color: #0077b6;
}

.quiz-option .option-emoji {
    font-size: 1.3rem;
    flex-shrink: 0;
    width: 32px;
    text-align: center;
}

/* Result Screen */
.quiz-result {
    padding: 40px 32px;
    text-align: center;
    display: none;
}

.quiz-result.active {
    display: block;
    animation: quizSlideIn 0.5s ease;
}

.result-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    animation: resultBounce 0.6s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

@keyframes resultBounce {
    0% {
        transform: scale(0);
    }

    60% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

.quiz-result h3 {
    font-size: 1.4rem;
    font-weight: 800;
    color: #0a2540;
    margin-bottom: 8px;
}

.quiz-result .result-profile {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0077b6;
    margin-bottom: 16px;
}

.quiz-result p {
    font-size: 0.92rem;
    color: #5a7d95;
    line-height: 1.6;
    margin-bottom: 28px;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
}

.quiz-apply-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: linear-gradient(135deg, #0077b6, #00a8cc);
    color: #fff;
    border: none;
    border-radius: 14px;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 18px rgba(0, 119, 182, 0.25);
}

.quiz-apply-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(0, 119, 182, 0.35);
}

.quiz-apply-btn i,
.quiz-apply-btn svg {
    width: 18px;
    height: 18px;
}

/* =========================================
   V2 — EDUCATIONAL TOOLTIPS
   ========================================= */

.tooltip-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(0, 119, 182, 0.08);
    color: #0077b6;
    font-size: 0.65rem;
    font-weight: 800;
    cursor: help;
    margin-left: 6px;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.tooltip-trigger:hover {
    background: rgba(0, 119, 182, 0.15);
    transform: scale(1.1);
}

.tooltip-bubble {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(5px);
    background: rgba(10, 37, 64, 0.92);
    backdrop-filter: blur(12px);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 500;
    line-height: 1.5;
    padding: 12px 16px;
    border-radius: 12px;
    width: 240px;
    pointer-events: none;
    opacity: 0;
    transition: all 0.25s ease;
    z-index: 100;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.tooltip-bubble::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(10, 37, 64, 0.92);
}

.tooltip-trigger:hover .tooltip-bubble {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

/* =========================================
   V2 — VISUAL MERGE (Cycle → Compas)
   ========================================= */

/* Transition connector between sections */
.compas-connector {
    text-align: center;
    padding: 30px 0 10px;
    position: relative;
    z-index: 2;
}

.connector-line {
    width: 2px;
    height: 40px;
    background: linear-gradient(to bottom, rgba(0, 119, 182, 0.15), rgba(0, 119, 182, 0.04));
    margin: 0 auto 16px;
    border-radius: 2px;
}

.connector-text {
    font-size: 0.75rem;
    font-weight: 600;
    color: #8ba3b5;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.connector-text i,
.connector-text svg {
    width: 14px;
    height: 14px;
    color: #0077b6;
}

/* =========================================
   V3 — CHART CURVES (single active)
   ========================================= */

/* Active profile curve */
.chart-line-active {
    fill: none;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 2px 6px rgba(0, 119, 182, 0.25));
    transition: d 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.chart-area-multi-active {
    opacity: 0.2;
    transition: d 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── Chart Legend Bar (HTML above chart) ── */
.chart-legend-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
    padding: 0 4px;
}

.chart-legend-profile {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #0077b6;
    flex-shrink: 0;
    box-shadow: 0 0 0 3px rgba(0, 119, 182, 0.15);
}

.legend-profile-name {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    color: #0a2540;
}

.legend-profile-val {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.78rem;
    font-weight: 800;
    color: #0077b6;
    background: rgba(0, 119, 182, 0.06);
    padding: 2px 8px;
    border-radius: 6px;
}

.chart-legend-capital {
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend-dash {
    width: 16px;
    height: 0;
    border-top: 2px dashed #8ba3b5;
    opacity: 0.5;
}

.legend-capital-label {
    font-size: 0.68rem;
    font-weight: 600;
    color: #8ba3b5;
}

/* =========================================
   V4 — INFLATION TOGGLE
   ========================================= */

.compas-toggle-group {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
}

.compas-toggle {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    flex-shrink: 0;
}

.compas-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #cdd8e0;
    border-radius: 22px;
    transition: all 0.3s ease;
}

.toggle-slider:before {
    content: '';
    position: absolute;
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.compas-toggle input:checked + .toggle-slider {
    background: #0077b6;
}

.compas-toggle input:checked + .toggle-slider:before {
    transform: translateX(18px);
}

.toggle-label {
    font-size: 0.82rem;
    color: #3a5a6e;
    font-weight: 600;
    line-height: 1.3;
}

/* =========================================
   V4 — MONTE CARLO BAND (P25-P75)
   ========================================= */

.chart-mc-band-inner {
    transition: d 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* =========================================
   V3 — FINANCIAL GOAL
   ========================================= */

.chart-goal-line {
    stroke: #c9a84c;
    stroke-width: 1.5;
    stroke-dasharray: 6, 4;
    opacity: 0.7;
}

.chart-goal-label {
    font-size: 10px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    fill: #c9a84c;
}

.chart-goal-dot {
    fill: #c9a84c;
    animation: none;
}

@keyframes goalDotPulse {
    0%, 100% { r: 4; opacity: 1; }
    50% { r: 6; opacity: 0.7; }
}

/* Goal Badge */
.goal-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 12px;
    font-size: 0.82rem;
    font-weight: 600;
    margin-top: 12px;
    transition: all 0.3s ease;
}

.goal-badge i,
.goal-badge svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.goal-badge.achieved {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: #059669;
}

.goal-badge.not-achieved {
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.2);
    color: #b45309;
}

/* =========================================
   V3 — PDF EXPORT
   ========================================= */

.compas-pdf-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
}

.compas-name-input {
    width: 100%;
    padding: 8px 14px;
    border: 1.5px solid rgba(0, 119, 182, 0.12);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
    font-family: 'Inter', 'Open Sans', sans-serif;
    color: #0a2540;
    outline: none;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.compas-name-input::placeholder {
    color: #a0b4c4;
}

.compas-name-input:focus {
    border-color: rgba(0, 119, 182, 0.35);
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 0 0 3px rgba(0, 119, 182, 0.06);
}

.compas-pdf-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #c9a84c, #d4b85c);
    color: #fff;
    border: none;
    border-radius: 14px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 14px rgba(201, 168, 76, 0.2);
    font-family: 'Inter', 'Open Sans', sans-serif;
}

.compas-pdf-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(201, 168, 76, 0.3);
}

.compas-pdf-btn i,
.compas-pdf-btn svg {
    width: 16px;
    height: 16px;
}

/* Mobile quiz modal */
@media (max-width: 600px) {
    .quiz-modal {
        max-width: 100%;
        border-radius: 20px;
    }

    .quiz-card {
        padding: 24px 20px;
    }

    .quiz-result {
        padding: 32px 20px;
    }

    .quiz-progress {
        padding: 20px 20px 0;
    }

    .tooltip-bubble {
        width: 200px;
        font-size: 0.72rem;
    }
}

/* =========================================
   SECTION : UN FNB NE VOUS CONNAÎT PAS
   ========================================= */

.advisor-advantage {
    position: relative;
    padding: 70px 0 60px;
    background: transparent;
    overflow: hidden;
}

/* ---- Progress Pill ---- */
.flip-progress-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 18px;
    padding: 7px 20px;
    border-radius: 50px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #5a7d95;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 40, 80, 0.08);
    transition: color 0.4s ease, background 0.4s ease, border-color 0.4s ease, transform 0.3s ease;
}

.flip-progress-pill.all-discovered {
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.25);
}

.flip-progress-pill.counter-bump {
    transform: scale(1.15);
    color: #10b981;
}

/* ---- Flip Cards Grid ---- */
.flip-cards-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 22px;
    position: relative;
    z-index: 1;
}

/* ---- Flip Card Container ---- */
.flip-card {
    perspective: 1000px;
    width: 320px;
    height: 340px;
    cursor: pointer;
}

.flip-card--personal { --card-accent: #0077b6; --card-glow: rgba(0, 119, 182, 0.15); }
.flip-card--risk     { --card-accent: #c9a84c; --card-glow: rgba(201, 168, 76, 0.15); }
.flip-card--fiscal   { --card-accent: #10b981; --card-glow: rgba(16, 185, 129, 0.15); }
.flip-card--emotion  { --card-accent: #f97316; --card-glow: rgba(249, 115, 22, 0.15); }
.flip-card--planning { --card-accent: #8b5cf6; --card-glow: rgba(139, 92, 246, 0.15); }

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.flip-card.flipped .flip-card-inner {
    transform: rotateY(180deg);
}

/* Hover tease on non-flipped cards */
.flip-card:not(.flipped):hover .flip-card-inner {
    transform: rotateY(5deg);
}

.flip-card:not(.flipped):hover {
    filter: drop-shadow(0 8px 20px var(--card-glow, rgba(0, 40, 80, 0.1)));
    transform: translateY(-3px);
}

.flip-card {
    transition: transform 0.3s ease, filter 0.3s ease;
}

/* ---- Front & Back shared ---- */
.flip-card-front,
.flip-card-back {
    position: absolute;
    inset: 0;
    border-radius: 18px;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 28px 24px;
    overflow: hidden;
}

/* ---- Front Face ---- */
.flip-card-front {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 119, 182, 0.1);
    border-top: 3px solid var(--card-accent, #0077b6);
    text-align: center;
    box-shadow: 0 4px 24px rgba(0, 40, 80, 0.06);
}

/* Oversized watermark icon */
.flip-card-watermark {
    position: absolute;
    width: 180px !important;
    height: 180px !important;
    color: var(--card-accent, #0077b6);
    opacity: 0.06;
    pointer-events: none;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Radial glow pulse behind front icon */
.flip-card-glow {
    position: absolute;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--card-accent, #0077b6), transparent 70%);
    opacity: 0.12;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -60%);
    animation: none;
    pointer-events: none;
}

@keyframes flipGlowPulse {
    0%, 100% { opacity: 0.06; transform: translate(-50%, -60%) scale(0.9); }
    50% { opacity: 0.12; transform: translate(-50%, -60%) scale(1.15); }
}

.flip-card-number {
    position: absolute;
    top: 16px;
    right: 20px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--card-accent, #0077b6);
    opacity: 0.5;
    letter-spacing: 0.05em;
}

.flip-card-front-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--card-accent, #0077b6), color-mix(in srgb, var(--card-accent, #0077b6) 70%, #00b4d8));
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
    box-shadow: 0 4px 14px var(--card-glow, rgba(0, 119, 182, 0.2));
}

.flip-card-front-icon i,
.flip-card-front-icon svg {
    width: 24px;
    height: 24px;
    color: #fff;
}

.flip-card-question {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.05rem;
    font-weight: 800;
    color: #0a2540;
    line-height: 1.4;
    margin-bottom: 18px;
    position: relative;
    z-index: 1;
}

.flip-card-hint {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    color: #8ba3b5;
    letter-spacing: 0.03em;
    position: relative;
    z-index: 1;
}

.flip-hint-icon {
    width: 14px !important;
    height: 14px !important;
    animation: flipHintSpin 3s ease-in-out 2;
}

@keyframes flipHintSpin {
    0%, 80%, 100% { transform: rotate(0deg); }
    90% { transform: rotate(360deg); }
}

/* ---- Back Face ---- */
.flip-card-back {
    transform: rotateY(180deg);
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-top: 3px solid var(--card-accent, #0077b6);
    text-align: center;
}

.flip-card-back-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--card-accent, #0077b6);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    box-shadow: 0 4px 14px var(--card-glow, rgba(0, 119, 182, 0.2));
}

.flip-card-back-icon i,
.flip-card-back-icon svg {
    width: 20px;
    height: 20px;
    color: #fff;
}

.flip-card-back h4 {
    font-size: 0.92rem;
    font-weight: 700;
    color: #0a2540;
    margin-bottom: 10px;
    line-height: 1.35;
}

.flip-card-back p {
    font-size: 0.83rem;
    color: #5a7d95;
    line-height: 1.65;
    margin: 0;
}

.flip-card-back p strong {
    color: var(--card-accent, #0077b6);
    font-weight: 700;
}

.flip-card-hint-back {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #8ba3b5;
    margin-top: auto;
    padding-top: 10px;
}

.flip-card-hint-back i,
.flip-card-hint-back svg {
    width: 13px;
    height: 13px;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .advisor-advantage {
        padding: 50px 0 40px;
    }

    .flip-cards-grid {
        flex-direction: column;
        align-items: center;
    }

    .flip-card {
        width: 100%;
        max-width: 400px;
        height: 300px;
    }

    .flip-card-question {
        font-size: 0.95rem;
    }

    /* Disable hover tease on touch */
    .flip-card:not(.flipped):hover .flip-card-inner {
        transform: none;
    }

    .flip-card:not(.flipped):hover {
        filter: none;
        transform: none;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .flip-card {
        width: calc(50% - 11px);
        height: 330px;
    }
}

@media (min-width: 1025px) {
    .flip-card {
        width: 320px;
        height: 340px;
    }
}

/* =========================================
   MONTE CARLO PANEL
   ========================================= */

.mc-panel {
    background: linear-gradient(135deg, rgba(10, 37, 64, 0.03), rgba(0, 119, 182, 0.04));
    border: 1px solid rgba(0, 119, 182, 0.1);
    border-radius: 14px;
    padding: 14px 18px;
    overflow: visible;
    position: relative;
    animation: mcSlideIn 0.4s ease;
}

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

/* Header */
.mc-panel-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #0a2540;
}

.mc-panel-header small {
    color: #8ba3b5;
    font-weight: 500;
    font-size: 0.72rem;
    margin-left: auto;
}

.mc-panel-header i,
.mc-panel-header svg {
    width: 16px;
    height: 16px;
    color: #0077b6;
}

/* Explication MC */
.mc-explanation {
    font-size: 0.72rem;
    color: #5a7d95;
    line-height: 1.45;
    margin: 0 0 10px 0;
    padding: 0;
}

.mc-explanation strong {
    color: #0a2540;
    font-weight: 700;
}

/* Scénarios = 3 barres horizontales */
.mc-scenarios {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.mc-scenario {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mc-scenario-bar {
    flex: 1;
    height: 8px;
    background: rgba(0, 40, 80, 0.05);
    border-radius: 6px;
    overflow: hidden;
}

.mc-scenario-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    width: 0%;
}

/* Couleurs par scénario */
.mc-scenario--pessimist .mc-scenario-fill {
    background: linear-gradient(90deg, #f59e0b, #f97316);
}

.mc-scenario--median .mc-scenario-fill {
    background: linear-gradient(90deg, #0077b6, #00b4d8);
}

.mc-scenario--optimist .mc-scenario-fill {
    background: linear-gradient(90deg, #10b981, #34d399);
}

.mc-scenario-info {
    min-width: 105px;
    display: flex;
    flex-direction: column;
}

.mc-scenario-label {
    font-size: 0.65rem;
    color: #8ba3b5;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.mc-scenario-value {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.82rem;
    font-weight: 800;
    color: #0a2540;
}

/* Couleurs texte par scénario */
.mc-scenario--pessimist .mc-scenario-value { color: #f59e0b; }
.mc-scenario--median .mc-scenario-value    { color: #0077b6; }
.mc-scenario--optimist .mc-scenario-value  { color: #10b981; }

/* Jauge de risque */
.mc-risk-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid rgba(0, 119, 182, 0.06);
}

.mc-risk-gauge {
    flex: 1;
    height: 6px;
    background: rgba(16, 185, 129, 0.15);
    border-radius: 4px;
    overflow: hidden;
}

.mc-risk-fill {
    height: 100%;
    border-radius: 4px;
    background: #10b981;
    transition: width 0.6s ease, background-color 0.4s ease;
    width: 0%;
}

.mc-risk-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: #5a7d95;
    white-space: nowrap;
    min-width: 110px;
}

/* Tooltip dans la zone risque : positionner à gauche pour ne pas déborder */
.mc-risk-row .tooltip-trigger {
    position: relative;
}

.mc-risk-row .tooltip-bubble {
    width: 260px;
    left: auto;
    right: -10px;
    transform: translateX(0) translateY(5px);
}

.mc-risk-row .tooltip-trigger:hover .tooltip-bubble {
    transform: translateX(0) translateY(0);
}

/* Responsive */
@media (max-width: 480px) {
    .mc-scenario-info { min-width: 90px; }
    .mc-scenario-value { font-size: 0.82rem; }

    .mc-risk-row .tooltip-bubble {
        width: 220px;
        right: -5px;
    }
}