/* =========================================
   Layout & Tipografía Consistente
   ========================================= */
.medisuite-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: var(--ms-bg-primary);
    border-bottom: 1px solid var(--ms-border-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

/* Ajuste del logo para que luzca bien */
.logo-img {
    height: 55px; /* Tamaño ideal para desktop */
    width: auto;
    max-width: 100%;
}

.mobile-menu-btn {
    display: none; /* Oculto en computadoras */
    background: none;
    border: none;
    color: var(--ms-navy-slate);
    cursor: pointer;
    padding: 0.5rem;
}

.nav-menu {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    color: var(--ms-text-main);
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem; /* Tamaño de letra estandarizado */
    transition: color 0.2s ease;
}

    .nav-link:hover {
        color: var(--ms-blue-gin);
    }

/* =========================================
   Footer Consolidado
   ========================================= */
.medisuite-footer {
    padding: 3rem 1.5rem 1.5rem 1.5rem;
    margin-top: auto;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2.5rem;
}

/* Tamaños de letra estrictamente uniformes */
.footer-title {
    color: var(--ms-cyan-medical);
    margin-bottom: 1rem;
    font-size: 1.5rem;
    font-weight: 700;
}

.footer-subtitle {
    color: white;
    margin-bottom: 1rem;
    font-size: 1.125rem;
    font-weight: 600;
}

.footer-text {
    color: #cbd5e1;
    font-size: 1rem;
    line-height: 1.6;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

    .footer-links li {
        margin-bottom: 0.75rem;
    }

    .footer-links a {
        color: #cbd5e1;
        text-decoration: none;
        font-size: 1rem;
        transition: color 0.2s ease;
    }

        .footer-links a:hover {
            color: white;
        }

.footer-bottom {
    text-align: center;
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: #94a3b8;
    font-size: 0.875rem;
}

/* =========================================
   Responsive Design (Modo Celular)
   ========================================= */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block; /* Muestra el botón de 3 rayitas en celular */
    }

    .nav-menu {
        display: none; /* Oculta el menú por defecto en celular */
        flex-direction: column;
        width: 100%;
        gap: 1rem;
        padding-top: 1rem;
        border-top: 1px solid var(--ms-border-color);
        margin-top: 1rem;
    }

        .nav-menu.open {
            display: flex; /* Muestra el menú cuando el usuario hace clic */
        }

        .nav-menu .btn-medisuite-primary {
            width: 100%;
            text-align: center;
        }

    .logo-img {
        height: 45px; /* Un poco más compacto en móvil */
    }

    .footer-container {
        grid-template-columns: 1fr; /* Una sola columna en celular */
        text-align: center; /* Se ve mucho más limpio centrado en móvil */
    }
}

h1:focus {
    outline: none;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

.ms-input {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid var(--ms-border-color);
    border-radius: 8px;
    font-size: 1rem;
    box-sizing: border-box;
}

    .ms-input:focus {
        outline: none;
        border-color: var(--ms-blue-gin);
        box-shadow: 0 0 0 3px rgba(37, 130, 255, 0.1);
    }

.ms-error {
    color: #ef4444;
    font-size: 0.85rem;
    margin-top: 0.25rem;
    display: block;
}

.ms-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;

    background: rgba(0, 0, 0, 0.5);

    display: flex;
    align-items: center;
    justify-content: center;

    z-index: 9999;
}

.ms-modal {
    background: var(--ms-bg-primary);
    border-radius: 12px;
    padding: 1.5rem;
    width: 90%;
    max-width: 400px;

    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.ms-modal-header h3 {
    margin: 0 0 1rem 0;
    color: var(--ms-text-main);
}

.ms-modal-body {
    margin-bottom: 1rem;
    color: var(--ms-text-main);
}

.ms-modal-footer {
    text-align: right;
}

.ms-overlay {
    animation: fadeIn 0.25s ease-out;
}

.ms-modal {
    animation: slideUpElegant 0.38s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Fondo aparece suave */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Modal sube con suavidad */
@keyframes slideUpElegant {
    from {
        transform: translateY(50px) scale(0.985);
        opacity: 0;
    }

    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* ===== CONTENEDOR GENERAL ===== */
.pagos-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 16px;
}

.pagos-header {
    text-align: center;
    max-width: 500px;
}

/* ===== HEADER ===== */
.pagos-header h2 {
    font-weight: 700;
    margin-bottom: 5px;
}

.pagos-header p {
    color: #6c757d;
    margin-bottom: 25px;
}

/* ===== CARD ===== */
.pagos-card {
    width: 100%;
    max-width: 900px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    overflow: hidden;
}

/* ===== TABLA ===== */
.table-wrapper {
    width: 100%;
    overflow-x: auto;
}

.pagos-table {
    width: 100%;
    border-collapse: collapse;
}

    /* HEADER */
    .pagos-table thead {
        background-color: #f8f9fa;
    }

    .pagos-table th {
        padding: 16px;
        font-weight: 600;
        font-size: 14px;
        text-align: center;
        color: #495057;
    }

    /* FILAS */
    .pagos-table td {
        padding: 16px;
        text-align: center;
        border-top: 1px solid #eee;
        font-size: 14px;
    }

    /* HOVER */
    .pagos-table tbody tr:hover {
        background-color: #f9fbfd;
    }

/* PRODUCTO */
.producto {
    font-weight: 600;
    color: #0d6efd;
}

/* MONTO */
.monto {
    font-weight: 700;
}

/* BADGE */
.badge-pago {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

    .badge-pago.success {
        background-color: #e6f4ea;
        color: #198754;
    }

/* EMPTY STATE */
.empty-state {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

.pago-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
    background: #f5f7fb;
}

.pago-card {
    background: white;
    padding: 2.5rem;
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
}

.plan-option {
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.2rem;
    cursor: pointer;
    margin-bottom: 1rem;
    transition: all 0.2s ease;
}

    .plan-option.active {
        border-color: #2563eb;
        background: #eff6ff;
    }

    .plan-option label {
        display: flex;
        gap: 1rem;
        cursor: pointer;
    }

.precio {
    font-size: 1.2rem;
    font-weight: bold;
}

    .precio span {
        font-size: 0.85rem;
        color: #6b7280;
    }

.badge-ahorro {
    color: #2563eb;
    font-weight: 600;
    font-size: 0.85rem;
}

.btn-pagar {
    width: 100%;
    padding: 1rem;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    transition: 0.2s;
}

    .btn-pagar:hover {
        background: #1d4ed8;
    }

.subscription-card {
    max-width: 520px;
    width: 100%;
    margin: 2rem 0 0 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
    padding: 1.5rem 1.8rem;
    text-align: center;
}

.subscription-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    gap: 5px;
}

    .subscription-header h5 {
        margin: 0;
        font-weight: 700;
        color: #0f172a;
    }

.subscription-badge {
    background: #e0f2fe;
    color: #0369a1;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
}

.subscription-body {
    margin: 1rem 0;
}

.subscription-plan {
    font-size: 1.05rem;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 0.5rem;
}

.product-name {
    color: #1d4ed8;
}

.separator {
    margin: 0 0.3rem;
    color: #94a3b8;
}

.plan-name {
    color: #0f172a;
}

.subscription-date {
    color: #64748b;
    font-size: 0.9rem;
}

.subscription-footer {
    margin-top: 1.5rem;
}

.btn-cancelar {
    background: transparent;
    border: 1px solid #ef4444;
    color: #ef4444;
    padding: 0.5rem 1.2rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

    .btn-cancelar:hover {
        background: #ef4444;
        color: white;
    }

.badge-pendiente {
    background-color: #facc15; /* amarillo */
    color: #000;
}

.plan-badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 999px;
    letter-spacing: 0.3px;
}

    .plan-badge.anual {
        background: rgba(99, 102, 241, 0.15);
        color: #6366f1;
    }

    .plan-badge.mensual {
        background: rgba(14, 165, 233, 0.15);
        color: #0ea5e9;
    }

    .plan-badge.gratis {
        background: rgba(234, 179, 8, 0.15);
        color: #eab308;
    }

    .plan-badge.desconocido {
        background: rgba(148, 163, 184, 0.15);
        color: #64748b;
    }

.continuar-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 80vh;
}

.continuar-card {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    max-width: 400px;
    text-align: center;
}

    .continuar-card h3 {
        margin-bottom: 10px;
    }

    .continuar-card p {
        color: #6b7280;
        margin-bottom: 20px;
    }

.btn-continuar {
    background: #6366f1;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    font-weight: 600;
}

    .btn-continuar:hover {
        background: #4f46e5;
    }

    .facturado {
        color: #198754; /* verde */
        font-size: 1.2rem;
    }

    .icon-btn.pendiente {
        background: transparent;
        border: none;
        color: #6c757d; /* gris neutro */
        cursor: pointer;
        font-size: 1.2rem;
        transition: color 0.2s ease;
    }

    .icon-btn.pendiente:hover {
        color: #0d6efd; /* azul al pasar el mouse */
    }

.custom-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.custom-modal {
    width: 100%;
    max-width: 420px;
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 10px 25px rgba(0,0,0,.2);
}

.custom-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

    .custom-modal-header h5 {
        margin: 0;
        font-weight: 600;
        color: #1e293b;
    }

.close-btn {
    border: none;
    background: transparent;
    font-size: 1.2rem;
    cursor: pointer;
    color: #64748b;
}

    .close-btn:hover {
        color: #0f172a;
    }

.password-input {
    width: 100%;
    box-sizing: border-box;
    padding: .85rem 1rem;
    border: 1px solid #d0d7de;
    border-radius: 12px;
    background: #f8fafc;
    font-size: .95rem;
    transition: .2s ease;
    outline: none;
    margin-top: .5rem;
}

    .password-input:focus {
        border-color: #2563eb;
        background: white;
        box-shadow: 0 0 0 3px rgba(37,99,235,.15);
    }

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: .75rem;
    margin-top: 1.5rem;
}

    .modal-actions button {
        border: none;
        padding: .75rem 1.2rem;
        border-radius: 12px;
        font-weight: 600;
        transition: .2s ease;
        cursor: pointer;
    }

.btn-cancel {
    background: #f1f5f9;
    color: #334155;
}

    .btn-cancel:hover {
        background: #e2e8f0;
    }

.btn-confirm {
    background: #ef4444;
    color: white;
}

    .btn-confirm:hover {
        background: #dc2626;
    }

.validation-message {
    color: #dc2626;
    font-size: .85rem;
    margin-top: .5rem;
    display: block;
}

.btn-activar-suscripcion {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 10px 18px;
    background: white;
    color: #2563eb;
    border: 1.5px solid #2563eb;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all .2s ease;
}

    .btn-activar-suscripcion:hover {
        background: #2563eb;
        color: white;
        transform: translateY(-1px);
    }

    .btn-activar-suscripcion:active {
        transform: translateY(0);
    }
/* =========================
   MODAL DESCARGAR FACTURA
   ========================= */

.custom-factura-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(15, 23, 42, 0.55);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    animation: fadeIn .2s ease;
}

.custom-factura-modal {
    width: 100%;
    max-width: 950px;
    max-height: 90vh;
    background: white;
    border-radius: 22px;
    padding: 2rem;
    box-shadow: 0 20px 60px rgba(0,0,0,.25), 0 8px 20px rgba(0,0,0,.12);
    animation: slideUpElegant .28s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.cards-container {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    justify-content: flex-start;
    flex-wrap: wrap;
}

.subscription-card,
.payment-card {
    flex: 1;
    min-width: 320px;
    margin-top: 2rem;
}

/* PAYMENT CARD */

.payment-card {
    max-width: 520px;
    width: 100%;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
    padding: 1.5rem 1.8rem;
}

.payment-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    gap: 5px;
}

    .payment-card-header h3 {
        margin: 0;
        font-weight: 700;
        font-size: 1.1rem;
        color: #0f172a;
    }

.card-type {
    background: #e0f2fe;
    color: #0369a1;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
}

.payment-card-body {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.payment-item {
    display: flex;
    flex-direction: column;
    min-width: fit-content;
}


.label {
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 0.2rem;
}

.value {
    font-size: 1rem;
    font-weight: 600;
    color: #0f172a;
}

.payment-card-footer {
    margin-top: 1.2rem;
    display: flex;
    justify-content: flex-end;
}

.btn-cambiar-pago {
    border: none;
    background: #2563eb;
    color: white;
    padding: 0.6rem 1rem;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s ease;
}

    .btn-cambiar-pago:hover {
        background: #1d4ed8;
    }

.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
    margin-top: 12px;
    margin-bottom: 12px;
}

.pagination-btn {
    width: 38px;
    height: 38px;
    border: 1px solid #e5e7eb;
    background: white;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #334155;
    font-size: 1rem;
}

    .pagination-btn:hover:not(:disabled) {
        background: #f8fafc;
        border-color: #cbd5e1;
        transform: translateY(-1px);
    }

    .pagination-btn:disabled {
        opacity: 0.4;
        cursor: not-allowed;
    }

.pagination-info {
    font-size: 0.95rem;
    font-weight: 500;
    color: #64748b;
}

.badge-mora {
    background-color: #ffe5e5;
    color: #d93025;
}

.payment-failed-alert {
    margin-top: 12px;
    padding: 12px;
    border-radius: 8px;
    background: #fff4e5;
    color: #b26a00;
    font-size: 0.9rem;
}