/* Reset y configuración base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    height: 100vh;
    background: #3c3c3c;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Contenedor principal */
.container {
    display: flex;
    width: 90%;
    max-width: 1200px;
    height: 70vh;
    min-height: 500px;
    background: white;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
}

/* Panel izquierdo - Logo */
.left-panel {
    flex: 1;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.logo-container {
    text-align: center;
    padding: 2rem;
}

.logo-container img {
    max-width: 250px;
    width: 100%;
    height: auto;
    border-radius: 0;
    box-shadow: none;
    transition: none;
}

/* Panel derecho - Formulario */
.right-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3rem 2.5rem;
    background: #ffffff;
    position: relative;
}

/* Ocultar el form de Django por defecto completamente */
.login-form p,
.login-form > p {
    display: none !important;
}

/* Título del formulario */
.form-title {
    color: #333;
    font-size: 1.8rem;
    font-weight: 400;
    margin-bottom: 1rem;
    text-align: center;
    position: relative;
}

.form-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 2px;
    background: #dc143c;
    border-radius: 1px;
}

/* Grupos de formulario */
.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.form-group label {
    display: block;
    color: #666;
    font-weight: 400;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    background: #fafafa;
    transition: all 0.3s ease;
    outline: none;
    color: #333;
}

.form-group input::placeholder {
    color: #bbb;
    font-size: 0.9rem;
}

.form-group input:focus {
    border-color: #dc143c;
    background: white;
    box-shadow: 0 0 0 2px rgba(220, 20, 60, 0.1);
}

/* Botón de login */
.login-button {
    width: 100%;
    padding: 0.8rem 2rem;
    background: #dc143c;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.login-button:hover {
    background: #b8122f;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 20, 60, 0.2);
}

.login-button:active {
    transform: translateY(0);
}

/* Enlace de contraseña olvidada */
.forgot-password {
    text-align: center;
    margin-top: 1rem;
}

.forgot-password a {
    color: #888;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.forgot-password a:hover {
    color: #dc143c;
}

/* Modal de Error Personalizado */
.error-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.error-modal.show {
    opacity: 1;
    visibility: visible;
}

.error-modal-content {
    background: white;
    width: 90%;
    max-width: 400px;
    border-radius: 8px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    text-align: center;
    overflow: hidden;
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.error-modal.show .error-modal-content {
    transform: scale(1);
}

.error-modal-header {
    background: #dc143c;
    color: white;
    padding: 1.5rem 2rem 1rem;
    position: relative;
}

.error-modal-header h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 500;
}

.error-modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.error-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.error-modal-body {
    padding: 2rem;
    color: #333;
}

.error-modal-body p {
    margin: 0 0 2rem 0;
    font-size: 1rem;
    line-height: 1.5;
}

.error-modal-button {
    background: #dc143c;
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.error-modal-button:hover {
    background: #b8122f;
    transform: translateY(-1px);
}

.error-modal-button:active {
    transform: translateY(0);
}

/* Panel de errores original (mantenido para compatibilidad) */
.error-panel {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 10;
    max-width: 300px;
    display: none;
}

.error-message {
    background: #dc143c;
    color: white;
    padding: 0.8rem 1rem;
    border-radius: 4px;
    font-size: 0.9rem;
    box-shadow: 0 2px 8px rgba(220, 20, 60, 0.3);
    animation: slideInError 0.3s ease;
}

.error-message::before {
    content: '⚠️';
    margin-right: 0.5rem;
}

@keyframes slideInError {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.error-message p {
    margin: 0;
    font-weight: 400;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
        width: 95%;
        height: auto;
        min-height: 80vh;
    }
    
    .left-panel {
        flex: none;
        height: 200px;
    }
    
    .logo-container img {
        max-width: 180px;
    }
    
    .right-panel {
        padding: 2rem 1.5rem;
    }
    
    .form-title {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .container {
        margin: 1rem;
        width: calc(100% - 2rem);
    }
    
    .right-panel {
        padding: 1.5rem 1rem;
    }
    
    .form-group input {
        padding: 0.7rem 0.8rem;
    }
    
    .login-button {
        padding: 0.7rem 1.5rem;
        font-size: 0.9rem;
    }
}

/* Animaciones suaves para el formulario */
.login-form {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Estados de carga del botón */
.login-button.loading {
    pointer-events: none;
    opacity: 0.8;
    position: relative;
}

.login-button.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Ajustes específicos para coincidir con la imagen */
.container {
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

.left-panel {
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
}

.right-panel {
    background: #ffffff;
}

/* Estilo específico para los inputs basado en la imagen */
.form-group input {
    border: 1px solid #e0e0e0;
    background: #ffffff;
    font-size: 0.95rem;
}

.form-group input:focus {
    border-color: #dc143c;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(220, 20, 60, 0.08);
}