/* ============================================
   LOGIN - PANTALLA DE AUTENTICACIÓN
   ============================================ */

.login-body {
    background: linear-gradient(135deg, #f6f2ef 0%, #ebe5e0 100%);
    min-height: 100vh;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    max-width: 1000px;
    width: 100%;
    background: white;
    border-radius: 25px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    min-height: 600px;
}

/* === LADO IZQUIERDO - BRANDING === */
.login-brand {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 50px 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.login-brand::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

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

.brand-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.brand-logo {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.3);
    background: white;
    padding: 8px;
    margin-bottom: 20px;
}

.brand-content h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 5px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.brand-content>p {
    font-size: 1rem;
    opacity: 0.9;
    margin: 0 0 40px;
}

.brand-features {
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.brand-features .feature {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.brand-features .feature:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(5px);
}

.brand-features .feature i {
    font-size: 1.2rem;
    width: 25px;
}

/* === LADO DERECHO - FORMULARIO === */
.login-form-container {
    padding: 50px 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-form-wrapper {
    width: 100%;
    max-width: 380px;
}

.form-header {
    text-align: center;
    margin-bottom: 30px;
}

.form-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4f46e5, #06b6d4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.3);
}

.form-icon.setup-icon {
    background: linear-gradient(135deg, #10b981, #059669);
}

.avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.form-header h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 5px;
}

.form-header p {
    color: #64748b;
    margin: 0;
    font-size: 0.95rem;
}

/* === PIN DISPLAY === */
.pin-display {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 25px 0;
}

.pin-dot {
    width: 50px;
    height: 50px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    background: white;
    position: relative;
}

.pin-dot.filled {
    border-color: #4f46e5;
    background: #4f46e5;
    transform: scale(1.05);
}

.pin-dot.filled::after {
    content: '•';
    color: white;
    font-size: 1.8rem;
    line-height: 1;
    margin-top: -8px;
}

.pin-dot.error {
    border-color: #ef4444;
    background: #fee2e2;
    animation: shake 0.4s ease;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

/* === PIN PAD (TECLADO) === */
.pin-pad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 20px 0;
}

.pin-key {
    height: 65px;
    border: 2px solid #e2e8f0;
    border-radius: 15px;
    background: white;
    color: #1e293b;
    font-size: 1.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
}

.pin-key:hover:not(.pin-key-blank):not(.pin-key-delete) {
    background: #4f46e5;
    color: white;
    border-color: #4f46e5;
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(79, 70, 229, 0.3);
}

.pin-key:active:not(.pin-key-blank) {
    transform: scale(0.95);
}

.pin-key-blank {
    background: transparent;
    border: none;
    cursor: default;
}

.pin-key-delete {
    color: #ef4444;
}

.pin-key-delete:hover {
    background: #ef4444 !important;
    color: white !important;
    border-color: #ef4444 !important;
}

/* === BOTONES === */
.btn-primary-custom {
    background: linear-gradient(135deg, #4f46e5, #06b6d4);
    border: none;
    border-radius: 12px;
    padding: 14px;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.btn-primary-custom:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.3);
    color: white;
}

.btn-primary-custom:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.forgot-pin {
    color: #64748b;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.forgot-pin:hover {
    color: #4f46e5;
}

/* === ALERTAS === */
.alert {
    border-radius: 12px;
    padding: 12px 18px;
    font-size: 0.9rem;
    border: none;
    margin-bottom: 20px;
}

.alert-danger {
    background: #fee2e2;
    color: #991b1b;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
}

.alert i {
    margin-right: 5px;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .login-container {
        grid-template-columns: 1fr;
        max-width: 450px;
    }

    .login-brand {
        display: none;
        /* Ocultar en móvil */
    }

    .login-form-container {
        padding: 30px 25px;
    }

    .pin-key {
        height: 55px;
        font-size: 1.3rem;
    }

    .pin-dot {
        width: 42px;
        height: 42px;
    }
}

@media (min-width: 768px) and (max-width: 1024px) {

    /* Tablet */
    .login-container {
        max-width: 90%;
    }

    .login-brand {
        padding: 40px 30px;
    }

    .brand-content h1 {
        font-size: 2rem;
    }

    .brand-logo {
        width: 70px;
        height: 70px;
    }
}