

/* ================================================
   LOGIN MODERNO - SENSEILAB
   ================================================ */

:root {
    --primary: #e74c3c;
    --primary-dark: #c0392b;
    --primary-light: #ff6b6b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

/* Fondo animado con círculos */
body::before,
body::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    animation: float 15s infinite ease-in-out;
}

body::before {
    width: 400px;
    height: 400px;
    top: -200px;
    left: -200px;
    animation-delay: 0s;
}

body::after {
    width: 300px;
    height: 300px;
    bottom: -150px;
    right: -150px;
    animation-delay: 7s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(30px, -30px) scale(1.1);
    }
    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }
}

.login-container {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 480px;
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-card {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 28px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    overflow: hidden;
    backdrop-filter: blur(20px);
}

.login-header {
    background-color:#ffffff ;
    padding: 20px 20px 0px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.login-header::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 10%, transparent 10%);
    background-size: 20px 20px;
    animation: movePattern 30s linear infinite;
}

@keyframes movePattern {
    0% { transform: translate(0, 0); }
    100% { transform: translate(20px, 20px); }
}

.logo-wrapper {
    position: relative;
    z-index: 1;
    margin-bottom: 1.5rem;
}

.login-logo {
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1.2rem;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.2) inset;
    animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
}

.login-logo img {
    width: 100%;
    height: auto;
    filter: brightness(0) invert(1);
    opacity: 0.95;
}

.login-title {
    position: relative;
    z-index: 1;
    color: #ffffff;
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    letter-spacing: -0.5px;
}

.login-subtitle {
    position: relative;
    z-index: 1;
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    font-weight: 400;
}

.login-body {
    padding: 10px 30px 30px 30px;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.6rem;
    font-size: 0.9rem;
    letter-spacing: 0.3px;
}

.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #95a5a6;
    font-size: 1.15rem;
    transition: all 0.3s ease;
    pointer-events: none;
}

.form-control {
    width: 100%;
    height: 56px;
    padding: 0 1.2rem 0 3.3rem;
    border: 2px solid #e8ecef;
    border-radius: 14px;
    font-size: 1rem;
    background: #f8f9fa;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: #2c3e50;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(231, 76, 60, 0.08);
}

.form-control:focus + .input-icon {
    color: var(--primary);
    transform: translateY(-50%) scale(1.1);
}

.form-control::placeholder {
    color: #bdc3c7;
}

.remember-forgot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 1.8rem 0;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.form-check-input {
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3);
}

.form-check-label {
    color: #6c757d;
    font-size: 0.9rem;
    cursor: pointer;
    user-select: none;
}

.link-forgot {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.link-forgot:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.btn-signin {
    width: 100%;
    height: 56px;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    border: none;
    border-radius: 14px;
    color: white;
    font-size: 1.05rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 8px 20px rgba(231, 76, 60, 0.3),
        0 0 0 0 rgba(231, 76, 60, 0);
    position: relative;
    overflow: hidden;
}

.btn-signin::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.btn-signin:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 12px 28px rgba(231, 76, 60, 0.4),
        0 0 0 4px rgba(231, 76, 60, 0.1);
}

.btn-signin:hover::before {
    left: 100%;
}

.btn-signin:active {
    transform: translateY(0);
}

.btn-signin i {
    margin-right: 0.5rem;
    font-size: 1.1rem;
}

.divider {
    display: flex;
    align-items: center;
    margin: 2rem 0;
    gap: 1rem;
}

.divider-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, transparent, #e0e0e0, transparent);
}

.divider-text {
    color: #95a5a6;
    font-size: 0.85rem;
    font-weight: 500;
}

.footer-links {
    text-align: center;
}

.footer-link {
    color: #7f8c8d;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.footer-link:hover {
    color: var(--primary);
}

.footer-link i {
    margin-right: 0.4rem;
}

/* Animación de carga */
.btn-signin.loading {
    pointer-events: none;
    opacity: 0.8;
}

.btn-signin.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin: -10px 0 0 -10px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Alert */
.alert {
    border-radius: 12px;
    padding: 1rem 1.2rem;
    margin-bottom: 1.5rem;
    border: none;
    animation: slideDown 0.4s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-danger {
    background: linear-gradient(135deg, #fee 0%, #fdd 100%);
    color: #c33;
    box-shadow: 0 4px 12px rgba(204, 51, 51, 0.15);
}

.alert i {
    margin-right: 0.5rem;
}

/* Responsive */
@media (max-width: 576px) {
    .login-header {
        padding: 2.5rem 2rem 2rem;
    }
    
    .login-title {
        font-size: 1.8rem;
    }
    
    .login-body {
        padding: 2rem 1.8rem;
    }
    
    .login-logo {
        width: 85px;
        height: 85px;
    }
    
    .remember-forgot {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}

/* Mejoras visuales adicionales */
.input-wrapper:focus-within .input-icon {
    animation: iconBounce 0.5s ease;
}

@keyframes iconBounce {
    0%, 100% { transform: translateY(-50%) scale(1); }
    50% { transform: translateY(-50%) scale(1.2); }
}

/* ================================================
   TOGGLE PASSWORD - CORRECCIÓN DEFINITIVA
   ================================================ */

/* Clase específica para el toggle (no afecta a .input-icon) */
.toggle-password {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    z-index: 100;
    color: #95a5a6;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    pointer-events: auto; /* Override del .input-icon */
    user-select: none;
}

.toggle-password:hover {
    color: var(--primary);
    transform: translateY(-50%) scale(1.15);
}

.toggle-password:active {
    transform: translateY(-50%) scale(0.95);
}

/* Ajustar padding del input cuando tiene toggle */
.input-wrapper.has-toggle .form-control {
    padding-right: 3.5rem;
}