﻿:root {
    --bna-blue: #005F86;
    --bna-blue-light: #057EA3;
    --bna-accent: #057EA3;
    --surface-card: #ffffff;
    --surface-bg: #f5f7fa;
    --text-main: #1a1f23;
    --text-muted: #64748b;
    --text-label: #475569;
    --border-subtle: rgba(0, 0, 0, .08);
    --radius-lg: 14px;
    --radius-md: 10px;
    --shadow-card: 0 0 0 1px rgba(0, 0, 0, .04), 0 2px 6px -1px rgba(0, 0, 0, .03), 0 12px 20px -4px rgba(0, 0, 0, .05);
    --shadow-card-hover: 0 0 0 1px rgba(0, 0, 0, .06), 0 4px 12px -2px rgba(0, 0, 0, .06), 0 16px 28px -6px rgba(0, 0, 0, .08);
    --shadow-active: 0 0 0 2px var(--bna-accent), 0 4px 12px -2px rgba(5, 126, 163, .15);
    --transition-smooth: all 0.2s ease;
    --bulma-link-h: 199;
    --bulma-link-s: 100%;
    --bulma-link-l: 26%;
    --bulma-family-primary: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    font-family: var(--bulma-family-primary);
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
    background: var(--surface-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

    body > .section {
        flex: 1;
    }


/* ── Nav ── */

.nav-bar {
    background: var(--bna-blue);
}

.nav-inner {
    display: flex;
    align-items: center;
    padding: 12px 0;
}

.nav-brand img {
    height: 3.2rem;
    max-height: none;
    filter: brightness(0) invert(1);
}


/* ── Card ── */
.custom-card {
    background: var(--surface-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    border: none;
}

/* ── Modality Cards ── */
.modality-card {
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition-smooth);
    position: relative;
    background: var(--surface-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 1.25rem;
    width: 100%;
    text-align: left;
}

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

    .modality-card.is-active {
        border-color: var(--bna-accent);
        background: linear-gradient(135deg, #f0f9ff 0%, #e8f6fe 100%);
        box-shadow: var(--shadow-active);
        transform: translateY(-2px);
    }

        .modality-card.is-active .plan-badge {
            background: var(--bna-accent);
            color: white;
        }

/* ── Badge ── */
.plan-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: #e8f0fe;
    color: var(--bna-blue);
    transition: var(--transition-smooth);
}

/* ── Typography ── */
.tabular {
    font-variant-numeric: tabular-nums;
}

.label-upper {
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    font-size: 0.68rem;
    color: var(--text-muted);
}

.amount-hero {
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1.1;
    color: white;
    font-variant-numeric: tabular-nums;
}

/* ── Stepper ── */
.stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 2rem;
}

.step-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.step-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    background: #e2e8f0;
    color: var(--text-muted);
    transition: var(--transition-smooth);
    flex-shrink: 0;
}

.step-item.is-active .step-dot {
    background: var(--bna-blue);
    color: white;
}

.step-item.is-done .step-dot {
    background: #10b981;
    color: white;
}

.step-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    transition: var(--transition-smooth);
}

.step-item.is-active .step-label,
.step-item.is-done .step-label {
    color: var(--text-main);
}

.step-line {
    width: 36px;
    height: 2px;
    background: #e2e8f0;
    margin: 0 8px;
    border-radius: 1px;
    transition: var(--transition-smooth);
}

    .step-line.is-filled {
        background: var(--bna-blue);
    }

@media (max-width: 480px) {
    .step-label {
        display: none;
    }

    .step-line {
        width: 24px;
        margin: 0 4px;
    }
}

/* ── Detail Row ── */
.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, .05);
}

    .detail-row:last-child {
        border-bottom: none;
    }

    .detail-row .detail-label {
        font-size: 0.85rem;
        color: var(--text-muted);
    }

    .detail-row .detail-value {
        font-weight: 600;
        font-variant-numeric: tabular-nums;
    }

/* ── Debt Item ── */
.debt-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    transition: var(--transition-smooth);
    cursor: pointer;
    margin-bottom: 6px;
}

.debt-item-group:nth-child(odd) .debt-item {
    background: #f8fafc;
}

    .debt-item .debt-concept {
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

    .debt-item .debt-concept-name {
        font-size: 0.9rem;
        font-weight: 600;
        color: var(--text-main);
    }

    .debt-item .debt-concept-detail {
        font-size: 0.75rem;
        color: var(--text-muted);
    }

.breakdown-toggle {
    border: none;
    background: transparent;
    padding: 0;
    margin-top: 1px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    line-height: 1;
    cursor: pointer;
    color: var(--bna-blue);
    font-weight: 600;
    text-decoration: none;
}

.debt-item .debt-concept .breakdown-toggle {
    color: var(--bna-blue);
}

.breakdown-toggle:hover {
    color: var(--bna-accent);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

.breakdown-panel {
    margin: 0 10px 12px;
    border: 1px solid rgba(5, 126, 163, 0.16);
    border-radius: 10px;
    overflow: hidden;
    background: linear-gradient(180deg, #fcfdff 0%, #f7fbff 100%);
    transform-origin: top;
}

.breakdown-enter {
    transition: opacity 180ms ease, transform 180ms ease;
}

.breakdown-enter-start {
    opacity: 0;
    transform: translateY(-3px);
}

.breakdown-enter-end {
    opacity: 1;
    transform: translateY(0);
}

.breakdown-leave {
    transition: opacity 120ms ease;
}

.breakdown-leave-start {
    opacity: 1;
    transform: translateY(0);
}

.breakdown-leave-end {
    opacity: 0;
    transform: translateY(0);
}

.breakdown-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 8px 12px;
    font-size: 0.76rem;
    color: var(--text-label);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.operation-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    background: #e6f4fa;
    color: var(--bna-blue);
    border: 1px solid rgba(5, 126, 163, 0.25);
}

.breakdown-row:last-child {
    border-bottom: none;
}

.breakdown-row.is-total {
    background: rgba(5, 126, 163, 0.07);
}

    .debt-item .debt-amount {
        font-size: 1rem;
        font-weight: 700;
        font-variant-numeric: tabular-nums;
        flex-shrink: 0;
    }

.debt-item-selected {
    background: #f0f9ff !important;
    border: 1px solid rgba(5, 126, 163, .2);
}

/* ── Highlight Box ── */
.highlight-box {
    background: linear-gradient(135deg, var(--bna-blue) 0%, var(--bna-blue-light) 100%);
    border-radius: var(--radius-md);
    padding: 1.25rem 1.5rem;
    color: white;
}

    .highlight-box .hl-label {
        font-size: 0.7rem;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        font-weight: 600;
        opacity: 0.8;
    }

    .highlight-box .hl-value {
        font-size: 1.6rem;
        font-weight: 700;
        font-variant-numeric: tabular-nums;
    }

    /* Dos importes lado a lado en desktop; apilados en mobile para evitar desborde */
    .highlight-box .hl-dual-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }

@media (max-width: 600px) {
    .highlight-box .hl-dual-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }
}

/* ── Info Box ── */
.info-box {
    background: #eff6ff;
    border-left: 3px solid var(--bna-accent);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    padding: 12px 16px;
    font-size: 0.82rem;
    color: var(--text-label);
    line-height: 1.5;
}

/* ── Legal Note ── */
.legal-note {
    padding-top: 2px;
    padding-inline: 4px;
}

    .legal-note p {
        font-size: 0.7rem;
        line-height: 1.5;
        color: #94a3b8;
    }

        .legal-note p + p {
            margin-top: 8px;
        }

/* ── Total Row ── */
.total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: #f1f5f9;
    border-radius: var(--radius-md);
    margin-top: 8px;
}

    .total-row .total-label {
        font-size: 0.9rem;
        font-weight: 600;
        color: var(--text-label);
    }

    .total-row .total-value {
        font-size: 1.25rem;
        font-weight: 700;
        font-variant-numeric: tabular-nums;
    }

/* ── Terms ── */
.terms-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(0, 0, 0, .08);
    cursor: pointer;
    transition: var(--transition-smooth);
}

    .terms-label:hover {
        border-color: var(--bna-accent);
        background: #fafcff;
    }

    .terms-label input[type="checkbox"] {
        margin-top: 2px;
        accent-color: var(--bna-accent);
        width: 16px;
        height: 16px;
        flex-shrink: 0;
    }

/* ── Buttons ── */
.btn-primary {
    background: linear-gradient(135deg, var(--bna-blue) 0%, var(--bna-blue-light) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1rem;
    padding: 14px 24px;
    height: auto;
    transition: var(--transition-smooth);
    box-shadow: 0 2px 8px -2px rgba(0, 56, 112, .3);
    cursor: pointer;
    width: 100%;
    display: block;
    text-align: center;
}

    .btn-primary:hover:not(:disabled) {
        background: linear-gradient(135deg, var(--bna-blue-light) 0%, var(--bna-blue) 100%);
        transform: translateY(-1px);
        box-shadow: 0 4px 14px -3px rgba(0, 56, 112, .4);
        color: white;
    }

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

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 0;
    transition: var(--transition-smooth);
}

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

/* ── Select ── */
.custom-select {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: var(--radius-md);
    padding: 12px 16px;
    font-size: 0.9rem;
    font-weight: 500;
    background: white;
    color: var(--text-main);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    transition: var(--transition-smooth);
    cursor: pointer;
}

    .custom-select:focus {
        outline: none;
        border-color: var(--bna-accent);
        box-shadow: 0 0 0 3px rgba(5, 126, 163, .15);
    }

/* ── Installment Detail ── */
.installment-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.installment-stat {
    background: #f8fafc;
    border-radius: var(--radius-md);
    padding: 14px 16px;
}

    .installment-stat .stat-label {
        font-size: 0.68rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        font-weight: 600;
        color: var(--text-muted);
    }

    .installment-stat .stat-value {
        font-size: 1.15rem;
        font-weight: 700;
        font-variant-numeric: tabular-nums;
        color: var(--text-main);
        margin-top: 2px;
    }


.rates-detail-grid {
    grid-template-columns: 1fr 1fr;
}

.installment-stat.cft-stat {
    grid-column: span 2;
    background: linear-gradient(135deg, #eef8ff 0%, #e1f2fd 100%);
    border: 1px solid rgba(5, 126, 163, 0.2);
}

.installment-stat .stat-value.cft-value {
    font-size: 2.3rem;
    line-height: 1.05;
    color: var(--bna-blue);
}

@media (max-width: 480px) {
    .installment-stat .stat-value.cft-value {
        font-size: 2rem;
    }
}

/* ── Success Icon ── */
.success-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(16, 185, 129, .1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    font-size: 1.5rem;
    color: #10b981;
}

/* ── Section Divider ── */
.section-divider {
    height: 1px;
    background: rgba(0, 0, 0, .06);
    margin: 20px 0;
}

/* ── Schedule ── */
.schedule-year-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: #eef2f7;
    border-radius: 8px;
    cursor: pointer;
    user-select: none;
    transition: var(--transition-smooth);
    margin-bottom: 4px;
}

    .schedule-year-header:hover {
        background: #e2e8f0;
    }

    .schedule-year-header .year-label {
        font-size: 0.82rem;
        font-weight: 700;
        color: var(--text-main);
    }

    .schedule-year-header .year-subtotal {
        font-size: 0.78rem;
        font-weight: 600;
        color: var(--text-muted);
        font-variant-numeric: tabular-nums;
    }

    .schedule-year-header .chevron {
        transition: transform 0.2s ease;
        font-size: 0.7rem;
        color: var(--text-muted);
    }

        .schedule-year-header .chevron.is-open {
            transform: rotate(180deg);
        }

.schedule-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px 8px 28px;
    font-size: 0.82rem;
    border-bottom: 1px solid rgba(0, 0, 0, .04);
}

    .schedule-row:last-child {
        border-bottom: none;
    }

    .schedule-row .cuota-num {
        color: var(--text-muted);
        font-weight: 500;
        min-width: 70px;
    }

    .schedule-row .cuota-detail {
        color: var(--text-label);
        font-size: 0.75rem;
        flex: 1;
        text-align: center;
    }

    .schedule-row .cuota-amount {
        font-weight: 600;
        font-variant-numeric: tabular-nums;
        color: var(--text-main);
    }

    .schedule-row.is-last-cuota {
        background: #fef9e7;
    }

        .schedule-row.is-last-cuota .cuota-amount {
            font-weight: 700;
            color: var(--bna-blue);
        }

.schedule-container {
    max-height: 360px;
    overflow-y: auto;
    border: 1px solid rgba(0, 0, 0, .06);
    border-radius: var(--radius-md);
    padding: 8px;
}

/* ── Footer ── */
.app-footer {
    background: var(--bna-blue-light);
    padding: 24px 0;
    margin-top: 4rem;
}

/* ── Fade In ── */
.fade-in {
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

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

[x-cloak] {
    display: none !important;
}


/* Nuevo Carousel para celulares */
/* Nuevo Carousel para celulares */
/* Nuevo Carousel para celulares */
/* Nuevo Carousel para celulares */

/* Contenedor del Carrusel */
.carousel-container {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 1rem;
    padding-bottom: 1rem;
    scrollbar-width: thin; /* Firefox */
}

    /* Ocultar scrollbar en Chrome/Safari si se prefiere */
    .carousel-container::-webkit-scrollbar {
        height: 6px;
    }

    .carousel-container::-webkit-scrollbar-thumb {
        background: #ccc;
        border-radius: 10px;
    }

/* Ítem del Carrusel */
.carousel-item {
    flex: 0 0 90%; /* Ocupa el 90% del ancho para dejar ver el siguiente */
    scroll-snap-align: center;
}

    /* Ajuste para las tablas internas */
    .carousel-item table {
        background: transparent;
        font-size: 0.85rem;
    }

    .carousel-item .custom-card {
        height: 100%;
        border: 1px solid #eee;
        box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    }

.status-wrapper, .error-wrapper {
    max-width: 640px;
    min-height: 70vh;
    display: flex;
    align-items: center;
}

.status-card, .error-card {
    width: 100%;
    padding: 1.5rem;
    background: transparent;
    border: none;
    box-shadow: none;
}

.status-detail, .error-detail {
    color: var(--text-muted);
    margin-top: 4px;
    font-size: 0.95rem;
    line-height: 1.45;
}

.status-icon, .error-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    font-size: 1.5rem;
    font-weight: 700;
}

.status-icon {
    background: rgba(39, 174, 96, 0.14); 
    color: #27ae60; 
}

.error-icon {
    background: rgba(5, 126, 163, 0.14); 
    color: var(--bna-accent);
}

.status-btn {
    text-decoration: none;
    width: auto;
    display: inline-block;
    padding-left: 28px;
    padding-right: 28px;
    background: linear-gradient(135deg, var(--bna-blue) 0%, var(--bna-blue-light) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1rem;
    padding: 14px 24px;
    height: auto;
    transition: var(--transition-smooth);
    box-shadow: 0 2px 8px -2px rgba(0, 56, 112, .3);
    cursor: pointer;
    text-align: center;
}

    .status-btn:hover:not(:disabled) {
        background: linear-gradient(135deg, var(--bna-blue-light) 0%, var(--bna-blue) 100%);
        transform: translateY(-1px);
        box-shadow: 0 4px 14px -3px rgba(0, 56, 112, .4);
        color: white;
    }

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