/* Colores de marca: respaldo por si init/login_colores.php no llega a inyectar
   el <style> con los valores reales de EMPRESA. En el login el color DOMINANTE
   (encabezado, botón) es el secundario de EMPRESA (naranja por defecto); el
   primario de EMPRESA (azul por defecto) queda solo como acento en links. */
:root {
    --login-primary: #FF8C0F;
    --login-primary-dark: #A65B0A;
    --login-primary-light: #FFA94B;
    --login-primary-shadow: rgba(255, 140, 15, 0.15);
    --login-primary-shadow-strong: rgba(255, 140, 15, 0.35);
    --login-secondary: #165F83;
    --login-secondary-dark: #124C69;
}

/* Modal 2FA profesional */
.modal-no-code {
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.35);
    display: none;
    /* OCULTO POR DEFECTO */
    align-items: center;
    justify-content: center;
}

.modal-content-no-code {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 40px 240px rgba(0, 0, 0, 0.66);
    max-width: 380px;
    width: 95vw;
    position: relative;
    text-align: center;
    animation: modalFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Header del Modal (Diseño Limpio/Blanco) */
.modal-header-premium {
    background: #fff;
    padding: 25px 20px 20px;
    text-align: center;
    position: relative;
}

.modal-header-premium h4 {
    color: var(--login-primary) !important;
    margin: 0 !important;
    font-size: 1.3rem;
    font-weight: 600;
}

.close-modal-no-code {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 1.4rem;
    color: #aaa;
    cursor: pointer;
    transition: color 0.2s;
}

.close-modal-no-code:hover {
    color: #666;
}

.modal-desc {
    color: #444;
    font-size: 0.95rem;
    margin: 0 20px 1.2rem;
    line-height: 1.4;
}

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    margin: 0 20px 1.1rem;
}

.btn-modal {
    background: var(--login-primary);
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 0.8rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.18s;
}

.btn-modal:disabled {
    background: #b3c2e6;
    cursor: not-allowed;
}

.btn-modal-alt {
    background: #fff;
    color: var(--login-primary);
    border: 1px solid var(--login-primary);
    border-radius: 5px;
    padding: 0.8rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s;
}

.btn-modal-alt:hover:not(:disabled) {
    background: #f2f6ff;
}

.btn-modal-alt:disabled {
    border-color: #cbd5e0;
    color: #cbd5e0;
    cursor: not-allowed;
}

.modal-timer-row {
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 0.7rem;
}

.modal-msg {
    font-size: 0.9rem;
    min-height: 1.2em;
    margin: 10px 20px;
    padding: 10px;
    border-radius: 8px;
    display: none;
    /* Se muestra cuando hay texto */
}

.modal-msg.error {
    background: #fff5f5;
    border: 1px solid #fed7d7;
    color: #c53030;
    display: block;
}

.modal-msg.success {
    background: transparent;
    border: none;
    color: #28a745;
    display: block;
    font-weight: 500;
    padding: 5px 0;
    box-shadow: none;
}

.no-methods-notice {
    padding: 12px;
    background-color: #fff5f5;
    border: 1px solid #fed7d7;
    border-radius: 8px;
    color: #c53030;
    font-size: 0.85rem;
    text-align: center;
    margin: 10px 20px;
}

/* Estilos para Selección de Método */
.methods-selection {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 15px 20px;
}

.method-selection-btn {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    width: 100%;
}

.method-selection-btn:hover {
    border-color: var(--login-primary);
    background: #f7fafc;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.method-selection-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    border-color: #e2e8f0;
    background: #f8fafc;
}

.method-icon {
    font-size: 1.5rem;
    margin-right: 15px;
    display: flex;
    align-items: center;
    color: var(--login-primary);
}

.method-info {
    display: flex;
    flex-direction: column;
}

.method-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: #1a202c;
}

.method-val {
    font-size: 0.85rem;
    color: #718096;
}

/* ============================================
   2FA Verification — Clean Minimal Design
   ============================================ */

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #f0f2f5;
    font-family: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
    color: #333;
}

/* --- Wrapper --- */
.tfa-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

/* --- Card --- */
.tfa-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 16px;
    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.08),
        0 2px 10px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Card Header (igual al login) --- */
.tfa-card-header {
    background: var(--login-primary);
    padding: 24px 40px 20px;
    text-align: center;
}

.tfa-card-header h3 {
    color: #fff;
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* --- Card Body --- */
.tfa-card-body {
    padding: 24px 40px 32px;
}

.tfa-subtitle {
    font-size: 0.875rem;
    color: #a0aec0;
    text-align: center;
    margin-bottom: 4px;
    line-height: 1.5;
}

.tfa-phone {
    font-size: 1rem;
    color: #1a202c;
    font-weight: 600;
    text-align: center;
    margin-bottom: 28px;
    letter-spacing: 0.15em;
}

/* --- Label --- */
.tfa-card-body label {
    display: block;
    margin-bottom: 10px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #718096;
    text-align: center;
}

/* --- Code Inputs --- */
.code-inputs {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 8px;
}

.code-inputs input {
    width: 56px;
    height: 60px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    font-family: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
    color: #1a202c;
    border: 1px solid #e2e8f0;
    background: #fff;
    outline: none;
    border-radius: 10px;
    padding: 0;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.code-inputs input:focus {
    border-color: var(--login-primary);
    box-shadow: 0 0 0 3px var(--login-primary-shadow);
}

.timer-row {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    font-size: 0.85rem;
    color: #718096;
}

#timer {
    font-weight: 600;
    color: #4a5568; /* Gris oscuro por defecto */
}

#timer.warning {
    color: #ed8936; /* Naranja para advertencia */
}

#timer.expired {
    color: #e53e3e; /* Rojo cuando expira */
}

.msg-box {
    min-height: 20px;
    margin-bottom: 15px;
    font-size: 0.875rem;
    text-align: center;
    transition: all 0.3s ease;
}

.msg-box.error {
    color: #e53e3e;
    font-weight: 500;
}

.msg-box.ok {
    color: #38a169;
    font-weight: 500;
}

.btn-verify {
    display: block;
    width: 100%;
    padding: 14px;
    margin-top: 18px;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #fff;
    background: var(--login-primary);
    border: none;
    border-radius: 24px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-verify:hover:not(:disabled) {
    background: var(--login-primary-dark);
}

.btn-verify:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.resend-row {
    margin-top: 18px;
    text-align: center;
}

.no-code-link {
    color: var(--login-secondary);
    font-size: 0.85rem;
    text-decoration: underline;
}

.back-link {
    display: block;
    margin-top: 18px;
    font-size: 0.8rem;
    color: #a0aec0;
    text-decoration: none;
    text-align: center;
    transition: color 0.15s;
}

.back-link:hover {
    color: var(--login-secondary);
    text-decoration: underline;
}
