/* ===================================================================
   LABORATORIO DE INTELIGENCIA PÚBLICA — V3 Design System
   Inspiración: Stripe, Linear, Gov.uk, Notion, Apple, Vercel
   =================================================================== */

:root {
    --navy:          #0C1B33;
    --navy-light:    #16324F;
    --navy-mid:      #1E3A5F;
    --gold:          #D4A843;
    --gold-light:    #E8C96A;
    --gold-dark:     #B8922E;
    --red:           #C41E3A;
    --red-light:     #E8375A;
    --blue:          #2F5FA8;
    --blue-light:    #E6F1FB;
    --blue-dark:     #1E4A7A;
    --color-2:       #2F5FA8;
    --color-3:       #D4A843;

    --surface:       #FFFFFF;
    --surface-2:     #F4F6F8;
    --surface-3:     #E5EBF1;
    --surface-4:     #D5DDE6;
    --bg-1:          #F4F6F8;

    --text-1:        #0C1B33;
    --text-2:        #5C7188;
    --text-3:        #8CA0B3;
    --text-4:        #9DB8DC;
    --text-inverse:  #FFFFFF;

    --border:        #E5EBF1;
    --border-light:  #F0F3F6;
    --border-focus:  #2F5FA8;

    --success:       #10B981;
    --success-light: #D1FAE5;
    --warning:       #F59E0B;
    --warning-light: #FEF3C7;
    --danger:        #EF4444;
    --danger-light:  #FEE2E2;
    --info:          #3B82F6;
    --info-light:    #DBEAFE;

    --shadow-xs:     0 1px 2px rgba(12, 27, 51, 0.04);
    --shadow-sm:     0 1px 3px rgba(12, 27, 51, 0.06);
    --shadow-md:     0 4px 16px rgba(12, 27, 51, 0.08);
    --shadow-lg:     0 12px 40px rgba(12, 27, 51, 0.12);
    --shadow-xl:     0 20px 60px rgba(12, 27, 51, 0.16);
    --shadow-glow:   0 0 40px rgba(47, 95, 168, 0.15);

    --radius-xs:     4px;
    --radius-sm:     8px;
    --radius-md:     12px;
    --radius-lg:     16px;
    --radius-xl:     20px;
    --radius-2xl:    28px;
    --radius-pill:   999px;

    --ease:          cubic-bezier(0.4, 0, 0.2, 1);
    --ease-bounce:   cubic-bezier(0.34, 1.56, 0.64, 1);
    --duration:      0.2s;
    --duration-md:   0.3s;
    --duration-lg:   0.5s;

    --font-sans:     'Inter', system-ui, -apple-system, sans-serif;
    --font-mono:     'JetBrains Mono', 'Fira Code', monospace;

    --space-xs:      4px;
    --space-sm:      8px;
    --space-md:      16px;
    --space-lg:      24px;
    --space-xl:      32px;
    --space-2xl:     48px;
    --space-3xl:     64px;
    --space-4xl:     96px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-1);
    background-color: var(--surface);
    padding-top: 56px;
    overflow-x: hidden;
}

img { max-width: 100%; height: auto; }

a { color: var(--blue); text-decoration: none; transition: color var(--duration) var(--ease); }
a:hover { color: var(--blue-dark); }

::selection { background: var(--blue-light); color: var(--navy); }

/* ======================== TYPOGRAPHY ======================== */
.display-xl { font-size: clamp(2.5rem, 5vw, 4rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.display-lg { font-size: clamp(2rem, 4vw, 3rem); font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
.display-md { font-size: clamp(1.5rem, 3vw, 2.25rem); font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.display-sm { font-size: 1.75rem; font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; }
.display-xs { font-size: 0.9375rem; font-weight: 700; letter-spacing: -0.01em; }
.heading-lg { font-size: 1.25rem; font-weight: 600; letter-spacing: -0.01em; line-height: 1.3; }
.heading-md { font-size: 1.125rem; font-weight: 600; line-height: 1.4; }
.heading-sm { font-size: 0.875rem; font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase; }
.body-lg { font-size: 1.125rem; line-height: 1.7; }
.body-md { font-size: 1rem; line-height: 1.7; }
.body-sm { font-size: 0.875rem; line-height: 1.6; }
.caption { font-size: 0.75rem; line-height: 1.5; color: var(--text-3); }
.text-gradient { background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

/* ======================== FLAG ACCENT ======================== */
.flag-accent {
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--navy) 33%, var(--red) 33%, var(--red) 66%, var(--gold) 66%);
}

/* ======================== NAVBAR ======================== */
.navbar-premium {
    background: rgba(12, 27, 51, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding: 0.4rem 0;
    transition: all var(--duration-md) var(--ease);
    min-height: 52px;
}

.navbar-premium.scrolled {
    background: rgba(12, 27, 51, 0.95);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
}

.navbar-brand {
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: -0.3px;
    color: white !important;
    padding-top: 0;
    padding-bottom: 0;
}

.navbar-brand span { color: var(--gold); }

.nav-link {
    color: rgba(255, 255, 255, 0.75) !important;
    font-weight: 500;
    font-size: 0.9375rem;
    transition: color var(--duration) var(--ease);
    padding: 0.5rem 1rem !important;
}

.nav-link:hover, .nav-link.active { color: white !important; }

.btn-nav-cta {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
    color: var(--navy) !important;
    border: none;
    padding: 10px 24px;
    font-weight: 700;
    font-size: 0.9375rem;
    border-radius: var(--radius-lg);
    transition: all var(--duration) var(--ease);
    box-shadow: 0 2px 12px rgba(212, 168, 67, 0.3);
}

.btn-nav-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(212, 168, 67, 0.4);
}

/* ======================== BUTTONS ======================== */
.btn {
    font-weight: 600;
    border-radius: var(--radius-lg);
    padding: 12px 28px;
    font-size: 0.9375rem;
    transition: all var(--duration) var(--ease);
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
    color: white;
    box-shadow: 0 2px 12px rgba(47, 95, 168, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(47, 95, 168, 0.4);
    color: white;
}

.btn-secondary {
    background: var(--surface-2);
    color: var(--text-1);
    border: 1px solid var(--border);
}

.btn-secondary:hover { background: var(--surface-3); border-color: var(--surface-4); }

.btn-outline {
    background: transparent;
    color: var(--blue);
    border: 1.5px solid var(--blue);
}

.btn-outline:hover { background: var(--blue); color: white; }

.btn-gold {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
    color: var(--navy);
    box-shadow: 0 2px 12px rgba(212, 168, 67, 0.3);
}

.btn-gold:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(212, 168, 67, 0.4);
}

.btn-lg { padding: 16px 36px; font-size: 1.0625rem; border-radius: var(--radius-xl); }
.btn-sm { padding: 8px 16px; font-size: 0.8125rem; border-radius: var(--radius-md); }

/* ======================== CARDS ======================== */
.card-premium {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    transition: all var(--duration-md) var(--ease);
}

.card-premium:hover {
    border-color: var(--surface-4);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.card-elevated {
    background: var(--surface);
    border: none;
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    box-shadow: var(--shadow-md);
    transition: all var(--duration-md) var(--ease);
}

.card-elevated:hover { box-shadow: var(--shadow-lg); transform: translateY(-4px); }

.card-glass {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
}

/* ======================== FORM ELEMENTS ======================== */
.form-field { margin-bottom: var(--space-md); }

.form-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-2);
    margin-bottom: 6px;
    display: block;
}

.form-control, .form-select {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    font-family: var(--font-sans);
    color: var(--text-1);
    background: var(--surface);
    transition: all var(--duration) var(--ease);
}

.form-control:focus, .form-select:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(47, 95, 168, 0.12);
    outline: none;
}

.form-control::placeholder { color: var(--text-3); }

textarea.form-control { resize: vertical; min-height: 120px; }

/* ======================== BADGES ======================== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-primary { background: var(--blue-light); color: var(--blue); }
.badge-white { background: rgba(255, 255, 255, 0.15); color: white; }
.badge-green { background: var(--success-light); color: var(--success); }
.badge-red { background: var(--danger-light); color: var(--danger); }
.badge-success { background: var(--success-light); color: var(--success); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-danger { background: var(--danger-light); color: var(--danger); }

/* ======================== SECTIONS ======================== */
.section { padding: var(--space-4xl) 0; }
.section-alt { background: var(--surface-2); }
.section-dark { background: var(--navy); color: white; }

.section-header {
    text-align: center;
    max-width: 640px;
    margin: 0 auto var(--space-3xl);
}

.section-header .overline {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--blue);
    margin-bottom: var(--space-sm);
}

.section-header h2 { margin-bottom: var(--space-md); }
.section-header p { color: var(--text-2); font-size: 1.125rem; }

/* ======================== HERO ======================== */
.hero {
    position: relative;
    padding: var(--space-4xl) 0;
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 50%, var(--navy-mid) 100%);
    color: white;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(212, 168, 67, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(47, 95, 168, 0.2) 0%, transparent 70%);
    pointer-events: none;
}

.hero-content { position: relative; z-index: 1; }

/* ======================== STATS ======================== */
.stat-card { text-align: center; padding: var(--space-xl); }

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1;
    margin-bottom: var(--space-xs);
}

.stat-number .counter { font-size: inherit; font-weight: inherit; }

.stat-label {
    font-size: 0.875rem;
    color: var(--text-2);
    font-weight: 500;
}

/* ======================== STEP CARD (How it works) ======================== */
.step-card { text-align: center; padding: var(--space-xl); position: relative; }

.step-number {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--blue-light);
    color: var(--blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 auto var(--space-md);
}

.step-card h3 { font-size: 1.125rem; font-weight: 600; margin-bottom: var(--space-sm); }
.step-card p { color: var(--text-2); font-size: 0.9375rem; }

/* ======================== FAQ ======================== */
.faq-item {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-md);
    overflow: hidden;
    transition: all var(--duration-md) var(--ease);
}

.faq-item:hover { border-color: var(--surface-4); }

.faq-question {
    width: 100%;
    padding: 18px 24px;
    background: var(--surface);
    border: none;
    text-align: left;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-1);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background var(--duration) var(--ease);
}

.faq-question:hover { background: var(--surface-2); }
.faq-question i { transition: transform var(--duration-md) var(--ease); }
.faq-item.open .faq-question i { transform: rotate(180deg); }

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--duration-md) var(--ease);
}

.faq-answer-inner {
    padding: 0 24px 18px;
    color: var(--text-2);
    line-height: 1.7;
}

.faq-item.open .faq-answer { max-height: 500px; }

/* ======================== FOOTER ======================== */
.footer {
    background: var(--navy);
    color: white;
    padding: var(--space-4xl) 0 var(--space-xl);
}

.footer-brand {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: var(--space-md);
}

.footer-brand span { color: var(--gold); }

.footer-heading {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-4);
    margin-bottom: var(--space-md);
}

.footer-links { list-style: none; padding: 0; }
.footer-links li { margin-bottom: var(--space-sm); }

.footer-links a {
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.9375rem;
    transition: color var(--duration) var(--ease);
}

.footer-links a:hover { color: white; }

.footer-contact {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: var(--space-sm);
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.9375rem;
}

.footer-contact a { color: rgba(255, 255, 255, 0.65); }
.footer-contact a:hover { color: white; }

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--space-xl);
    margin-top: var(--space-xl);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* ======================== TOAST ======================== */
.toast-container {
    position: fixed;
    top: 88px;
    right: 20px;
    z-index: 9999;
}

.toast-premium {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    animation: slideInRight var(--duration-md) var(--ease);
}

.toast-premium.success { border-left: 4px solid var(--success); }
.toast-premium.error { border-left: 4px solid var(--danger); }
.toast-premium.info { border-left: 4px solid var(--info); }

.toast-premium i { font-size: 1.25rem; flex-shrink: 0; }

/* ======================== CONFETTI ======================== */
.confetti-container {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 10000;
    overflow: hidden;
}

.confetti {
    position: absolute;
    width: 10px; height: 10px;
    top: -10px;
    animation: confettiFall 3s ease-in-out forwards;
}

/* ======================== ANIMATIONS ======================== */
@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}

@keyframes confettiFall {
    0%   { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes messageIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes typingBounce { 0%,80%,100% { transform: scale(0); } 40% { transform: scale(1); } }

.animate-fade-in-up { animation: fadeInUp var(--duration-lg) var(--ease) forwards; }
.animate-fade-in { animation: fadeIn var(--duration-lg) var(--ease) forwards; }

.animate-on-scroll {
    opacity: 1;
    transform: translateY(0);
    transition: all var(--duration-lg) var(--ease);
}

.js-ready .animate-on-scroll { opacity: 0; transform: translateY(20px); }
.js-ready .animate-on-scroll.visible { opacity: 1; transform: translateY(0); }

/* ======================== UTILITIES ======================== */
.text-navy { color: var(--navy); }
.text-gold { color: var(--gold); }
.text-blue { color: var(--blue); }
.text-green { color: var(--success); }
.text-red { color: var(--danger); }
.text-muted-2 { color: var(--text-2); }
.text-muted-3 { color: var(--text-3); }
.text-white-50 { color: rgba(255, 255, 255, 0.5) !important; }
.text-white-75 { color: rgba(255, 255, 255, 0.75) !important; }
.text-white { color: white !important; }
.text-dark { color: var(--text-1) !important; }

.bg-navy { background: var(--navy); }
.bg-surface-2 { background: var(--surface-2); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-2xl { border-radius: var(--radius-2xl); }
.font-monospace { font-family: var(--font-mono) !important; }

/* ======================== PROGRESS ======================== */
.progress-premium {
    height: 6px;
    background: var(--surface-3);
    border-radius: var(--radius-pill);
    overflow: hidden;
}

.progress-premium .bar {
    height: 100%;
    background: var(--blue);
    border-radius: var(--radius-pill);
    transition: width var(--duration-md) var(--ease);
}

/* ======================== STEP INDICATOR (Form) ======================== */
.step-indicator {
    width: 40px; height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    border: 2px solid var(--border);
    color: var(--text-3);
    background: var(--surface);
    transition: all var(--duration-md) var(--ease);
    flex-shrink: 0;
}

.step-indicator.active {
    border-color: var(--blue);
    background: var(--blue);
    color: white;
}

.step-indicator.completed {
    border-color: var(--success);
    background: var(--success);
    color: white;
}

/* ======================== FORM CARD ======================== */
.form-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.form-card-header {
    background: var(--navy-light);
    padding: 20px 28px;
}

.form-card-body { padding: 32px 28px; min-height: 280px; }

.form-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 28px;
    border-top: 1px solid var(--border);
}

/* ======================== SECTOR CARDS ======================== */
.sector-card {
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
}

.sector-card:hover {
    border-color: var(--blue);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.sector-card.selected {
    border-color: var(--blue);
    background: linear-gradient(135deg, var(--blue-light) 0%, #eff6ff 100%);
    box-shadow: 0 4px 15px rgba(47, 95, 168, 0.2);
}

.sector-card.selected .check-icon { display: inline-block !important; }

.sector-icon {
    width: 44px; height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--blue-light) 0%, #e0e7ff 100%);
    color: var(--blue);
    font-size: 20px;
    flex-shrink: 0;
}

.sector-card.selected .sector-icon {
    background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
    color: white;
}

/* ======================== SELECTION CARD ======================== */
.selection-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    cursor: pointer;
    transition: all var(--duration) var(--ease);
    user-select: none;
}

.selection-card:hover { border-color: var(--blue); background: var(--blue-light); }

.selection-card.active {
    border-color: var(--blue);
    background: var(--blue-light);
    box-shadow: 0 0 0 3px rgba(47, 95, 168, 0.12);
}

.selection-card .icon {
    width: 36px; height: 36px;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    color: var(--blue);
    transition: all var(--duration) var(--ease);
    flex-shrink: 0;
}

.selection-card.active .icon { background: var(--blue); color: white; }

/* ======================== CHIPS ======================== */
.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-pill);
    border: 1.5px solid var(--border);
    background: var(--surface);
    color: var(--text-1);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--duration) var(--ease);
    user-select: none;
}

.chip:hover { border-color: var(--blue); background: var(--blue-light); }
.chip.active { border-color: var(--blue); background: var(--blue); color: white; }
.chip-sm { padding: 6px 12px; font-size: 0.8125rem; }

/* ======================== TIPO PROPUESTA ======================== */
.tipo-propuesta-card {
    cursor: pointer;
    border: 2px solid #e2e8f0;
    transition: all 0.3s ease;
    background: white;
}

.tipo-propuesta-card:hover { border-color: var(--gold); background: #fffbeb; }

.tipo-propuesta-card.selected {
    border-color: var(--blue);
    background: var(--blue-light);
    box-shadow: 0 0 0 3px rgba(47, 95, 168, 0.15);
}

/* ======================== PROBLEMAS GRID ======================== */
.problemas-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }

.problema-card {
    background: white;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.problema-card:hover {
    border-color: var(--blue);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.problema-card.selected {
    border-color: var(--blue);
    background: linear-gradient(135deg, var(--blue-light) 0%, #eff6ff 100%);
    box-shadow: 0 4px 15px rgba(47, 95, 168, 0.2);
}

.problema-icon {
    width: 48px; height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--danger-light) 0%, #fecaca 100%);
    color: var(--danger);
    font-size: 20px;
    margin: 0 auto 0.75rem;
}

.problema-card.selected .problema-icon {
    background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
    color: white;
}

.problema-name { font-size: 0.9rem; font-weight: 600; color: var(--text-1); }
.problema-custom { border-style: dashed; border-color: var(--text-3); }
.problema-custom:hover { border-color: var(--blue); border-style: solid; }

/* ======================== SECTOR PRIORIDAD ======================== */
.sector-prioridad-section {
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.3s ease;
    margin-bottom: 1rem;
}

.sector-prioridad-section.expanded { border-color: var(--blue); box-shadow: var(--shadow-md); }

.sector-prioridad-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    cursor: pointer;
    background: white;
    transition: background 0.3s ease;
}

.sector-prioridad-header:hover { background: var(--surface-elevated); }

.sector-prioridad-body {
    padding: 0 1.25rem 1.25rem;
    background: white;
    display: none;
}

.sector-prioridad-section.expanded .sector-prioridad-body { display: block; }
.sector-prioridad-section.expanded .toggle-icon { transform: rotate(180deg); }

.toggle-icon { transition: transform 0.3s ease; color: var(--text-3); }

.problemas-prioridad-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
}

.problema-prioridad-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.problema-prioridad-card:hover { border-color: var(--blue); background: var(--surface-2); }

.problema-prioridad-card.selected {
    border-color: var(--success);
    background: linear-gradient(135deg, var(--success-light) 0%, #ecfdf5 100%);
}

.problema-prioridad-card.selected .check-icon {
    display: inline-block !important;
    color: var(--success) !important;
}

.problema-prioridad-card.custom-problema {
    border-style: dashed;
    color: var(--text-2);
}

.problema-prioridad-card.custom-problema:hover {
    border-color: var(--blue);
    color: var(--blue);
    border-style: solid;
}

.custom-prioridad-input .form-control {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(47, 95, 168, 0.1);
}

/* ======================== CONVERSATION (SRIE Assistant) ======================== */
.conversation-section {
    padding: 40px 0 80px;
    min-height: calc(100vh - 80px);
    background: linear-gradient(180deg, var(--surface-2) 0%, #f1f5f9 100%);
}

.conversation-card {
    background: white;
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    height: calc(100vh - 160px);
    min-height: 600px;
    max-height: 800px;
}

.conversation-header {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
    color: white;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.conversation-avatar {
    width: 44px; height: 44px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--gold);
}

.conversation-badge {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    background: rgba(255, 255, 255, 0.15);
    padding: 4px 12px;
    border-radius: 50px;
    color: rgba(255, 255, 255, 0.8);
}

.conversation-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    scroll-behavior: smooth;
}

.conversation-body::-webkit-scrollbar { width: 6px; }
.conversation-body::-webkit-scrollbar-track { background: transparent; }
.conversation-body::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }

.message-bubble {
    display: flex;
    gap: 12px;
    max-width: 85%;
    animation: messageIn 0.3s ease-out;
}

.assistant-bubble { align-self: flex-start; }
.user-bubble { align-self: flex-end; flex-direction: row-reverse; }

.message-avatar {
    width: 36px; height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--blue-light) 0%, #e0e7ff 100%);
    color: var(--blue);
}

.user-avatar {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
    color: white;
}

.message-content {
    background: #f8fafc;
    border-radius: 16px;
    padding: 12px 16px;
    font-size: 0.95rem;
    line-height: 1.6;
    border: 1px solid var(--border);
}

.user-content {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
    color: white;
    border-color: transparent;
}

.message-content p { margin-bottom: 0.5rem; }
.message-content p:last-child { margin-bottom: 0; }
.message-actions { display: flex; gap: 8px; }

.conversation-footer {
    border-top: 1px solid var(--border);
    padding: 1rem 1.5rem;
    background: white;
    flex-shrink: 0;
}

.input-container { width: 100%; }

#inputOptions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.option-btn {
    border-radius: 12px !important;
    padding: 8px 18px !important;
    font-size: 0.9rem !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
    border-width: 2px !important;
}

.option-btn.selected {
    background: var(--blue) !important;
    color: white !important;
    border-color: var(--blue) !important;
    box-shadow: 0 4px 15px rgba(47, 95, 168, 0.3) !important;
}

#inputText .input-group {
    border-radius: 16px;
    overflow: hidden;
    border: 2px solid var(--border);
    transition: border-color 0.2s ease;
}

#inputText .input-group:focus-within {
    border-color: var(--blue);
    box-shadow: 0 0 0 4px rgba(47, 95, 168, 0.1);
}

#inputText .form-control {
    border: none;
    padding: 12px 16px;
    font-size: 0.95rem;
    resize: none;
    border-radius: 0;
}

#inputText .form-control:focus { box-shadow: none; }

#inputText .btn-primary {
    border-radius: 0;
    padding: 12px 20px;
    background: var(--blue);
    border: none;
}

.char-hint { color: var(--text-3); }

.loading-indicator { display: flex; align-items: center; padding: 8px 0; }

.typing-dots {
    display: flex;
    gap: 4px;
    align-items: center;
}

.typing-dots span {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--blue);
    animation: typingBounce 1.4s infinite ease-in-out both;
}

.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }
.typing-dots span:nth-child(3) { animation-delay: 0s; }

.conversation-summary {
    background: white;
    border-radius: 12px;
    border: 1px solid var(--border);
    padding: 12px 16px;
    margin-top: 12px;
}

.summary-item {
    display: flex;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.9rem;
}

.summary-item:last-child { border-bottom: none; }

.summary-label {
    font-weight: 600;
    color: var(--text-2);
    min-width: 100px;
    flex-shrink: 0;
}

.summary-value { color: var(--text-1); }

.sector-options-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
    justify-content: center;
}

.srie-result { padding: 8px 0; }

.srie-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    border: 1px solid var(--border);
    height: 100%;
}

.srie-card-icon {
    width: 56px; height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin: 0 auto;
}

.srie-explicacion { line-height: 1.8; }
.modal-content { border-radius: var(--radius-2xl); }

/* ======================== KNOWLEDGE SECTION ======================== */
.knowledge-section { min-height: calc(100vh - 80px); background: var(--surface-2); }

.knowledge-sidebar {
    background: white;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.knowledge-sidebar-header {
    padding: 1.25rem 1.5rem;
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-2);
    border-bottom: 1px solid var(--border);
}

.knowledge-nav { list-style: none; padding: 0.5rem; margin: 0; }
.knowledge-nav li { margin-bottom: 2px; }

.knowledge-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    color: var(--text-2);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.knowledge-nav-link i { font-size: 1.1rem; width: 24px; text-align: center; flex-shrink: 0; }
.knowledge-nav-link:hover { background: #f1f5f9; color: var(--text-1); }

.knowledge-nav-link.active {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
    color: white;
    font-weight: 600;
}

.knowledge-sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
}

.knowledge-module { display: none; }
.knowledge-module.active { display: block; animation: fadeInUp 0.4s ease-out; }

.knowledge-card {
    background: white;
    border-radius: var(--radius-2xl);
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    margin-bottom: 2rem;
}

.knowledge-card-header {
    padding: 2rem 2.5rem;
    border-bottom: 1px solid var(--border);
}

.knowledge-card-header h2 {
    font-size: 1.75rem;
    font-weight: 800;
    margin-top: 0.75rem;
    letter-spacing: -0.5px;
}

.knowledge-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 14px;
    background: linear-gradient(135deg, var(--blue-light) 0%, #e0e7ff 100%);
    color: var(--blue);
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.knowledge-card-body { padding: 2.5rem; }

.knowledge-divider {
    text-align: center;
    position: relative;
    margin: 2rem 0;
}

.knowledge-divider::before {
    content: '';
    position: absolute;
    top: 50%; left: 0; right: 0;
    height: 1px;
    background: var(--border);
}

.knowledge-divider span {
    position: relative;
    z-index: 1;
    background: white;
    padding: 0 1.5rem;
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--text-2);
}

.knowledge-divider span i { margin-right: 8px; }

.concept-highlights { display: flex; flex-direction: column; gap: 12px; }

.highlight-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.highlight-item i { margin-top: 3px; flex-shrink: 0; }
.concept-visual svg { max-width: 250px; height: auto; }

/* ======================== EXAMPLE CARDS ======================== */
.example-card {
    background: var(--surface-2);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    height: 100%;
}

.example-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }

.example-icon {
    width: 48px; height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 1rem;
}

.example-card h5 { font-size: 1.05rem; font-weight: 700; margin-bottom: 0.5rem; }
.example-card p { font-size: 0.9rem; color: var(--text-2); margin: 0; line-height: 1.6; }

/* ======================== PRACTICAL CASE ======================== */
.practical-case {
    background: var(--surface-2);
    border-radius: var(--radius-xl);
    padding: 2rem;
    border: 1px solid var(--border);
}

.case-step-circle {
    width: 56px; height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0 auto;
}

/* ======================== POLICY TIMELINE ======================== */
.policy-timeline { position: relative; padding-left: 4rem; }

.policy-timeline::before {
    content: '';
    position: absolute;
    left: 1.75rem;
    top: 0; bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--danger) 0%, var(--navy) 100%);
    border-radius: 3px;
}

.policy-timeline-item { position: relative; margin-bottom: 2rem; transition: all 0.3s ease; }

.policy-timeline-marker {
    position: absolute;
    left: -2.75rem;
    top: 0;
    width: 44px; height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    z-index: 2;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.policy-timeline-content {
    background: var(--surface-2);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.policy-timeline-content:hover { box-shadow: var(--shadow-md); transform: translateX(4px); }

.policy-step-badge {
    display: inline-block;
    padding: 2px 12px;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: white;
    flex-shrink: 0;
}

.policy-example {
    background: white;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    border-left: 3px solid var(--blue);
    font-size: 0.85rem;
    color: var(--text-3);
}

/* ======================== INSTRUMENTS ======================== */
.instrument-card {
    background: white;
    border-radius: 16px;
    border: 1px solid var(--border);
    overflow: hidden;
    transition: all 0.3s ease;
    height: 100%;
}

.instrument-card:hover { box-shadow: var(--shadow-md); }
.instrument-card.expanded { border-color: var(--border-focus); box-shadow: 0 4px 20px rgba(0,0,0,0.08); }

.instrument-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 1.25rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.instrument-header:hover { background: var(--surface-2); }

.instrument-icon {
    width: 48px; height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.instrument-info { flex: 1; min-width: 0; }
.instrument-info h6 { font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.instrument-sigla {
    display: inline-block;
    padding: 1px 10px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    margin-top: 4px;
}

.instrument-toggle {
    font-size: 1.2rem;
    color: var(--text-3);
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.instrument-body {
    padding: 0 1.25rem 1.25rem;
    border-top: 1px solid var(--border);
    padding-top: 1rem;
}

.instrument-body p { font-size: 0.9rem; line-height: 1.6; }

.instrument-detail { display: flex; flex-direction: column; gap: 10px; }

.detail-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.85rem;
    color: var(--text-2);
    line-height: 1.5;
}

.detail-item i { margin-top: 3px; flex-shrink: 0; font-size: 0.9rem; }

/* ======================== GLOSSARY ======================== */
.glossary-search { position: relative; }

.glossary-search i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-3);
    z-index: 5;
}

.glossary-search .form-control {
    padding-left: 44px;
    border-radius: 14px;
    height: 52px;
    font-size: 1rem;
    border: 2px solid var(--border);
    background: var(--surface-2);
}

.glossary-search .form-control:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 4px rgba(47, 95, 168, 0.1);
    background: white;
}

.glossary-tags { display: flex; flex-wrap: wrap; gap: 8px; }

.glossary-tag {
    padding: 6px 18px;
    border-radius: 50px;
    border: 1px solid var(--border);
    background: white;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-2);
    cursor: pointer;
    transition: all 0.2s ease;
}

.glossary-tag:hover { border-color: var(--blue); color: var(--blue); }
.glossary-tag.active { background: var(--blue); border-color: var(--blue); color: white; }

.glossary-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1rem; }

.glossary-card {
    background: var(--surface-2);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.glossary-card:hover { box-shadow: var(--shadow-md); border-color: var(--blue); }

.glossary-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.glossary-card-header h5 { font-size: 1rem; }

.glossary-sigla {
    padding: 2px 10px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    background: var(--blue-light);
    color: var(--blue);
}

.glossary-category {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 10px;
    border-radius: 50px;
}

.categoria-planeacion { background: var(--blue-light); color: var(--blue); }
.categoria-normas { background: var(--danger-light); color: #dc2626; }
.categoria-territorio { background: var(--success-light); color: #059669; }
.categoria-evaluacion { background: #ede9fe; color: #7c3aed; }

.glossary-enlaces { display: flex; flex-wrap: wrap; gap: 6px; }

.glossary-enlace {
    padding: 3px 12px;
    border-radius: 50px;
    border: 1px solid var(--border);
    font-size: 0.75rem;
    color: var(--blue);
    text-decoration: none;
    transition: all 0.2s ease;
}

.glossary-enlace:hover { background: var(--blue); color: white; border-color: var(--blue); }

/* ======================== INICIATIVA ======================== */
.instrument-icon-small {
    width: 32px; height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    flex-shrink: 0;
}

.phase-card {
    background: white;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: all 0.3s ease;
}

.phase-card:hover { box-shadow: var(--shadow-md); }

.phase-card-header {
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}

.phase-card-header h6 { font-size: 0.9rem; font-weight: 600; margin: 0; }

.phase-card-body {
    padding: 0 1.5rem 1.5rem;
    display: none;
}

.phase-card.expanded .phase-card-body { display: block; }
.phase-card.expanded .toggle-icon { transform: rotate(180deg); }

/* ======================== RESULTADOS ======================== */
.resultado-card {
    background: white;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    padding: 1.5rem;
    transition: all 0.3s ease;
    height: 100%;
}

.resultado-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.resultado-card .stat-value { font-size: 2rem; font-weight: 800; line-height: 1; }

/* ======================== LEGACY COMPATIBILITY ======================== */
.section-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--blue-light);
    color: var(--blue);
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.page-header {
    padding: 60px 0 40px;
    position: relative;
}

.page-header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -1px;
}

.page-header p {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 600px;
}

.btn-hero-primary {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
    color: var(--navy);
    border: none;
    padding: 18px 40px;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 35px rgba(212, 168, 67, 0.4);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-hero-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 45px rgba(212, 168, 67, 0.5);
    color: var(--navy);
}

.btn-hero-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.25);
    padding: 18px 40px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: var(--radius-lg);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-hero-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    color: white;
    transform: translateY(-2px);
}

.cronologia-timeline {
    position: relative;
    padding-left: 2rem;
}

.cronologia-timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.bg-gradient-navy {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
}

.glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ======================== RESPONSIVE ======================== */
@media (max-width: 991.98px) {
    .navbar-collapse {
        background: var(--navy);
        padding: var(--space-md);
        border-radius: var(--radius-md);
        margin-top: var(--space-sm);
    }

    .hero { padding: var(--space-3xl) 0; }
    .section { padding: var(--space-3xl) 0; }
    .footer-bottom { flex-direction: column; gap: var(--space-md); text-align: center; }
}

@media (max-width: 575.98px) {
    body { font-size: 14px; }
    .form-card-body { padding: 24px 20px; }
    .form-card-footer { padding: 14px 20px; }
}
