:root {
    --primary: #2563eb;
    --teal: #0d9488;
    --bg-gradient: linear-gradient(135deg, #eff6ff 0%, #ffffff 50%, #f0fdfa 100%);

    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
}

body.login-page {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-gradient);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    background: white;
    padding: 2.5rem;
    border-radius: 1rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    width: 100%;
    max-width: 400px;
    border: 1px solid #f1f5f9;
}

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

.header p {
    text-align: center;
    font-size: 1rem;
    color: #475569;
}

.logo-box {
    background: linear-gradient(to bottom right, var(--primary), var(--teal));
    width: 80px;
    height: 80px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.logo-box svg {
    width: 54px;
    height: 54px;
}

.form-group { margin-bottom: 1.2rem; }

label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #334155;
}

.email-input {
    flex: 1 1 auto;
    height: 2.75rem;
    width: 100%;
    padding: 0 0.75rem;
    border: 1px solid var(--gray-200);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: all 0.2s;
    background-color: var(--gray-100);
    box-sizing: border-box;
}


/* Estilos para el campo de contraseña */
.password-field {
    margin-bottom: 1.5rem;
    width: 100%;
}

.password-field label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--gray-700);
    font-size: 0.875rem;
}

/* Contenedor del input: usar flex para mantener input e ícono en la misma fila */
.input-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

/* Estilo del input: tomar el espacio disponible */
.password-input {
    flex: 1 1 auto;
    min-width: 0; /* permite que el input se reduzca en flex container */
    height: 2.75rem;
    padding: 0 0.75rem;
    border: 1px solid var(--gray-200);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: all 0.2s;
    background-color: var(--gray-100);
    box-sizing: border-box;
}

.password-input:focus, .email-input:focus {
    outline: none;
    border-color: var(#3b82f6);
    box-shadow: 0 0 0 3px var(#dbeafe);
}

/* Estilo del toggle como control inline (no absolute) */
.password-toggle {
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-500);
    transition: color 0.15s, box-shadow 0.15s;
    border-radius: 0.375rem;
    line-height: 1;
    text-decoration: none;
}

.password-toggle svg { width: 20px; height: 20px; display: block; }

.password-toggle:hover { color: var(--gray-600); }

/* sombra al hacer click/focus y mantener el ícono gris */
.password-toggle:active,
.password-toggle:focus {
    box-shadow: 0 6px 18px rgba(16,24,40,0.12);
    outline: none;
}

/* Asegura que el input no tenga estilos conflictivos */
/* input.password-input {
    box-sizing: border-box;
    line-height: normal;
} */

/* Responsive */
@media (max-width: 640px) {
    .password-input {
        height: 2.5rem;
        font-size: 1rem; /* Previene zoom en iOS */
    }
}


/* Password toggle styles - integrated input + icon as single control */
/* .password-field { margin-bottom: 1.2rem; } */

/* Wrapper for input + icon so both appear as a single control */
/* .input-affix {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid var(--gray-200);
    border-radius: 0.5rem;
    background-color: var(--gray-100);
    padding: 0 0.5rem;
    flex-wrap: nowrap;
} */

/* .password-input {
    padding: 0.75rem 0.5rem;
    border: none;
    background: transparent;
    flex: 1 1 auto; 
    width: auto;
    box-sizing: border-box;
} */

/* .password-input:focus { outline: none; } */

/* allow input to shrink inside flex container (avoid forcing icon to next line) */
/* .password-input { min-width: 0; } */

/* .input-affix:focus-within {
    box-shadow: 0 0 0 4px rgba(37,99,235,0.06);
    border-color: var(--primary);
} */

/* .password-toggle {
    background: none;
    border: none;
    padding: 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--gray-500);
} */

/* Make toggle look like a control when it's an anchor */
/* .password-toggle {
    text-decoration: none;
} */

/* .password-toggle svg { display: block; } */

/* .password-toggle:focus {
    outline: 2px solid rgba(37,99,235,0.12);
    border-radius: 6px;
} */

/* .password-toggle .icon-eye-off { display: none; }
.password-toggle.show-off .icon-eye { display: none; }
.password-toggle.show-off .icon-eye-off { display: block; } */

/* Keep icon color consistent and add click/focus shadow */
/* .password-toggle { color: var(--gray-500); }
.password-toggle:active,
.password-toggle:focus {
    box-shadow: 0 6px 18px rgba(16,24,40,0.12);
    border-radius: 8px;
} */

.btn-primary {
    width: 100%;
    padding: 0.8rem;
    background: linear-gradient(to right, var(--primary), var(--teal));
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-primary:hover { 
    background: linear-gradient(to right, #1e40af, #0f766e);
    opacity: 1;
}

.error-box {
    background: #fef2f2;
    border: 1px solid #fee2e2;
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    
    /* Alineación del icono con el texto */
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.error-box p {
    margin: 0;
    line-height: 1.4;
    color: #991b1b;
}

.icon-alert {
    color: #dc2626;
    flex-shrink: 0;
}


.version {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.85rem;
    color: #94a3b8;
}

.footer-links {
    text-align: center;
    justify-content: space-between;
    margin-top: 1rem;
}

.footer-links a {
    font-size: 0.875rem;
    color: var(--primary);
    text-decoration: none;
}