/* ==========================================
   VARIABLES Y BASE DE AUTENTICACIÓN
   ========================================== */

:root {
    --primary: #0284c7;
    --primary-hover: #0369a1;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --bg-card: #ffffff;
    --border-color: #e2e8f0;
}

/* Reset base y bloqueo visual preventivo */
body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

body.auth-pending {
    display: none !important;
}

/* ==========================================
   CONFIGURACIÓN DEL LIENZO PARTICLES.JS
   ========================================== */

/* Configuración del fondo blanco para partículas en negro */
.auth-page-body {
    background-color: #ffffff !important;
    /* Fondo blanco de la pantalla */
    min-height: 100vh;
    margin: 0;
    padding: 0;
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

#particles-js {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 1;
}

#particles-js>canvas {
    display: block;
    vertical-align: bottom;
    width: 100%;
    height: 100%;
}

/* Tarjeta con sombra pronunciada sobre fondo claro */
.auth-card-container {
    position: relative;
    z-index: 10 !important;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
}

/* ==========================================
   TARJETA CONTENEDORA PRINCIPAL
   ========================================== */

.auth-card-container {
    position: relative;
    z-index: 10 !important;
    /* Capa superior para permitir interacción con campos y botones */
    background: var(--bg-card, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 420px;
    padding: 2.5rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    box-sizing: border-box;
}

/* Encabezado y Marca */
.auth-brand-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    text-align: center;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color, #e2e8f0);
}

.auth-logo {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.auth-brand-header h1 {
    font-size: 1.25rem;
    color: var(--text-dark, #1e293b);
    margin: 0;
}

.auth-brand-header h1 span {
    color: var(--primary, #0284c7);
}

.auth-header {
    text-align: center;
    margin-bottom: 1.25rem;
}

.auth-header h2 {
    font-size: 1.3rem;
    color: var(--text-dark, #1e293b);
    margin-bottom: 0.35rem;
}

.auth-header p {
    font-size: 0.85rem;
    color: var(--text-muted, #64748b);
    margin: 0;
}

/* ==========================================
   FORMULARIOS E INPUTS
   ========================================== */

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dark, #1e293b);
}

.form-control {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--border-color, #cbd5e1);
    border-radius: 6px;
    font-size: 0.9rem;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
    border-color: var(--primary, #0284c7);
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

/* ==========================================
   CONTENEDOR DE CONTRASEÑA E ICONO DERECHO
   ========================================== */

.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.password-input-wrapper .form-control {
    padding-right: 2.5rem !important;
    /* Espacio reservado para que el texto no toque el icono */
}

.btn-toggle-password {
    position: absolute;
    right: 0.75rem;
    background: transparent;
    border: none;
    color: var(--text-muted, #64748b);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.2rem;
    border-radius: 4px;
    transition: color 0.2s ease;
    z-index: 2;
}

.btn-toggle-password:hover {
    color: var(--primary, #0284c7);
}

/* ==========================================
   ACCIONES Y BOTONES
   ========================================== */

.auth-actions-row {
    display: flex;
    justify-content: flex-end;
    margin-top: -0.5rem;
}

.btn-link {
    background: transparent;
    border: none;
    color: var(--primary, #0284c7);
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
}

.btn-link:hover {
    color: var(--primary-hover, #0369a1);
}

.form-actions-stacked {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.btn-primary {
    background-color: var(--primary, #0284c7);
    color: #ffffff;
    border: none;
    padding: 0.7rem 1.2rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn-primary:hover {
    background-color: var(--primary-hover, #0369a1);
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-dark, #475569);
    border: 1px solid var(--border-color, #cbd5e1);
    padding: 0.7rem 1.2rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn-secondary:hover {
    background-color: #f1f5f9;
}

.btn-block {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hidden {
    display: none !important;
}