/**
 * tribu/app/assets/css/auth.css
 * Estilos modernos unificados para las pantallas de autenticación de la Intranet Tribu
 * (Login, Recuperación de Contraseña y Restablecimiento)
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* --- Reset y Base --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: #ffffff;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    -webkit-font-smoothing: antialiased;
}

/* --- Tarjeta Glassmorphic --- */
.auth-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    text-align: center;
}

.auth-logo {
    margin-bottom: 16px;
}

.auth-logo img {
    height: 48px;
    width: auto;
    display: inline-block;
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #ff6b35;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.auth-subtitle {
    font-size: 0.9rem;
    color: #cbd5e1;
    margin-bottom: 24px;
    line-height: 1.5;
}

/* --- Alertas y Notificaciones --- */
.alert {
    padding: 13px 15px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 20px;
    text-align: left;
    line-height: 1.45;
}

.alert-error {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid #ef4444;
    color: #fca5a5;
}

.alert-success {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid #10b981;
    color: #a7f3d0;
}

.alert-info {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.4);
    color: #93c5fd;
}

/* --- Formulario y Campos --- */
.form-group {
    margin-bottom: 18px;
    text-align: left;
    position: relative;
}

.form-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: #cbd5e1;
    margin-bottom: 6px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.form-input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s ease;
}

.form-input::placeholder {
    color: #64748b;
}

.form-input:focus {
    border-color: #ff6b35;
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.25);
}

.form-input-has-toggle {
    padding-right: 46px;
}

/* --- Botón Plano SVG para Mostrar/Ocultar Contraseña (Sin emojis) --- */
.btn-toggle-password {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: color 0.2s ease, background 0.2s ease;
}

.btn-toggle-password:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.btn-toggle-password:focus {
    outline: none;
    color: #ff6b35;
}

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

/* --- Fila Recordar Sesión / Olvidé Contraseña --- */
.form-row-auth {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
    font-size: 0.82rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #cbd5e1;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #ff6b35;
    cursor: pointer;
}

.forgot-link {
    color: #ff8c69;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.forgot-link:hover {
    color: #ffa588;
    text-decoration: underline;
}

/* --- Botones Principales y Secundarios --- */
.btn-submit {
    width: 100%;
    padding: 14px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, #ff6b35, #e55a2b);
    color: #ffffff;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.45);
}

.btn-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-secondary {
    display: inline-block;
    margin-top: 15px;
    padding: 12px 24px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background 0.2s ease;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.18);
}

/* --- Spinner de Carga --- */
.spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: auth-spin 0.8s linear infinite;
}

@keyframes auth-spin {
    to { transform: rotate(360deg); }
}

/* --- Enlace para Volver y Footer --- */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 25px;
    font-size: 0.85rem;
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.2s;
}

.back-link:hover {
    color: #ff6b35;
}

.back-link svg {
    width: 16px;
    height: 16px;
}

.login-footer {
    margin-top: 28px;
    font-size: 0.82rem;
    color: #94a3b8;
}

.login-footer a {
    color: #ff6b35;
    text-decoration: none;
    font-weight: 600;
}

.login-footer a:hover {
    text-decoration: underline;
}

/* --- Responsive Móvil --- */
@media (max-width: 480px) {
    .auth-card {
        padding: 30px 20px;
        border-radius: 16px;
    }
    .auth-title {
        font-size: 1.35rem;
    }
}
