/* ===============================================
   AUTH SHARED - Estilos compartidos para todas
   las páginas de autenticación (login, register,
   recovery, reset-password, verify-email, etc.)
   =============================================== */

/* Contenedor centrado verticalmente */
.auth-container {
    min-height: calc(100vh - 120px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background: linear-gradient(135deg, var(--background) 0%, var(--surface) 100%);
}

/* Caja principal del formulario */
.auth-box {
    background-color: var(--surface);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    padding: 2.5rem;
    width: 100%;
    max-width: 440px;
    position: relative;
}

/* Línea decorativa superior */
.auth-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

/* Encabezado de la sección */
.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-subtitle {
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0;
}

/* Cuerpo del formulario */
.auth-form {
    width: 100%;
}

.auth-form .form-group {
    margin-bottom: 1.25rem;
}

/* Input con ícono izquierdo */
.input-icon-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon-wrapper i {
    position: absolute;
    left: 1rem;
    color: var(--text-light);
    width: 1.1rem;
    height: 1.1rem;
    z-index: 2;
    pointer-events: none;
}

.input-icon-wrapper input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 2.75rem;
    border: 2px solid var(--border);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: border-color var(--transition), box-shadow var(--transition);
    background-color: var(--surface);
    color: var(--text);
}

.input-icon-wrapper input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    background-color: var(--background);
}

.input-icon-wrapper input::placeholder {
    color: var(--text-light);
    opacity: 0.7;
}

/* Botón para mostrar/ocultar contraseña */
.toggle-password {
    position: absolute;
    right: 0.75rem;
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 0.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--transition), background-color var(--transition);
    z-index: 10;
    border-radius: 50%;
}

.toggle-password:hover {
    color: var(--text);
    background-color: var(--background-alt);
}

.toggle-password:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.toggle-password i {
    width: 1.1rem;
    height: 1.1rem;
    pointer-events: none;
}

/* Header de campo contraseña (label + olvidé contraseña) */
.password-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.forgot-password {
    font-size: 0.875rem;
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition);
}

.forgot-password:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Checkbox recuérdame */
.remember-me {
    margin-bottom: 0.75rem;
}

.checkbox-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox-text {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Mensaje de error inline */
.error-message {
    display: block;
    color: var(--danger);
    font-size: 0.875rem;
    margin-top: 0.375rem;
}

/* Estado de error en input */
.input-icon-wrapper input.error {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

/* Botón de envío a ancho completo */
.btn-auth-submit {
    width: 100%;
    justify-content: center;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    margin-top: 1rem;
    position: relative;
    overflow: hidden;
}

.btn-auth-submit::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transition: left 0.5s;
}

.btn-auth-submit:hover::before {
    left: 100%;
}

/* Links de navegación al pie del formulario */
.auth-links {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    font-size: 0.9rem;
    color: var(--text-muted);
}

.auth-links a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition);
}

.auth-links a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Animación spinner en botones */
@keyframes auth-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.btn-auth-submit [data-feather="loader"] {
    animation: auth-spin 1s linear infinite;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
    .auth-container {
        padding: 1rem;
        min-height: calc(100vh - 80px);
    }

    .auth-box {
        padding: 1.5rem;
    }

    .auth-title {
        font-size: 1.5rem;
    }

    .auth-subtitle {
        font-size: 0.875rem;
    }

    .password-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .input-icon-wrapper input {
        padding: 0.75rem 1rem 0.75rem 2.5rem;
        font-size: 0.95rem;
    }

    .btn-auth-submit {
        padding: 0.75rem 1.25rem;
        font-size: 0.95rem;
    }
}

@media (max-width: 360px) {
    .auth-box {
        padding: 1.25rem;
    }
}
