/* ============================================
   DX AUTH THEME - Login, 2FA y Acceso denegado
   Se carga después del <style> inline de cada página.
   ============================================ */

:root {
    --primary-blue: #0f766e;
    --primary-dark: #115e59;
    --primary-light: #14b8a6;
    --accent-blue: #0b5f59;
    --dx-navy: #0b2540;
    --dx-coral: #e8573f;
    --dx-font: 'Figtree', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { font-family: var(--dx-font); }

/* Fondo: navy profundo con halos teal/coral y retícula sutil */
html { background-color: #061321; }

body {
    min-height: 100vh;
    background-attachment: fixed;
    background-color: #061321;
    background-image:
        radial-gradient(60rem 40rem at 10% -10%, rgba(20, 184, 166, 0.28), transparent 60%),
        radial-gradient(45rem 35rem at 110% 110%, rgba(232, 87, 63, 0.20), transparent 60%),
        linear-gradient(160deg, #0b2540 0%, #061321 100%);
    -webkit-font-smoothing: antialiased;
}

body::before {
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: 32px 32px;
    -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
    mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
    animation: none;
}

/* Tarjeta */
.login-card,
.tfa-card,
.access-denied-card {
    border-radius: 20px;
    box-shadow: 0 30px 80px rgba(2, 8, 15, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.06);
}

/* Encabezado: blanco limpio con marca, en lugar del bloque degradado del ERP */
.login-header,
.tfa-header {
    background: #ffffff;
    color: var(--dx-navy);
    padding: 36px 32px 8px;
}

.login-header::before,
.tfa-header::before { display: none; }

.login-header h1,
.tfa-header h1 {
    color: var(--dx-navy);
    font-weight: 800;
    letter-spacing: -0.02em;
}

.login-header p,
.tfa-header p {
    color: #4b5b63;
    opacity: 1;
}

.logo-container,
.shield-icon {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    background: linear-gradient(140deg, #14b8a6 0%, #0f766e 60%, #0b5f59 100%);
    box-shadow: 0 10px 24px rgba(15, 118, 110, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
    margin-bottom: 18px;
    animation: none;
    position: relative;
}

.logo-container::after {
    content: '';
    position: absolute;
    top: -4px;
    right: -4px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--dx-coral);
    border: 3px solid #ffffff;
}

.logo-container i,
.shield-icon i {
    font-size: 30px;
    background: none;
    -webkit-text-fill-color: #ffffff;
    color: #ffffff;
}

.login-body,
.tfa-body {
    padding: 28px 36px 36px;
}

/* Formularios */
.form-label { color: #33424a; font-size: 13.5px; }

.form-control,
.form-select,
.code-input {
    border: 1.5px solid #d5dede;
    border-radius: 12px;
}

.form-control:focus,
.form-select:focus,
.code-input:focus {
    border-color: #14b8a6;
    box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.2);
    outline: none;
}

.input-group .form-control { background: #fff; }

.input-group:focus-within .input-group-text,
.input-group:focus-within .btn-toggle-password {
    border-color: #14b8a6;
}

.input-group .form-control:focus { box-shadow: none; }

.input-group:focus-within {
    border-radius: 12px;
    box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.2);
}

.input-group-text {
    border-color: #d5dede;
    background: #f3f6f6;
    color: #4b5b63;
}

.form-check-input:checked {
    background-color: #0f766e;
    border-color: #0f766e;
}

/* Botones principales */
.btn-login,
.btn-verify,
.access-denied-card .btn-primary {
    background: #0f766e;
    border: none;
    border-radius: 12px;
    color: #fff;
    box-shadow: 0 6px 16px rgba(15, 118, 110, 0.3);
}

.btn-login:hover:not(:disabled),
.btn-verify:hover:not(:disabled),
.access-denied-card .btn-primary:hover {
    background: #115e59;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(15, 118, 110, 0.35);
}

.btn-login::before { display: none; }

.btn-login:focus-visible,
.btn-verify:focus-visible,
.btn-send-email:focus-visible,
.access-denied-card a:focus-visible {
    outline: 3px solid rgba(20, 184, 166, 0.6);
    outline-offset: 2px;
}

.btn-send-email,
.access-denied-card .btn-outline {
    color: #0f766e;
    border-color: rgba(15, 118, 110, 0.45);
    border-radius: 12px;
}

.btn-send-email:hover,
.access-denied-card .btn-outline:hover {
    background: #e6f4f1;
    color: #115e59;
    border-color: #0f766e;
}

.btn-link,
.recovery-link { color: #0f766e; }
.btn-link:hover,
.recovery-link:hover { color: #115e59; }

.provider-tab.active {
    border-color: #0f766e;
    background: #e6f4f1;
    color: #0f766e;
}

/* Alertas */
.alert { border-radius: 12px; }
.alert-danger { background: #fef2f2; color: #b91c1c; }
.alert-success { background: #ecfdf5; color: #166534; }
.alert-info { background: #e6f4f1; color: #134e4a; }

/* Insignia de seguridad bajo la tarjeta */
.security-badge {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.security-badge p { color: #b6c4d2; }
.security-badge i { color: #5eead4; }

.back-link { color: #b6c4d2; }

/* Acceso denegado */
.access-denied-card .icon-container {
    background: #fdece8;
    box-shadow: none;
}

.access-denied-card .icon-container i {
    background: none;
    -webkit-text-fill-color: #e8573f;
    color: #e8573f;
}

.access-denied-card h1 { color: var(--dx-navy); font-weight: 800; }

.access-denied-card .user-info {
    background: #f3f6f6;
    border-left-color: #0f766e;
}

/* Logo del laboratorio en las páginas de acceso */
.auth-logo {
    display: block;
    width: 100%;
    max-width: 230px;
    height: auto;
    margin: 0 auto 14px;
}

.tfa-header .auth-logo,
.access-denied-card .auth-logo {
    max-width: 180px;
    margin-bottom: 18px;
}

/* En verificación el escudo queda como apoyo visual, más pequeño */
.tfa-header .shield-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    margin-bottom: 12px;
}

.tfa-header .shield-icon i { font-size: 22px; }

/* Páginas de acceso con _AuthLayout (recuperar / restablecer contraseña) */
body.auth-page {
    min-height: 100vh;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-page-container {
    width: 100%;
    max-width: 460px;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.auth-page-card {
    background: #ffffff;
    border-radius: 20px;
    padding: 36px 36px 32px;
    box-shadow: 0 30px 80px rgba(2, 8, 15, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.auth-page-card h1 {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--dx-navy);
    text-align: center;
    margin: 0 0 6px;
}

.auth-page-card .auth-subtitulo {
    text-align: center;
    color: #4b5b63;
    font-size: 14px;
    margin-bottom: 24px;
}

.auth-page-card .btn-primario {
    width: 100%;
    background: #0f766e;
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 13px 20px;
    font-weight: 700;
}

.auth-page-card .btn-primario:hover { background: #115e59; color: #fff; }
.auth-page-card .btn-primario:focus-visible { outline: 3px solid rgba(20, 184, 166, 0.6); outline-offset: 2px; }

.auth-page-card .enlace-volver {
    display: block;
    text-align: center;
    margin-top: 18px;
    color: #0f766e;
    font-weight: 600;
    text-decoration: none;
}

.auth-page-card .enlace-volver:hover { text-decoration: underline; }

.enlace-olvido {
    display: block;
    text-align: center;
    margin-top: 16px;
    color: #0f766e;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
}

.enlace-olvido:hover { color: #115e59; text-decoration: underline; }

/* Select2 en el login (selección de empresa) */
.input-group > .select2-container { flex: 1 1 auto; width: 1% !important; }
.input-group > .select2-container .select2-selection { border: 1.5px solid #d5dede; border-radius: 0 12px 12px 0; min-height: 50px; display: flex; align-items: center; }
.select2-container--bootstrap-5.select2-container--focus .select2-selection,
.select2-container--bootstrap-5.select2-container--open .select2-selection { border-color: #14b8a6; box-shadow: none; }
.select2-container--bootstrap-5 .select2-dropdown .select2-results__option--highlighted { background: #e6f4f1; color: #0e1b24; }
.select2-container--bootstrap-5 .select2-dropdown .select2-results__option--selected { background: #0f766e; color: #fff; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
}

/* Grupo de entrada uniforme (icono + campo + ver contraseña) */
.input-group .input-group-text,
.input-group .btn-toggle-password,
.input-group .form-control {
    border-width: 1.5px;
    border-color: #d5dede;
}

.input-group .input-group-text,
.input-group .btn-toggle-password { background: #f6f8f8; }
.input-group .btn-toggle-password:hover { color: #0f766e; }

.input-group:focus-within .form-control,
.input-group:focus-within .input-group-text,
.input-group:focus-within .btn-toggle-password { border-color: #14b8a6; }
