@font-face {
    font-family: 'Montaser Arabic Bold';
    src: url('assets/fonts_montaser-montserrat/Montaser-Arabic\ Bold.ttf') format('truetype');
    font-display: block;
}

@font-face {
    font-family: 'Montserrat Regular';
    src: url('assets/fonts_montaser-montserrat/Montserrat-Regular.ttf') format('truetype');
    font-display: block;
}

@font-face {
    font-family: 'Montserrat Light';
    src: url('assets/fonts_montaser-montserrat/Montserrat-Light.ttf') format('truetype');
    font-display: block;
}

@font-face {
    font-family: 'Montserrat Bold';
    src: url('assets/fonts_montaser-montserrat/Montserrat-Bold.ttf') format('truetype');
    font-display: block;
}

:root {
    --pearl-white: #DFDFDF;
    --soft-black: #1C1C1C;
    --absolute-black: #000000;
    --gold: #D4AF37;
    --inst-gray: #B4B4B4;
    --text-light: #FDFDFD;
    --divider: rgba(212, 175, 55, 0.3);
    --house-green: #4CAF50;
    --debt-red: #FF5252;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    border-radius: 0px !important;
}

body {
    background-color: var(--soft-black);
    color: var(--text-light);
    font-family: 'Montserrat Regular', sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* 1. RESTORE DUAL-LOGO HEADER */
.institutional-header {
    background-color: var(--pearl-white);
    padding: 1.5rem 4rem;
    border-bottom: 2px solid #B4B4B4;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 1000;
}

/* 2. PROPOSAL HERO (AIR & AUTHORITY) */
.proposal-hero {
    background-color: var(--soft-black);
    padding: 8rem 4rem 4rem 4rem; /* Aire superior generoso */
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    border-bottom: 1px solid var(--divider);
}

.hero-title {
    font-family: 'Montaser Arabic Bold', serif;
    font-size: 2.5rem;
    color: var(--pearl-white);
    letter-spacing: 0.4rem;
    text-transform: uppercase;
    line-height: 1.1;
}

.hero-client {
    font-family: 'Montserrat Regular', sans-serif;
    font-size: 0.9rem;
    color: var(--inst-gray);
    letter-spacing: 0.3rem;
    text-transform: uppercase;
}

.hero-divider {
    width: 60px;
    height: 1px;
    background: var(--gold);
    margin: 0 auto;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.logo-tlc {
    height: 60px;
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-family: 'Montaser Arabic Bold', serif;
    font-size: 1.8rem;
    color: var(--absolute-black);
    line-height: 0.9;
}

.brand-sub {
    font-family: 'Montserrat Regular', sans-serif;
    font-size: 0.75rem;
    color: #333;
    letter-spacing: 0.3rem;
    text-transform: uppercase;
}

.header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.4rem;
}

.logo-afa {
    height: 30px; /* Scaled down as requested */
}

.author-id {
    font-family: 'Montserrat Regular', sans-serif;
    font-size: 0.65rem;
    color: #444;
    letter-spacing: 0.1rem;
    text-transform: uppercase;
}

/* 2. RISK PROFILER (SINGLE ELEGANT LINE) */
.profiler-section {
    background: rgba(255, 255, 255, 0.03);
    padding: 6rem; /* Aumentado sustancialmente para dar aire */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4rem;
    border-bottom: 1px solid var(--divider);
    margin-bottom: 6rem;
}

.profiler-section h2 {
    font-family: 'Montaser Arabic Bold', serif;
    font-size: 1rem;
    color: var(--gold);
    margin-bottom: 0;
    white-space: nowrap;
    letter-spacing: 0.15rem; /* UBS letter spacing */
}

.question-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 3rem;
}

.question-text {
    font-family: 'Montserrat Regular', sans-serif;
    font-size: 0.9rem;
    margin-bottom: 0;
    color: var(--inst-gray);
    white-space: nowrap;
    letter-spacing: 0.05rem;
}

.options-grid {
    display: flex;
    flex-direction: row;
    gap: 1.5rem; /* More space between options */
}

.btn-option {
    padding: 0.8rem 2rem;
    font-size: 0.75rem;
    background: transparent;
    border: 1px solid var(--divider);
    color: var(--text-light);
    cursor: pointer;
    font-family: 'Montserrat Light', sans-serif;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    text-transform: uppercase;
    letter-spacing: 0.12rem;
    white-space: nowrap;
}

.btn-option:hover {
    border-color: var(--gold);
    color: var(--gold);
    background: rgba(212, 175, 55, 0.08);
}

/* 3. DATOS ESTRUCTURALES UNIFICADOS */
.ficha-tecnica-container {
    background: rgba(255, 255, 255, 0.02);
    padding: 6rem; /* Aumentado padding superior e interior */
    border-bottom: 1px solid var(--divider);
    margin-bottom: 4rem;
}

.structural-title {
    font-family: 'Montaser Arabic Bold', serif;
    font-size: 1rem;
    color: var(--gold);
    letter-spacing: 0.3rem;
    margin-bottom: 4rem;
    display: block;
}

.ficha-tecnica-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: auto auto;
    gap: 4rem;
}

.elegant-input-group {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    flex: 1;
}

.elegant-input-group label {
    font-family: 'Montserrat Regular', sans-serif;
    font-size: 0.65rem;
    color: var(--inst-gray);
    text-transform: uppercase;
    letter-spacing: 0.15rem;
}

.elegant-input-group input {
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--divider);
    color: var(--text-light);
    font-family: 'Montserrat Light', sans-serif;
    font-size: 1.4rem;
    width: 90%;
    transition: border-bottom 0.3s;
}

.elegant-input-group input:focus {
    outline: none;
    border-bottom: 1px solid var(--gold);
}

.dynamic-inputs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    padding: 0 6rem 6rem 6rem;
}

.withdrawal-card {
    background: rgba(212, 175, 55, 0.05);
    padding: 2rem;
    border: 1px solid var(--divider);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.withdrawal-card h5 {
    font-size: 0.7rem;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.2rem;
}

/* 4. DASHBOARD MODULES */
.module {
    padding: 4rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.module-header { margin-bottom: 3rem; }

.module-header h3 {
    font-family: 'Montaser Arabic Bold', serif;
    font-size: 1.2rem;
    color: var(--gold);
    letter-spacing: 0.15rem;
    text-transform: uppercase;
}

/* SENTENCIA BUTTON */
.btn-sentencia {
    background: var(--gold);
    color: var(--absolute-black);
    padding: 1.2rem 3rem;
    border: none;
    cursor: pointer;
    font-family: 'Montserrat Bold', sans-serif;
    letter-spacing: 0.15rem;
    text-transform: uppercase;
    margin-bottom: 3rem;
}

/* 5. DYNAMIC CONSULTATION (GRID) */
.consultation-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 4rem;
}

/* TABLE */
table { width: 100%; border-collapse: collapse; }
table th {
    text-align: left;
    padding: 1rem 0.5rem;
    font-family: 'Montserrat Regular', sans-serif;
    font-size: 0.65rem;
    color: var(--gold);
    border-bottom: 1px solid var(--gold);
}
table td {
    padding: 2rem 0.5rem;
    font-family: 'Montserrat Light', sans-serif;
    font-size: 1.1rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

/* INSTITUTIONAL THICK BARS */
.bar-chart-container {
    height: 400px;
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--divider);
}

.thick-bar-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    width: 80px;
    height: 100%; /* Critical: Allow relative heights for bars */
}

.thick-bar {
    width: 100%;
    transition: height 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Institutional Colors V5.2 FINAL */
.house-bar { 
    background-color: var(--gold); 
}
.debt-bar { 
    background-color: transparent; 
    border: 2px solid var(--gold); 
}
.wealth-bar { 
    background-color: var(--pearl-white); 
}

.bar-label {
    margin-top: 1.5rem;
    font-family: 'Montserrat Regular', sans-serif;
    font-size: 0.6rem;
    color: var(--inst-gray);
    text-transform: uppercase;
    letter-spacing: 0.1rem;
    white-space: nowrap;
}

/* 6. MODAL BOX FORTE V2 (REFINED BRANDING) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 4000;
}

.modal-content {
    background: var(--soft-black);
    border: 1px solid var(--gold);
    padding: 3rem; /* Slightly reduced for fit */
    max-width: 800px;
    width: 90%;
    max-height: 90vh; /* Critical: Prevent overflow */
    overflow-y: auto; /* Enable scroll */
    scrollbar-width: thin;
    scrollbar-color: var(--gold) var(--soft-black);
}

.modal-content::-webkit-scrollbar {
    width: 6px;
}
.modal-content::-webkit-scrollbar-thumb {
    background-color: var(--gold);
}

.modal-brand-header {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    margin-bottom: 3rem;
    justify-content: center;
}

.modal-logo-white {
    height: 50px;
    filter: brightness(0) invert(1); /* Absolute White */
}

.modal-brand-text {
    display: flex;
    flex-direction: column;
}

.modal-brand-name {
    font-family: 'Montaser Arabic Bold', serif;
    font-size: 1.8rem;
    color: #FFFFFF; /* Absolute White */
    line-height: 0.9;
}

.modal-brand-sub {
    font-family: 'Montserrat Regular', sans-serif;
    font-size: 0.75rem;
    color: var(--inst-gray); /* Institutional Gray */
    letter-spacing: 0.3rem;
    text-transform: uppercase;
}

.modal-content h2 {
    font-family: 'Montaser Arabic Bold', serif;
    font-size: 2.2rem;
    color: var(--pearl-white); /* Pearl White */
    margin-bottom: 3rem;
    text-align: center;
}

/* 7. SUMMARY POINTS (MODAL) */
.summary-point {
    margin-bottom: 2.5rem; /* Balanced Air for height */
    border-left: 1px solid var(--gold);
    padding-left: 2rem;
}

.summary-point h4 {
    font-family: 'Montserrat Regular', sans-serif;
    font-size: 0.75rem;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.25rem; /* UBS style */
    margin-bottom: 1rem;
}

.summary-point p {
    font-family: 'Montserrat Light', sans-serif;
    font-size: 1rem;
    line-height: 1.8;
    color: var(--pearl-white);
}

.close-modal {
    margin-top: 2rem;
    background: transparent;
    border: 1px solid var(--divider);
    color: var(--text-light);
    padding: 1.2rem 3rem;
    cursor: pointer;
    font-family: 'Montserrat Regular', sans-serif;
    letter-spacing: 0.2rem;
    transition: all 0.3s;
    width: 100%;
}

/* FOOTER PEARL WHITE */
.institutional-footer {
    background-color: var(--pearl-white);
    padding: 4rem;
    text-align: center;
    color: #444;
}

.footer-copy {
    font-family: 'Montserrat Bold', sans-serif;
    color: var(--absolute-black);
    margin-bottom: 1.5rem;
    text-transform: uppercase;
}

.footer-disclaimer {
    font-size: 0.75rem;
    max-width: 900px;
    margin: 0 auto;
    text-align: justify;
}

/* SLIDERS */
input[type=range] {
    -webkit-appearance: none;
    appearance: none; /* Propiedad estándar */
    width: 100%;
    background: transparent;
    margin: 2rem 0;
}
input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 1px;
    background: var(--gold);
}
input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 25px;
    width: 25px;
    background: var(--gold);
    margin-top: -12px;
    cursor: pointer;
}

.hidden { display: none; }
.gold-text { color: var(--gold); }
.red-text { color: var(--debt-red); }
strong { font-family: 'Montserrat Bold', sans-serif; }

/* 8. MOBILE OPTIMIZATION (SCALING) */
@media (max-width: 768px) {
    body {
        zoom: 0.7; /* Simplest scaling for deep interfaces */
        -webkit-transform: scale(0.7);
        -moz-transform: scale(0.7);
        transform: scale(0.7); /* Propiedad estándar */
        -webkit-transform-origin: 0 0;
        -moz-transform-origin: 0 0;
        transform-origin: 0 0; /* Propiedad estándar */
    }
    
    .institutional-header {
        padding: 1.5rem 2rem;
        flex-direction: column;
        gap: 2rem;
        text-align: center;
    }
    
    .header-right {
        align-items: center;
    }
    
    .profiler-section, .ficha-tecnica-line, .dynamic-inputs-grid, .module {
        padding: 3rem 1.5rem;
    }
    
    .consultation-grid {
        grid-template-columns: 1fr;
    }
}
