/* assets/styles/libre_deuda.css */
@import url('https://fonts.googleapis.com/css2?family=Sora:wght@600;700&family=Inter:wght@400;500;600&display=swap');

/* Reglas Globales de Tipografía (Sora para encabezados, Inter para cuerpo) */
h1, h2, h3, h4, h5, h6, .titulo-tramite {
    font-family: 'Sora', sans-serif;
}

h1 {
    font-weight: 700;
}

h2, h3, h4, h5, h6, .titulo-tramite {
    font-weight: 600;
}

body, p, input, button, select, textarea, label, nav, footer, .subtitulo, .texto-tarjeta {
    font-family: 'Inter', sans-serif;
}

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

html, body {
    max-width: 100%;
    overflow-x: hidden;
}

/* Page Layout */
.app-layout {
    width: 100%;
    max-width: 540px;
    padding: 20px;
    box-sizing: border-box;
}

/* Workflow Container */
.workflow-container {
    width: 100%;
}

.workflow-container.modal-open .workflow-card {
    transform: none !important;
    pointer-events: none !important;
}

/* Main Card */
.workflow-card {
    background: var(--color-surface, #ffffff);
    border-radius: 24px;
    box-shadow: 0 12px 35px -5px rgba(0, 45, 98, 0.08), 0 4px 15px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(21, 93, 252, 0.22);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: fadeIn 0.4s ease-out;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.workflow-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 25px 30px -5px rgba(0, 0, 0, 0.08), 0 12px 15px -5px rgba(0, 0, 0, 0.03);
}

/* Header */
.workflow-header {
    padding: 32px 32px 24px 32px;
    border-bottom: 1px solid var(--color-border);
    background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.logo-icon {
    font-size: 1.4rem;
}

.logo-text {
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--color-primary);
}

.workflow-title {
    margin: 0 0 8px 0;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--color-primary);
    letter-spacing: -0.02em;
}

.workflow-subtitle {
    margin: 0;
    font-size: 0.9rem;
    color: var(--color-text-muted);
    line-height: 1.4;
}

/* Content Area */
.workflow-content {
    padding: 32px;
}

/* Form Styles */
.workflow-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-field-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-main);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    color: var(--color-text-muted);
    font-size: 1.1rem;
    pointer-events: none;
}

.form-error-msg {
    color: var(--color-error);
    font-size: 0.82rem;
    margin-top: 4px;
    font-weight: 500;
}

.form-error-msg ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.form-help-text {
    font-size: 0.8rem;
    color: var(--color-text-muted, #64748b);
    line-height: 1.4;
    margin-top: 4px;
}

.form-input.is-invalid {
    border-color: var(--color-error) !important;
    background-color: var(--color-error-bg) !important;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.12) !important;
}

.form-general-error {
    background-color: var(--color-error-bg);
    border: 1px solid var(--color-error-border);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--color-error);
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 12px;
    animation: slideDown 0.3s ease-out;
}

.form-general-error .error-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: var(--color-error);
}

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

.btn {
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box;
    border-radius: var(--radius-md, 10px);
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: var(--font-sans, 'Inter', sans-serif);
    border: none;
    padding: 12px 24px;
    text-decoration: none;
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
    gap: 8px;
}

.btn-block {
    display: inline-flex !important;
    width: 100% !important;
}

.btn-primary {
    background-color: #003b94 !important;
    color: #ffffff !important;
    box-shadow: var(--shadow-sm);
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px;
    font-weight: 700;
}

.btn-primary:hover {
    background-color: #002d62 !important;
    box-shadow: 0 6px 18px rgba(0, 45, 98, 0.25);
}

.btn-primary:active {
    transform: translateY(1px);
}

.btn span,
.btn-primary span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn svg,
.btn-primary svg {
    display: inline-block !important;
    flex-shrink: 0 !important;
}

.btn-payment {
    background: linear-gradient(135deg, #009ee3 0%, #007eb5 100%);
    color: #ffffff;
    font-weight: 700;
}

.btn-payment:hover {
    background: linear-gradient(135deg, #00aae4 0%, #008cc0 100%);
    box-shadow: 0 4px 12px rgba(0, 158, 227, 0.25);
}

.btn-secondary {
    background-color: #f1f5f9;
    color: #1e293b;
    border: 1px solid #cbd5e1;
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
    background-color: #e2e8f0;
    color: #0f172a;
    border-color: #94a3b8;
}

.btn-secondary:active {
    transform: translateY(1px);
}

/* Status Views (Multi-step result screens) */
.status-view {
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: scaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.status-icon-wrapper {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    font-size: 1.8rem;
    box-shadow: var(--shadow-md);
}

.status-title {
    margin: 0 0 12px 0;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--color-primary);
}

.status-message {
    margin: 0 0 24px 0;
    font-size: 0.95rem;
    color: var(--color-text-muted);
    line-height: 1.5;
    max-width: 360px;
}

/* Success styling */
.status-success .status-icon-wrapper {
    background-color: var(--color-success-bg);
    color: var(--color-success);
    border: 2px solid var(--color-success-border);
}

/* Error styling */
.status-error .status-icon-wrapper {
    background-color: var(--color-error-bg);
    color: var(--color-error);
    border: 2px solid var(--color-error-border);
}

/* Completed styling */
.status-completed .status-icon-wrapper {
    background-color: #fef3c7;
    color: #d97706;
    border: 2px solid #fde68a;
}

.debt-table-wrapper {
    padding: 12px;
    max-height: 240px;
    overflow-y: auto;
    overflow-x: auto;
    width: 100%;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
}
.debt-box {
    width: 100%;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 28px;
    background-color: #fafbfc;
}

.debt-summary {
    padding: 16px 20px;
    background-color: #f8fafc;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.debt-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-muted);
}

.debt-amount {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--color-error);
}


.debt-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.debt-table th {
    text-align: left;
    padding: 8px 12px;
    font-weight: 600;
    color: var(--color-text-muted);
    border-bottom: 1px solid var(--color-border);
    white-space: normal;
    word-break: normal;
    overflow-wrap: break-word;
}

.debt-table td {
    padding: 10px 12px;
    color: var(--color-text-main);
    border-bottom: 1px solid #f3f4f6;
    white-space: normal;
    word-break: normal;
    overflow-wrap: break-word;
}

.debt-table tr:last-child td {
    border-bottom: none;
}

.text-right {
    text-align: right !important;
}

.font-mono {
    font-family: monospace;
    font-size: 0.9em;
}

.font-semibold {
    font-weight: 600;
}

/* Info Cards */
.info-card {
    background-color: var(--color-primary-light);
    border: 1px solid rgba(37, 99, 235, 0.15);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin-bottom: 28px;
    text-align: left;
}

.info-text {
    margin: 0;
    font-size: 0.88rem;
    color: #1e40af;
    line-height: 1.5;
}

/* Success Details */
.success-details-card {
    background-color: #f9fafb;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin-bottom: 28px;
    width: 100%;
    box-sizing: border-box;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: left;
}

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

.detail-value {
    font-size: 0.9rem;
    color: var(--color-text-main);
    font-weight: 500;
}

/* Actions Group */
.action-buttons-group {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-bounce {
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
        animation-timing-function: cubic-bezier(0.8,0,1,1);
    }
    50% {
        transform: translateY(-8px);
        animation-timing-function: cubic-bezier(0,0,0.2,1);
    }
}

/* Split Layout Container (Escritorio / Notebooks >= 845px) */
.workflow-main-container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 160px 24px 60px 24px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.workflow-grid-layout {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 40px;
    align-items: start;
    width: 100%;
    min-width: 0;
}

.workflow-column {
    width: 100%;
    display: flex;
    flex-direction: column;
    min-width: 0;
    position: relative;
}

.workflow-column:has(.modal-open) {
    z-index: 10000;
}

.workflow-column .app-layout {
    width: 100%;
    max-width: 100%;
    padding: 0;
}

/* Sidebar Styles */
.workflow-info-sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
    width: 100%;
}

.info-sidebar-card {
    background-color: #ffffff;
    border: 1px solid rgba(21, 93, 252, 0.2);
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 10px 28px -4px rgba(0, 45, 98, 0.06), 0 4px 12px rgba(0, 0, 0, 0.03);
    box-sizing: border-box;
    width: 100%;
}

.info-sidebar-card.highlight {
    background-color: rgba(244, 247, 255, 0.85);
    border: 1px solid rgba(0, 59, 148, 0.22);
    display: flex;
    gap: 20px;
    align-items: start;
}

.info-sidebar-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: #edf2fb;
    color: #002d62;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid rgba(0, 59, 148, 0.12);
}

.info-sidebar-icon svg {
    width: 22px;
    height: 22px;
}

.info-sidebar-content {
    display: flex;
    flex-direction: column;
}

.info-sidebar-content h4 {
    margin: 0 0 6px 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: #002d62;
    line-height: 1.3;
}

.info-sidebar-content p {
    margin: 0;
    font-size: 0.9rem;
    color: #334155;
    line-height: 1.5;
}

.info-sidebar-content .link-highlight {
    color: #003b94;
    font-weight: 700;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.info-sidebar-content .link-highlight:hover {
    color: #001f42;
}

.info-sidebar-card h4 {
    margin: 0 0 24px 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-spse-dark, #002d62);
    letter-spacing: -0.01em;
}

/* Step-by-Step list */
.step-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.step-list li {
    display: flex;
    gap: 16px;
    align-items: start;
}

.step-num {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: #edf2fb;
    color: #002d62;
    font-size: 0.9rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid rgba(0, 59, 148, 0.15);
}

.step-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.step-text strong {
    font-size: 0.95rem;
    color: var(--color-spse-dark, #002d62);
    font-weight: 700;
}

.step-text p {
    margin: 0;
    font-size: 0.88rem;
    color: var(--color-text-muted, #64748b);
    line-height: 1.5;
}

/* Full Width FAQ Section Styles */
.workflow-faq-section {
    width: 100%;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-lg, 16px);
    padding: 48px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    box-sizing: border-box;
}

.workflow-faq-section h3 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--color-spse-dark, #002d62);
    margin: 0 0 16px 0;
    text-align: left;
    letter-spacing: -0.02em;
}

.faq-divider {
    width: 60px;
    height: 3px;
    background-color: #003b94;
    border-radius: 2px;
    margin-bottom: 36px;
}

/* FAQ Accordion Styling */
.faq-accordion {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
}

.faq-accordion-item {
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-md, 10px);
    background-color: #ffffff;
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-accordion-item:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
}

.faq-accordion-item.active {
    border-color: rgba(0, 59, 148, 0.25);
    background-color: #fafbfc;
}

.faq-accordion-trigger {
    width: 100%;
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    outline: none;
}

.faq-accordion-trigger span {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--color-spse-dark, #002d62);
    line-height: 1.4;
    transition: color 0.2s ease;
}

.faq-accordion-item.active .faq-accordion-trigger span {
    color: #002d62;
}

.faq-accordion-trigger .faq-icon {
    width: 18px;
    height: 18px;
    color: #64748b;
    transition: transform 0.3s ease, color 0.3s ease;
    flex-shrink: 0;
}

.faq-accordion-item.active .faq-icon {
    transform: rotate(180deg);
    color: #003b94;
}

.faq-accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    opacity: 0;
}

.faq-accordion-item.active .faq-accordion-content {
    max-height: 250px; /* Expands smoothly to fit text */
    opacity: 1;
}

.faq-accordion-inner {
    padding: 0 24px 20px 24px;
}

.faq-accordion-inner p {
    margin: 0;
    font-size: 0.92rem;
    color: var(--color-text-muted, #64748b);
    line-height: 1.6;
}

.faq-accordion-inner p strong {
    color: #002d62;
}

/* Responsive Styles */
@media (max-width: 1024px) {
    .workflow-main-container {
        padding-top: 115px;
        padding-left: 20px;
        padding-right: 20px;
        gap: 28px;
    }
    .workflow-grid-layout {
        gap: 28px;
    }
    .workflow-faq-section {
        padding: 36px 28px;
        border-radius: 20px;
    }
}

@media (max-width: 768px) {
    .workflow-main-container {
        padding-top: 105px;
        padding-left: 16px;
        padding-right: 16px;
        gap: 24px;
    }
    .workflow-header {
        padding: 24px 24px 18px 24px;
    }
    .workflow-title {
        font-size: 1.45rem;
    }
    .workflow-content {
        padding: 24px;
    }
    .info-sidebar-card {
        padding: 24px;
        border-radius: 20px;
    }
    .info-sidebar-card.highlight {
        padding: 20px;
        gap: 16px;
    }
    .workflow-faq-section {
        padding: 28px 20px;
    }
    .faq-accordion-trigger {
        padding: 16px 18px;
    }
    .faq-accordion-trigger span {
        font-size: 0.95rem;
    }
    .faq-accordion-inner {
        padding: 0 18px 16px 18px;
    }
    .faq-accordion-inner p {
        font-size: 0.88rem;
    }
}

@media (max-width: 640px) {
    .workflow-main-container {
        padding-top: 90px;
        padding-left: 12px;
        padding-right: 12px;
        gap: 20px;
    }
    .workflow-card {
        border-radius: 18px;
    }
    .workflow-header {
        padding: 20px 16px 16px 16px;
    }
    .brand-logo {
        margin-bottom: 10px;
    }
    .workflow-title {
        font-size: 1.3rem;
        margin-bottom: 6px;
    }
    .workflow-subtitle {
        font-size: 0.85rem;
        line-height: 1.4;
    }
    .workflow-content {
        padding: 18px 16px;
    }
    .info-sidebar-card {
        padding: 18px 16px;
        border-radius: 18px;
    }
    .info-sidebar-card.highlight {
        padding: 16px 14px;
        gap: 12px;
        align-items: center;
    }
    .info-sidebar-icon {
        width: 38px;
        height: 38px;
    }
    .info-sidebar-icon svg {
        width: 19px;
        height: 19px;
    }
    .info-sidebar-content h4 {
        font-size: 0.95rem;
        margin-bottom: 4px;
    }
    .info-sidebar-content p {
        font-size: 0.85rem;
    }
    .workflow-faq-section {
        padding: 22px 16px;
        border-radius: 18px;
    }
    .workflow-faq-section h3 {
        font-size: 1.3rem;
        margin-bottom: 12px;
    }
    .faq-divider {
        margin-bottom: 24px;
    }
    .debt-table th, .debt-table td {
        padding: 8px 6px;
    }
    .debt-summary {
        padding: 12px 14px;
    }
}

@media (max-width: 500px) {
    .debt-table-wrapper {
        padding: 0;
        max-height: 280px;
    }
    .debt-table,
    .debt-table tbody {
        display: block;
        width: 100%;
    }
    .debt-table thead {
        display: none;
    }
    .debt-table tr {
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "title amount"
            "code  amount";
        padding: 10px 14px;
        border-bottom: 1px solid #e2e8f0;
        align-items: center;
        gap: 2px 12px;
        position: static;
    }
    .debt-table tr:last-child {
        border-bottom: none;
    }
    .debt-table td {
        display: block;
        padding: 0;
        border: none;
        box-sizing: border-box;
        position: static;
    }
    .debt-table td:nth-child(1) {
        grid-area: title;
        font-size: 0.85rem;
        font-weight: 600;
        color: var(--color-text-main);
        line-height: 1.35;
        word-break: break-word;
    }
    .debt-table td.font-mono,
    .debt-table td:nth-child(2) {
        grid-area: code;
        font-size: 0.78rem;
        color: var(--color-text-muted);
        margin-top: 1px;
    }
    .debt-table td.text-right,
    .debt-table td:nth-child(3) {
        grid-area: amount;
        text-align: right !important;
        position: static !important;
        transform: none !important;
        top: auto !important;
        right: auto !important;
        font-size: 0.88rem;
        font-weight: 700;
        color: var(--color-text-main);
        white-space: nowrap;
        align-self: center;
        width: auto !important;
    }
    .debt-summary {
        padding: 12px 14px;
        gap: 8px;
    }
    .debt-label {
        font-size: 0.82rem;
    }
    .debt-amount {
        font-size: 1.18rem;
    }
}

@media (max-width: 400px) {
    .debt-summary {
        padding: 10px 12px;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 3px;
    }
    .debt-label {
        font-size: 0.75rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: var(--color-text-muted);
    }
    .debt-amount {
        font-size: 1.12rem;
        font-weight: 800;
        color: var(--color-error);
        width: 100%;
        text-align: left;
        line-height: 1.2;
        word-break: break-word;
        overflow-wrap: anywhere;
    }

    .debt-table tr {
        padding: 8px 10px;
        gap: 2px 8px;
    }
    .debt-table td:nth-child(1) {
        font-size: 0.78rem;
        line-height: 1.3;
    }
    .debt-table td.font-mono,
    .debt-table td:nth-child(2) {
        font-size: 0.72rem;
    }
    .debt-table td.text-right,
    .debt-table td:nth-child(3) {
        font-size: 0.82rem;
        font-weight: 700;
    }
}



/* Bloqueo de Scroll de Fondo cuando hay un Modal Abierto */
html.modal-open,
body.modal-open,
html:has(.modal-overlay),
body:has(.modal-overlay) {
    overflow: hidden !important;
    overscroll-behavior: none !important;
    touch-action: none;
}

/* Modal Estilo Premium */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    padding: 20px;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    animation: modalFadeIn 0.3s ease-out;
}

.modal-content {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 480px;
    max-height: min(90vh, 650px);
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.8);
    overflow: hidden;
    overscroll-behavior: contain;
    animation: modalScaleUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-header-alert {
    padding: 28px 24px 18px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: linear-gradient(180deg, #fef3c7 0%, #ffffff 100%);
    border-bottom: 1px solid var(--color-border);
}

.modal-icon-alert {
    width: 56px;
    height: 56px;
    background: #fef3c7;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #d97706;
    margin-bottom: 14px;
    box-shadow: 0 4px 10px rgba(217, 119, 6, 0.15);
}

.modal-title-alert {
    font-size: 1.35rem;
    font-weight: 700;
    color: #92400e;
    margin: 0;
    letter-spacing: -0.01em;
}

.modal-body-alert {
    padding: 24px;
    color: var(--color-text-main);
    line-height: 1.6;
    font-size: 0.95rem;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 59, 148, 0.25) transparent;
}

.modal-body-alert::-webkit-scrollbar {
    width: 6px;
}

.modal-body-alert::-webkit-scrollbar-thumb {
    background-color: rgba(0, 59, 148, 0.25);
    border-radius: 9999px;
}

.modal-body-alert::-webkit-scrollbar-track {
    background: transparent;
}

.modal-body-alert p {
    margin: 0 0 16px 0;
}

.modal-details {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-md);
    padding: 14px 16px;
    font-size: 0.88rem;
    color: var(--color-text-muted);
}

.modal-details-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 6px 0;
    margin-bottom: 0;
    border-bottom: 1px dashed var(--color-border);
    gap: 12px;
}

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

.modal-details-success {
    background: #f0fdf4;
    border-color: #bbf7d0;
}
.modal-details-success .modal-details-item {
    border-bottom-color: #dcfce7;
}

.modal-details-label {
    font-weight: 500;
    flex-shrink: 0;
}
.modal-details-success .modal-details-label {
    color: #166534;
}

.modal-details-val {
    font-weight: 700;
    color: var(--color-text-main);
    word-break: normal;
    overflow-wrap: anywhere;
    text-align: right;
}
.modal-details-success .modal-details-val {
    color: #14532d;
}

.modal-details-success .modal-details-val.highlight {
    color: #047857;
    font-weight: 800;
}

@media (max-width: 576px) {
    .modal-details-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        padding: 8px 0;
    }
    .modal-details-val {
        text-align: left;
        width: 100%;
    }

    .modal-overlay {
        padding: 0;
    }

    .modal-content {
        max-width: 100%;
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        border: none;
        display: flex;
        flex-direction: column;
    }

    .modal-body-alert {
        flex: 1; /* Allow the body to grow and push the footer to the bottom */
    }

    .modal-footer-alert {
        padding: 20px 24px 24px 24px;
    }
}

.modal-footer-alert {
    padding: 18px 24px 24px 24px;
    display: flex;
    gap: 12px;
    background-color: #fafbfc;
    border-top: 1px solid var(--color-border);
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalScaleUp {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(12px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Spinner Animation for loading states */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.spinner-icon {
    animation: spin 0.8s linear infinite;
}

.btn-loading {
    pointer-events: none !important;
    opacity: 0.85 !important;
}

/* ==========================================================================
   Pantallas de Resultado de Pago (Exitoso, Fallido, Pendiente)
   ========================================================================== */
.pago-resultado-container {
    max-width: 580px;
    width: 100%;
    margin: 180px auto 60px auto;
    padding: 0 20px;
    box-sizing: border-box;
}

.pago-box-detail {
    background-color: #f8fafc;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 20px;
    margin: 24px 0;
    width: 100%;
    text-align: left;
    font-size: 0.9rem;
    box-sizing: border-box;
}

.pago-box-detail .detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px dashed var(--color-border);
}

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

.pago-box-detail .detail-label {
    color: var(--color-text-muted);
    font-weight: 500;
}

.pago-box-detail .detail-val {
    color: var(--color-text-main);
    font-weight: 700;
}

.descargar-link {
    text-decoration: none;
}

@media (max-width: 850px) {
    .pago-resultado-container {
        margin-top: 110px;
    }
}

/* ==========================================================================
   Filtros: Control Responsivo Estricto (Móviles vs Escritorios/Tablets)
   ========================================================================== */

/* 1. Escritorio, Monitores, Notebooks y Tablets (>= 768px):
   Mostrar ÚNICAMENTE la barra segmentada con glider (.filter-pills-wrapper)
   y OCULTAR de forma estricta el filtro móvil. */
@media (min-width: 768px) {
    #mobile-filter-container,
    .mobile-filter-accordion {
        display: none !important;
    }
    #desktop-filter-container,
    .filter-pills-wrapper {
        display: inline-flex !important;
        position: relative !important;
        background: #f1f5f9 !important;
        border: 1px solid #cbd5e1 !important;
        border-radius: 16px !important;
        padding: 6px !important;
        width: auto !important;
    }
    .filter-pills-wrapper .filter-btn {
        padding: 10px 22px !important;
        font-size: 14px !important;
    }
}

/* 2. Celulares y Pantallas Pequeñas (< 768px):
   OCULTAR completamente la barra segmentada de escritorio
   y Mostrar ÚNICAMENTE el botón de filtro móvil. */
@media (max-width: 767px) {
    #desktop-filter-container,
    .filter-pills-wrapper {
        display: none !important;
    }
    #mobile-filter-container,
    .mobile-filter-accordion {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* Estilos del Desplegable Flotante Móvil */
.mobile-filter-dropdown-panel {
    position: absolute !important;
    top: calc(100% + 6px) !important;
    left: 0 !important;
    right: 0 !important;
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 16px !important;
    box-shadow: 0 14px 35px -4px rgba(0, 30, 80, 0.18), 0 4px 10px rgba(0, 0, 0, 0.06) !important;
    z-index: 9999 !important;
    padding: 6px !important;
    display: none;
    flex-direction: column !important;
    gap: 4px !important;
}

.mobile-filter-dropdown-panel.is-open {
    display: flex !important;
    animation: mobileMenuDrop 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}

@keyframes mobileMenuDrop {
    0% {
        opacity: 0;
        transform: translateY(-8px) scale(0.97);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.mobile-filter-trigger-btn {
    box-sizing: border-box;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    transition: all 0.2s ease;
}

.mobile-filter-trigger-btn:hover {
    border-color: #003b94;
}

.mobile-filter-opt {
    width: 100%;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 11px 14px !important;
    border-radius: 12px !important;
    font-size: 0.93rem !important;
    font-weight: 600 !important;
    color: #334155 !important;
    background: transparent !important;
    border: none !important;
    cursor: pointer !important;
    transition: background-color 0.15s, color 0.15s !important;
    text-align: left !important;
}

.mobile-filter-opt:hover,
.mobile-filter-opt:active {
    background-color: #f1f5f9 !important;
    color: #0f172a !important;
}

.mobile-filter-opt.active {
    background-color: #eff6ff !important;
    color: #003b94 !important;
    font-weight: 700 !important;
}

.opt-label-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.opt-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}
.opt-dot.dot-blue { background-color: #003b94; }
.opt-dot.dot-emerald { background-color: #10b981; }
.opt-dot.dot-amber { background-color: #f59e0b; }

.pill-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
}

.pill-count.count-blue { background-color: #dbeafe; color: #003b94; }
.pill-count.count-emerald { background-color: #d1fae5; color: #047857; }
.pill-count.count-amber { background-color: #fef3c7; color: #b45309; }

/* GPU Performance Optimizations for Mobile Header */
.dashboard-header {
    will-change: transform, opacity;
    transform: translateZ(0);
    backface-visibility: hidden;
}

@media (max-width: 850px) {
    .dashboard-header {
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease-out !important;
    }
    .dashboard-header .header-nav {
        will-change: opacity, transform;
        transform: translateZ(0);
        backface-visibility: hidden;
    }
    .bg-ambient-orb {
        animation: none !important;
        filter: blur(40px) !important;
        opacity: 0.35 !important;
    }
}

/* ==========================================================================
   Términos y Condiciones (Checkbox y Modal de Cláusulas)
   ========================================================================== */
.terms-checkbox-container {
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-md, 12px);
    padding: 14px 16px;
    transition: all 0.2s ease;
}

.terms-checkbox-container:hover {
    border-color: #cbd5e1;
    background-color: #f1f5f9;
}

.terms-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    margin: 0;
}

.terms-link-button {
    color: #003b94;
    font-weight: 700;
    text-decoration: underline;
    background: none;
    border: none;
    padding: 0;
    font-size: inherit;
    cursor: pointer;
    transition: color 0.15s ease;
}

.terms-link-button:hover {
    color: #001f42;
    text-decoration: underline;
}

/* Badge de Liquidación de Consumo en Seguimiento */
.badge-liquidacion-consumo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.3;
    border: 1px solid #cbd5e1;
    background-color: #f1f5f9;
    color: #334155;
    box-sizing: border-box;
    max-width: 100%;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
}

.badge-liquidacion-consumo.con-consumo {
    background-color: #eff6ff;
    color: #002d62;
    border-color: #bfdbfe;
    font-weight: 600;
}

.badge-liquidacion-consumo.sin-consumo {
    background-color: #f1f5f9;
    color: #334155;
    border-color: #cbd5e1;
    font-weight: 500;
}

.badge-liquidacion-consumo .consumo-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: #003b94;
    flex-shrink: 0;
    display: inline-block;
}

/* Input Agrupado General con Prefijo/Icono Integrado (SPSE Design System) */
.spse-input-group,
.phone-input-group {
    display: flex;
    align-items: center;
    width: 100%;
    background-color: #fafbfc;
    border: 1px solid var(--color-border, #cbd5e1);
    border-radius: var(--radius-md, 10px);
    transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
    overflow: hidden;
}

.spse-input-group:hover,
.phone-input-group:hover {
    border-color: #94a3b8;
    background-color: #ffffff;
}

.spse-input-group:focus-within,
.phone-input-group:focus-within {
    background-color: #ffffff;
    border-color: #003b94;
    box-shadow: 0 0 0 4px rgba(0, 59, 148, 0.12);
}

.spse-input-group.is-invalid,
.phone-input-group.is-invalid {
    border-color: #ef4444 !important;
    background-color: #fef2f2 !important;
}

.spse-input-group.is-invalid:focus-within,
.phone-input-group.is-invalid:focus-within {
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.15) !important;
}

.spse-input-addon,
.phone-prefix-addon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 14px;
    background-color: #f1f5f9;
    border-right: 1px solid #cbd5e1;
    color: #002d62;
    font-weight: 700;
    font-size: 0.95rem;
    user-select: none;
    flex-shrink: 0;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.spse-input-addon svg {
    width: 18px;
    height: 18px;
    color: #003b94;
    transition: color 0.2s ease;
}

.spse-input-group:focus-within .spse-input-addon,
.phone-input-group:focus-within .phone-prefix-addon {
    background-color: #eff6ff;
    border-right-color: #bfdbfe;
    color: #002d62;
}

.spse-input-group:focus-within .spse-input-addon svg {
    color: #002d62;
}

.spse-input-field,
.phone-input-field {
    flex: 1;
    min-width: 0;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
    padding: 12px 16px;
    font-size: 0.95rem;
    font-family: inherit;
    color: #1e293b;
    box-sizing: border-box;
}

.spse-input-field::placeholder,
.phone-input-field::placeholder {
    color: #94a3b8;
}

/* Badges para Campos en Formularios */
.field-badge-required {
    font-size: 0.72rem;
    font-weight: 600;
    color: #002d62;
    background-color: #eff6ff;
    padding: 2px 8px;
    border-radius: 6px;
    border: 1px solid #bfdbfe;
    letter-spacing: 0.02em;
    user-select: none;
}

.field-badge-optional {
    font-size: 0.72rem;
    font-weight: 600;
    color: #64748b;
    background-color: #f1f5f9;
    padding: 2px 8px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    letter-spacing: 0.02em;
    user-select: none;
}



