/* =====================================================
   ESTIMATION PAGE - Apple-Style Minimalist Design
   ===================================================== */

/* Variables */
:root {
    --bg: #000000;
    --bg-card: rgba(255, 255, 255, 0.03);
    --bg-card-hover: rgba(255, 255, 255, 0.06);
    --border: rgba(255, 255, 255, 0.08);
    --text: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.5);
    --text-dim: rgba(255, 255, 255, 0.3);
    --accent: #2563EB;
    --accent-glow: rgba(37, 99, 235, 0.3);
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --radius: 16px;
    --radius-sm: 8px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background: linear-gradient(90deg, #1A4D7A, #0F3354);
    z-index: 10001;
    transition: width 0.1s ease-out;
}

.progress-bar.gold {
    background: linear-gradient(90deg, #d4af37, #f3d47a);
}

/* Reset & Base */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
}

/* Navigation */
.est-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

.est-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text);
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
}

.logo-separator {
    color: var(--text-dim);
}

.logo-tagline {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 400;
}

.back-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    transition: var(--transition);
}

.back-link:hover {
    color: var(--text);
}

/* Main Container */
.est-main {
    min-height: 100vh;
    padding: 100px 24px 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    /* Changed from center to allow top alignment */
    overflow: visible;
    /* Ensure sticky works */
}

/* Tool Selector */
.tool-selector {
    text-align: center;
    animation: fadeUp 0.6s ease-out;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

.est-title {
    font-size: clamp(1.75rem, 5vw, 2.5rem);
    font-weight: 700;
    margin-bottom: 3rem;
    letter-spacing: -0.02em;
}

.est-subtitle {
    font-size: 1.125rem;
    color: var(--text-muted);
    margin: 0 auto 4.5rem auto;
    max-width: 650px;
    line-height: 1.6;
    text-align: center;
}

.tool-cards {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.tool-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.5rem 2rem;
    min-width: 260px;
    max-width: 300px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-align: center;
}

.tool-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent);
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.tool-emoji {
    font-size: 3rem;
}

.tool-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
}

.tool-desc {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Wizard Container */
.wizard {
    width: 100%;
    max-width: 560px;
    animation: fadeUp 0.5s ease-out;
    transition: max-width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.wizard.results-active {
    max-width: 1100px;
}

.wizard-step {
    display: none;
    animation: fadeUp 0.4s ease-out;
}

.wizard-step.active {
    display: block;
}

.step-label {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.step-title {
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 600;
    margin-bottom: 2.5rem;
    text-align: center;
    letter-spacing: -0.01em;
}

/* Choice Cards */
.choice-cards {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.choice-card {
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem 3rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    min-width: 140px;
}

.choice-card:hover,
.choice-card.selected {
    border-color: var(--accent);
    background: rgba(37, 99, 235, 0.1);
}

.choice-emoji {
    font-size: 2.5rem;
}

.choice-text {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text);
}

/* Slider */
.slider-container {
    text-align: center;
    margin-bottom: 2rem;
}

.premium-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: var(--border);
    border-radius: 4px;
    outline: none;
    margin: 2rem 0;
}

.premium-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 20px var(--accent-glow);
    transition: var(--transition);
}

.premium-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.slider-display {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.25rem;
}

.slider-value {
    font-size: 4rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, #fff 0%, rgba(255, 255, 255, 0.7) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.slider-unit {
    font-size: 1.5rem;
    color: var(--text-muted);
    font-weight: 400;
}

/* Select */
.select-container {
    margin-bottom: 2rem;
}

.premium-select {
    width: 100%;
    padding: 1rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 1rem;
    font-family: inherit;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23888' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    transition: var(--transition);
}

.premium-select:focus {
    outline: none;
    border-color: var(--accent);
}

.premium-select option {
    background: #1a1a1a;
    color: var(--text);
}

/* Input */
.input-container {
    position: relative;
    margin-bottom: 1.5rem;
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.premium-input {
    width: 100%;
    padding: 1rem 4rem 1rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 1.25rem;
    font-family: inherit;
    transition: var(--transition);
}

.premium-input:focus {
    outline: none;
    border-color: var(--accent);
}

.premium-input::placeholder {
    color: var(--text-dim);
}

.input-suffix {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Taux Info */
.taux-info {
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.taux-info strong {
    color: var(--accent);
}

/* Pill Choices */
.option-group {
    margin-bottom: 2rem;
}

.option-label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.pill-choices {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.pill-choice {
    padding: 0.625rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text-muted);
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
}

.pill-choice:hover,
.pill-choice.active {
    border-color: var(--accent);
    color: var(--text);
    background: rgba(37, 99, 235, 0.15);
}

/* Toggle Options */
.toggle-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toggle-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}

.toggle-option input {
    width: 20px;
    height: 20px;
    accent-color: var(--accent);
    cursor: pointer;
}

.toggle-text {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.toggle-option input:checked+.toggle-text {
    color: var(--text);
}

/* Criteria Sections - Step 4 Enhanced */
.step-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.criteria-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}

.criteria-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 1rem;
}

.criteria-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

@media (max-width: 768px) {
    .criteria-grid {
        grid-template-columns: 1fr;
    }
}

.criteria-item label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.criteria-select {
    width: 100%;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
}

.criteria-select:hover,
.criteria-select:focus {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.08);
    outline: none;
}

.criteria-select option {
    background: #1a1a1a;
    color: var(--text);
}

/* Criteria Toggles - Enhanced Grid */
.criteria-toggles {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

@media (max-width: 768px) {
    .criteria-toggles {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .criteria-toggles {
        grid-template-columns: 1fr;
    }
}

/* Wizard Navigation */
.wizard-nav {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 2.5rem;
}

.btn-back,
.btn-next {
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.btn-back {
    background: transparent;
    color: var(--text-muted);
}

.btn-back:hover {
    color: var(--text);
}

.btn-next {
    background: var(--bg-card);
    color: var(--text);
    border: 1px solid var(--border);
    margin-left: auto;
}

.btn-next:hover {
    background: var(--bg-card-hover);
    border-color: var(--text-muted);
}

.btn-next.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
}

.btn-next.btn-primary:hover {
    background: #1d4ed8;
}

/* Result Card */
.result-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    margin-bottom: 2rem;
}

.result-range {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.result-gauge {
    flex: 1;
    height: 4px;
    background: linear-gradient(90deg, var(--text-dim) 0%, var(--accent) 50%, var(--text-dim) 100%);
    border-radius: 4px;
    position: relative;
}

.gauge-marker {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    background: var(--accent);
    border: 3px solid var(--bg);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent-glow);
}

.result-main {
    text-align: center;
    margin-bottom: 2rem;
}

.result-label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.result-value {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.25rem;
}

.odometer {
    font-size: clamp(2.5rem, 8vw, 4rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #fff 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.currency {
    font-size: 2rem;
    color: var(--text-muted);
    font-weight: 300;
}

.result-details {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.detail-icon {
    font-size: 1rem;
}

.tension-forte {
    color: var(--danger);
}

.tension-moyenne {
    color: var(--warning);
}

.tension-faible {
    color: var(--success);
}

/* Result Breakdown */
.result-breakdown {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 1.5rem 0;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-sm);
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
}

.breakdown-label {
    color: var(--text-muted);
}

.breakdown-value {
    color: var(--text);
    font-weight: 500;
}

.breakdown-item.highlight {
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
    margin-top: 0.5rem;
}

.breakdown-item.highlight .breakdown-value {
    color: var(--accent);
    font-size: 1rem;
}

/* Assurance et mensualité totale */
.breakdown-item.assurance-info {
    opacity: 0.8;
    font-size: 0.85rem;
}

.breakdown-item.assurance-info .breakdown-label {
    color: var(--text-muted);
}

.breakdown-item.total-mensualite {
    padding-top: 0.5rem;
    border-top: 1px dashed var(--border);
    margin-top: 0.5rem;
}

.breakdown-item.total-mensualite .breakdown-value {
    color: var(--success);
    font-weight: 600;
    font-size: 1.05rem;
}

.info-small {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 400;
}

/* Endettement Gauge */
.endettement-gauge {
    margin-top: 1.5rem;
}

.endettement-bar {
    height: 8px;
    background: linear-gradient(90deg, var(--success) 0%, var(--success) 33%, var(--warning) 33%, var(--warning) 35%, var(--danger) 35%, var(--danger) 100%);
    border-radius: 4px;
    position: relative;
}

.endettement-fill {
    height: 100%;
    background: transparent;
    border-radius: 4px;
}

.endettement-marker {
    position: absolute;
    top: -30px;
    transform: translateX(-50%);
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
    z-index: 10;
    box-shadow: var(--shadow-sm);
    color: #fff;
}

.endettement-marker.target {
    top: auto;
    bottom: -35px;
    background: var(--accent);
    color: white;
    border: none;
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
    line-height: 1.1;
    border-radius: 4px;
}

.endettement-marker.target::before {
    content: "";
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 5px solid var(--accent);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.valid {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1.5px solid var(--success);
}

.status-badge.invalid {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1.5px solid var(--danger);
}

.status-badge .diff {
    font-size: 0.75rem;
    opacity: 0.8;
    font-weight: 500;
}

.endettement-legend {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--text-dim);
    margin-top: 0.5rem;
}

.legend-ok {
    color: var(--success);
}

.legend-limit {
    color: var(--warning);
}

.legend-over {
    color: var(--danger);
}

/* CTA Section */
.cta-section {
    text-align: center;
    margin-bottom: 1.5rem;
}

.cta-text {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.btn-cta {
    display: inline-block;
    padding: 1rem 2rem;
    background: var(--accent);
    color: var(--text);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-cta:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
}

.btn-restart {
    display: block;
    width: 100%;
    padding: 0.75rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-restart:hover {
    color: var(--text);
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1.5rem;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: #111;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.5rem;
    max-width: 400px;
    width: 100%;
    position: relative;
    animation: fadeUp 0.3s ease-out;
}

.modal-content.success {
    text-align: center;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text);
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.modal-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.modal-benefits {
    list-style: none;
    margin-bottom: 1.5rem;
    text-align: left;
}

.modal-benefits li {
    padding: 0.375rem 0;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.success-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
}

/* Lead Form */
.lead-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.lead-form input,
.lead-form select {
    padding: 0.875rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.9rem;
    transition: var(--transition);
}

.lead-form input:focus,
.lead-form select:focus {
    outline: none;
    border-color: var(--accent);
}

.lead-form input::placeholder {
    color: var(--text-dim);
}

.btn-submit {
    padding: 0.875rem;
    background: var(--accent);
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 0.5rem;
}

.btn-submit:hover {
    background: #1d4ed8;
}

.btn-whatsapp {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.75rem 1.5rem;
    background: #25D366;
    color: #fff;
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-weight: 500;
    transition: var(--transition);
}

.btn-whatsapp:hover {
    background: #1fb855;
}

/* Hide sections by default */
.wizard[style*="display: none"]+.wizard[style*="display: none"] {
    display: none;
}

/* Mobile Responsive */
@media (max-width: 640px) {
    .est-nav {
        padding: 1rem;
    }

    .logo-tagline {
        display: none;
    }

    .est-main {
        padding: 80px 16px 40px;
    }

    .tool-cards {
        flex-direction: column;
        align-items: stretch;
    }

    .tool-card {
        min-width: unset;
        max-width: unset;
    }

    .choice-cards {
        flex-direction: column;
    }

    .choice-card {
        padding: 1.5rem;
        flex-direction: row;
        justify-content: flex-start;
        gap: 1rem;
    }

    .choice-emoji {
        font-size: 2rem;
    }

    .slider-value {
        font-size: 3rem;
    }

    .wizard-nav {
        flex-direction: column-reverse;
    }

    .btn-back {
        text-align: center;
    }

    .btn-next {
        margin-left: 0;
    }

    .result-details {
        flex-direction: column;
        gap: 0.75rem;
    }

    .pill-choices {
        flex-direction: column;
    }

    .pill-choice {
        text-align: center;
    }
}

/* =====================================================
   NEW FEATURES STYLES
   ===================================================== */

/* Co-emprunteur Toggle */
.coemprunteur-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
}

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

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--border);
    border-radius: 28px;
    transition: var(--transition);
}

.toggle-slider:before {
    content: "";
    position: absolute;
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background: white;
    border-radius: 50%;
    transition: var(--transition);
}

.toggle-switch input:checked+.toggle-slider {
    background: var(--accent);
}

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

.toggle-label {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Dual Inputs */
.dual-inputs {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.person-2 {
    animation: fadeUp 0.3s ease-out;
}

/* City Search */
.city-search {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    transition: var(--transition);
}

.city-search:focus {
    outline: none;
    border-color: var(--accent);
}

.city-search::placeholder {
    color: var(--text-dim);
}

/* City Autocomplete Dropdown */
.city-suggestions {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    max-height: 280px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.city-suggestion {
    display: flex;
    flex-direction: column;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background 0.15s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.city-suggestion:hover {
    background: rgba(0, 212, 255, 0.08);
}

.city-suggestion:last-child {
    border-bottom: none;
}

.city-suggestion-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
}

.city-suggestion-detail {
    font-size: 0.78rem;
    color: var(--text-dim);
    margin-top: 2px;
}

.city-suggestion-empty {
    padding: 1rem;
    text-align: center;
    color: var(--text-dim);
    font-size: 0.85rem;
}

.city-selected-badge {
    display: none;
    margin-top: 0.5rem;
    padding: 0.6rem 1rem;
    background: rgba(0, 212, 255, 0.06);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.85rem;
}

.btn-next:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Taux Editable */
.taux-editable {
    margin-bottom: 2rem;
}

.taux-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.taux-input {
    max-width: 140px;
}

.taux-input .premium-input {
    padding-right: 2.5rem;
    font-size: 1rem;
}

.taux-hint {
    font-size: 0.8rem;
    color: var(--text-dim);
}

.taux-hint strong {
    color: var(--text-muted);
}

/* Recap Section */
.recap-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.recap-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.recap-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
}

.btn-edit {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.375rem 0.75rem;
    color: var(--text-muted);
    font-size: 0.75rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-edit:hover {
    border-color: var(--accent);
    color: var(--text);
}

.recap-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
}

.recap-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.recap-label {
    font-size: 0.7rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.recap-value {
    font-size: 0.875rem;
    color: var(--text);
    font-weight: 500;
}

/* Endettement Section */
.endettement-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.endettement-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.info-tooltip {
    cursor: help;
    position: relative;
}

.info-tooltip:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1a1a1a;
    border: 1px solid var(--border);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    max-width: 250px;
    white-space: normal;
    z-index: 10;
}

.endettement-explain {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-top: 1rem;
    line-height: 1.5;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-sm);
}

/* Conseils Section */
.conseils-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.conseils-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.conseils-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.conseil {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    line-height: 1.5;
}

.conseil-success {
    background: rgba(16, 185, 129, 0.1);
    border-left: 3px solid var(--success);
}

.conseil-info {
    background: rgba(37, 99, 235, 0.1);
    border-left: 3px solid var(--accent);
}

.conseil-warning {
    background: rgba(245, 158, 11, 0.1);
    border-left: 3px solid var(--warning);
}

.conseil-danger {
    background: rgba(239, 68, 68, 0.1);
    border-left: 3px solid var(--danger);
}

.conseil-icon {
    flex-shrink: 0;
}

.conseil-text {
    color: var(--text-muted);
}

/* Mobile adjustments for new features */
@media (max-width: 640px) {
    .coemprunteur-toggle {
        flex-direction: column;
        gap: 0.5rem;
    }

    .taux-row {
        flex-direction: column;
        align-items: stretch;
    }

    .taux-input {
        max-width: 100%;
    }

    .recap-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .info-tooltip:hover::after {
        left: 0;
        transform: none;
    }
}


/* ═══════════════════════════════════════════
   COMPREHENSIVE ADVICE SECTIONS (Capacité)
   ═══════════════════════════════════════════ */

.advice-sections {
    margin-top: 2.5rem;
}

.advice-mega-section {
    margin-bottom: 2.5rem;
    text-align: center;
}

.advice-mega-icon {
    font-size: 2.8rem;
    margin-bottom: 0.5rem;
    filter: drop-shadow(0 0 12px rgba(50, 170, 255, 0.4));
}

.advice-mega-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.4rem;
}

.advice-mega-subtitle {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.55);
    margin-bottom: 1.8rem;
}

.advice-quad-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.advice-dual-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.2rem;
}

@media (max-width: 640px) {
    .advice-quad-grid {
        grid-template-columns: 1fr;
    }

}

#cap-status-container {
    display: flex;
    justify-content: center;
    width: 100%;
}

.breakdown-item.gap-display {
    border-top: 1px dashed rgba(255, 255, 255, 0.15);
    margin-top: 0.8rem;
    padding-top: 0.8rem;
}

.breakdown-item.gap-display .breakdown-value {
    font-weight: 700;
    font-size: 1.1rem;
}

.advice-panel {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 1.5rem;
    text-align: left;
    transition: border-color 0.3s, transform 0.3s;
}

.advice-panel:hover {
    border-color: rgba(80, 180, 255, 0.25);
    transform: translateY(-2px);
}

.panel-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #e0f0ff;
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.panel-icon {
    font-size: 1.2rem;
}

.panel-badge {
    font-size: 0.7rem;
    font-weight: 600;
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: #fff;
    padding: 3px 10px;
    border-radius: 20px;
    margin-left: auto;
    letter-spacing: 0.3px;
}

.panel-group {
    margin-bottom: 1.2rem;
}

.panel-group:last-child {
    margin-bottom: 0;
}

.group-title {
    font-size: 0.92rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.group-icon {
    font-size: 1rem;
}

.panel-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.panel-list li {
    padding: 0.35rem 0 0.35rem 1.3rem;
    position: relative;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.65);
    line-height: 1.45;
}

.panel-list li::before {
    content: '•';
    position: absolute;
    left: 0.4rem;
    color: rgba(80, 180, 255, 0.6);
    font-size: 0.85rem;
}

/* Do/Avoid color coding */
.do-title {
    color: #2ecc71 !important;
}

.avoid-title {
    color: #e74c3c !important;
}

.do-group .panel-list li::before {
    color: #2ecc71;
}

.avoid-group .panel-list li::before {
    color: #e74c3c;
}

/* Panel-specific accents */
.docs-panel {
    border-left: 3px solid rgba(52, 152, 219, 0.5);
}

.scoring-panel {
    border-left: 3px solid rgba(46, 204, 113, 0.5);
}

.profile-panel {
    border-left: 3px solid rgba(155, 89, 182, 0.5);
}

.strategy-panel {
    border-left: 3px solid rgba(241, 196, 15, 0.5);
}

/* Animations on scroll */
.advice-mega-section {
    animation: adviceFadeInUp 0.6s ease both;
}

.profile-section {
    animation-delay: 0.2s;
}

@keyframes adviceFadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

/* Sticky Result Navigation */
.result-sticky-wrapper {
    position: sticky;
    top: 75px;
    z-index: 50;
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
    padding: 0.5rem 0;
}

.result-sticky-nav {
    display: inline-flex;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 100px;
    padding: 0.3rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.sticky-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.6rem 1.2rem;
    border-radius: 100px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sticky-btn:hover {
    color: var(--text);
}

.sticky-btn.active {
    background: var(--bg-card);
    color: var(--text);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Scroll Snap Offsets */
.result-card,
#advice-sections,
#simulation-results {
    scroll-margin-top: 140px;
    /* Offset for sticky header + subnav */
}

/* =====================================================
   MODERN PRINT BUTTON
   ===================================================== */
.btn-print {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    font-weight: 600;
    padding: 1rem 2rem;
    border-radius: 100px;
    /* Pill shape */
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.9rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.btn-print:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.5);
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.btn-print:active {
    transform: translateY(0);
}

/* =====================================================
   PRINT & BRANDING STYLES (A4 Optimized - Compact)
   ===================================================== */
@media print {

    /* RESET & LAYOUT */
    @page {
        size: A4;
        margin: 0.8cm;
        /* Minimal margins */
    }

    body {
        background: white !important;
        color: black !important;
        font-family: 'Inter', sans-serif;
        font-size: 9pt;
        /* Smaller base font */
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        width: 100%;
        margin: 0;
        padding: 0;
    }

    /* SCALE CONTENT */
    .est-main {
        transform: scale(1);
        /* No scale, just fit */
        width: 100% !important;
        max-width: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    /* HIDE UI ELEMENTS */
    .est-nav,
    .est-nav-placeholder,
    .btn-print,
    .info-icon,
    .input-suffix,
    .tax-mode-toggle button:not(.active),
    .est-subtitle,
    .screen-disclaimer {
        /* Hide screen disclaimer in print to avoid duplication */
        display: none !important;
    }

    /* SHOW PRINT ELEMENTS */
    .print-only-disclaimer {
        display: block !important;
    }

    /* HEADER & FOOTER */
    .print-header {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 1rem;
        /* Reduced */
        border-bottom: 2px solid #000;
        padding-bottom: 0.5rem;
    }

    .print-logo {
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

    .print-footer {
        display: block !important;
        margin-top: 1rem;
        border-top: 1px solid #ddd;
        padding-top: 1rem;
        text-align: center;
        font-size: 7pt;
        color: #666;
        break-inside: avoid;
    }

    /* LAYOUT: 2 COLUMNS (Inputs Left | Results Right) */
    .renta-container {
        display: block !important;
    }

    .renta-grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        /* Force 2 equal columns */
        gap: 1.5rem;
        /* Reduced gap */
        align-items: start;
    }

    .renta-inputs {
        /* COMPACT INPUTS GRID */
        display: block;
    }

    /* Make Input Rows Compact & Grid-like */
    .renta-inputs .input-row {
        display: flex;
        /* Or grid */
        gap: 0.5rem;
        margin-bottom: 0.2rem;
        /* Very tight */
        align-items: center;
    }

    .input-col {
        flex: 1;
    }

    .input-container {
        border: none !important;
        border-bottom: 1px dotted #ccc !important;
        padding: 0 !important;
        margin-bottom: 0.2rem !important;
    }

    .input-label {
        font-size: 7pt !important;
        font-weight: 600;
        color: #444 !important;
        margin-bottom: 0 !important;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .premium-input {
        background: none !important;
        border: none !important;
        color: black !important;
        font-weight: 700;
        font-size: 9pt !important;
        padding: 0 !important;
        text-align: right;
        height: auto;
    }

    /* RESULTS SECTION */
    .renta-results {
        width: auto !important;
        position: static !important;
        background: none !important;
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
    }

    /* Chart Scaling - Tighten */
    .donut-chart-container {
        transform: scale(0.65);
        margin: -1.5rem auto -0.5rem;
        /* Negative margins to suck up space */
    }

    .chart-legend {
        margin-top: -0.5rem;
        margin-bottom: 0.5rem;
    }

    /* KPI Cards Compact */
    .kpi-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.3rem;
        margin-bottom: 0.5rem;
    }

    .kpi-card {
        padding: 0.3rem;
        border: 1px solid #ddd;
        background: #f9f9f9 !important;
    }

    .kpi-label {
        font-size: 7pt;
        color: #666;
    }

    .kpi-value {
        font-size: 10pt;
        color: black !important;
    }

    .kpi-value.positive {
        color: #10B981 !important;
    }

    .kpi-value.negative {
        color: #EF4444 !important;
    }

    /* Tables */
    .cashflow-breakdown,
    .fiscal-details {
        font-size: 8pt;
        border: 1px solid #eee;
        padding: 0.3rem;
        margin-bottom: 0.5rem;
        background: none !important;
    }

    .breakdown-row {
        padding: 0.1rem 0;
        border-bottom: 1px dashed #eee;
    }

    h4 {
        color: black !important;
        font-size: 9pt;
        margin-bottom: 0.3rem;
        border-bottom: 1px solid #000;
        padding-bottom: 0.1rem;
    }

    /* Titles */
    h1 {
        font-size: 14pt !important;
        color: black !important;
        margin-bottom: 0.2rem !important;
    }

    h2 {
        font-size: 11pt !important;
        color: black !important;
        margin-top: 0.5rem !important;
        margin-bottom: 0.2rem !important;
        border-bottom: 1px solid #ccc;
    }

    h3 {
        font-size: 10pt !important;
        color: black !important;
        margin-top: 0.5rem !important;
        margin-bottom: 0.2rem !important;
    }

    /* Tax Mode Display */
    .tax-mode-toggle {
        border: none;
        background: none;
        margin-bottom: 0.5rem;
        padding: 0;
        height: auto;
        display: block;
    }

    .tax-mode-btn {
        display: none;
    }

    .tax-mode-btn.active {
        display: inline-block;
        background: none !important;
        color: black !important;
        border: 1px solid black;
        border-radius: 4px;
        padding: 0.1rem 0.4rem;
        font-size: 8pt;
        font-weight: bold;
    }

    .tax-mode-wrapper {
        display: inline-block;
    }

    /* Target Rent Indicator */
    #target-rent-display {
        color: #555 !important;
        font-weight: normal;
        font-size: 8pt;
    }
}

/* =====================================================
   SPACE BACKGROUND ANIMATION
   ===================================================== */
#space-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
    background: radial-gradient(circle at bottom, #050B14 0%, #000000 100%);
}

.star {
    position: absolute;
    background: white;
    border-radius: 50%;
    opacity: 0;
    animation: drift linear infinite;
}

@keyframes drift {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }

    10% {
        opacity: var(--star-opacity);
    }

    90% {
        opacity: var(--star-opacity);
    }

    100% {
        transform: translateY(-100px) translateX(20px);
        /* Subtle drift up and right */
        opacity: 0;
    }
}

/* =====================================================
   INTEREST ANALYSIS & PLACEMENT COMPARISON
   ===================================================== */

.interest-analysis-section {
    margin-top: 2.5rem;
    padding-top: 2.5rem;
    border-top: 1px solid var(--border);
}

.section-heading {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.01em;
}

.section-desc {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

/* Quick Duration Slider in Results */
.quick-duration-wrap {
    padding: 1rem 0 0.5rem;
    margin-bottom: 0.5rem;
}

.quick-duration-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.quick-duration-value {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text);
    background: rgba(37, 99, 235, 0.12);
    padding: 2px 10px;
    border-radius: 100px;
    border: 1px solid rgba(37, 99, 235, 0.25);
}

.quick-duration-slider-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.quick-tick {
    font-size: 0.7rem;
    color: var(--text-dim);
    font-weight: 500;
    min-width: 18px;
    text-align: center;
}

.quick-duration-slider {
    flex: 1;
}

.quick-duration-ticks {
    display: flex;
    justify-content: space-between;
    padding: 4px 28px 0;
    font-size: 0.6rem;
    color: var(--text-dim);
    opacity: 0.6;
}

/* Advice CTA Button */
.advice-cta-wrap {
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.advice-cta-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px 18px;
    background: rgba(37, 99, 235, 0.08);
    border: 1px solid rgba(37, 99, 235, 0.2);
    border-radius: var(--radius-sm);
    color: var(--text);
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
}

.advice-cta-btn:hover {
    background: rgba(37, 99, 235, 0.15);
    border-color: rgba(37, 99, 235, 0.4);
    transform: translateY(-1px);
}

.advice-cta-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
}

.advice-cta-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.advice-cta-text strong {
    font-size: 0.85rem;
    font-weight: 600;
}

.advice-cta-text small {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.advice-cta-arrow {
    font-size: 1.2rem;
    color: var(--accent);
    flex-shrink: 0;
    transition: var(--transition);
}

.advice-cta-btn:hover .advice-cta-arrow {
    transform: translateX(4px);
}

/* KPI Cards */
.ia-kpi-cards {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
    margin-bottom: 1.5rem;
}

.ia-kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem 1.25rem;
    transition: var(--transition);
}

.ia-kpi-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

.ia-kpi-card.accent {
    border-color: rgba(37, 99, 235, 0.3);
    background: rgba(37, 99, 235, 0.06);
}

.ia-kpi-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.375rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.ia-kpi-value {
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.ia-kpi-card.accent .ia-kpi-value {
    background: linear-gradient(135deg, #fff 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Control Row */
.ia-control-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.ia-control-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.ia-control-label span {
    font-weight: 600;
    color: var(--text);
}

/* Legend */
.ia-legend {
    display: flex;
    gap: 20px;
    margin-bottom: 10px;
    font-size: 0.75rem;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.ia-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    display: inline-block;
    margin-right: 5px;
    vertical-align: middle;
}

/* Chart */
.ia-chart-wrap {
    position: relative;
    width: 100%;
    height: 300px;
    margin-bottom: 1rem;
}

/* Insight */
.ia-insight {
    padding: 14px 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.825rem;
    color: var(--text-muted);
    line-height: 1.7;
    background: var(--bg-card);
    margin-bottom: 1rem;
}

.ia-insight strong {
    color: var(--text);
}

/* Placement Section */
.ia-placement-section {
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

/* Placement Cards */
.ia-placement-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 1rem;
}

.ia-placement-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem;
    text-align: center;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.ia-placement-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.ia-placement-card .duration-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.5rem;
}

.ia-placement-card .capital-final {
    font-size: 1.15rem;
    font-weight: 700;
    color: #10B981;
    margin-bottom: 0.375rem;
}

.ia-placement-card .invested {
    font-size: 0.7rem;
    color: var(--text-dim);
    margin-bottom: 0.25rem;
}

.ia-placement-card .gains {
    font-size: 0.7rem;
    color: #10B981;
    font-weight: 500;
}

.ia-placement-card .vs-badge {
    display: block;
    margin-top: 0.6rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
    font-size: 0.7rem;
    font-weight: 600;
}

.ia-placement-card .vs-badge.positive {
    color: #10B981;
}

.ia-placement-card .vs-badge.negative {
    color: #EF4444;
}

/* Responsive */
@media (max-width: 768px) {
    .ia-kpi-cards {
        grid-template-columns: 1fr;
    }

    .ia-placement-cards {
        grid-template-columns: 1fr 1fr;
    }

    .ia-chart-wrap {
        height: 250px;
    }
}

@media (max-width: 480px) {
    .ia-placement-cards {
        grid-template-columns: 1fr;
    }

    .ia-legend {
        flex-direction: column;
        gap: 6px;
    }
}

/* 2-column controls */
.ia-control-row-2col {
    grid-template-columns: 1fr 1fr;
}

@media (max-width: 640px) {
    .ia-control-row-2col {
        grid-template-columns: 1fr;
    }
}

/* Asset Reference Box */
.ia-asset-ref {
    padding: 16px 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    margin-bottom: 1rem;
}

.ia-asset-ref-title {
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ia-asset-ref-items {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.ia-asset-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 100px;
    font-size: 0.72rem;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text);
    transition: var(--transition);
}

.ia-asset-tag .tag-perf {
    font-size: 0.65rem;
    font-weight: 600;
    color: #10B981;
    opacity: 0.85;
}

.ia-asset-ref-disclaimer {
    font-size: 0.65rem;
    color: var(--text-dim);
    line-height: 1.5;
    font-style: italic;
}

/* =====================================================
   FLOATING SOCIAL BUTTONS
   ===================================================== */
.floating-socials {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 999999;
}

.instagram-float {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #833AB4, #E1306C, #F77737);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 20px rgba(225, 48, 108, 0.4);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: bubbleFloat 3s ease-in-out infinite, instaPulse 2s ease-in-out infinite;
    animation-delay: 0.5s;
}

.instagram-float:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(225, 48, 108, 0.6);
    animation-play-state: paused;
}

@keyframes instaPulse {
    0%, 100% { box-shadow: 0 4px 20px rgba(225, 48, 108, 0.4); }
    50% { box-shadow: 0 6px 30px rgba(225, 48, 108, 0.6); }
}

.whatsapp-float {
    width: 56px;
    height: 56px;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: bubbleFloat 3s ease-in-out infinite, bubblePulse 2s ease-in-out infinite;
}

.whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(37, 211, 102, 0.6);
    animation-play-state: paused;
}

@keyframes bubbleFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes bubblePulse {
    0%, 100% { box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4); }
    50% { box-shadow: 0 6px 30px rgba(37, 211, 102, 0.6); }
}