/* ==============================================
   LOGIN NUEVO - DISEÑO MODERNO Y ADAPTATIVO
   ============================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #f9fafb;
    min-height: 100vh;
}

.login-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
}

/* ==============================================
   LADO VISUAL (IZQUIERDO)
   ============================================== */

.login-visual {
    position: relative;
    background: linear-gradient(135deg, #7c3aed 0%, #a78bfa 50%, #ec4899 100%);
    overflow: hidden;
}

.visual-content {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
    background-image: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="40" height="40" patternUnits="userSpaceOnUse"><path d="M 40 0 L 0 0 0 40" fill="none" stroke="rgba(255,255,255,0.05)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
}

.visual-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 30% 50%, rgba(255, 255, 255, 0.1), transparent 60%);
}

.visual-text {
    position: relative;
    z-index: 1;
    text-align: center;
    color: white;
}

.visual-title {
    font-size: clamp(32px, 4vw, 48px);
    font-weight: 900;
    margin-bottom: 16px;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.visual-subtitle {
    font-size: clamp(16px, 2vw, 20px);
    opacity: 0.9;
    line-height: 1.6;
    max-width: 400px;
    margin: 0 auto;
}

/* ==============================================
   LADO FORMULARIO (DERECHO)
   ============================================== */

.login-form-section {
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.form-wrapper {
    width: 100%;
    max-width: 440px;
}

/* Logo */
.login-logo {
    display: flex;
    align-items: center;
    margin-bottom: 48px;
}

.logo-image {
    height: 50px;
    width: auto;
}

/* Header del formulario */
.form-header {
    margin-bottom: 32px;
}

.form-title {
    font-size: 32px;
    font-weight: 800;
    color: #1f2937;
    margin-bottom: 8px;
}

.form-subtitle {
    font-size: 16px;
    color: #6b7280;
}

/* Formulario */
.login-form {
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 16px;
}

.form-input {
    width: 100%;
    padding: 14px 16px 14px 48px;
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    font-size: 15px;
    color: #1f2937;
    transition: all 0.2s ease;
    background: white;
}

.form-input:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.form-input::placeholder {
    color: #9ca3af;
}

.toggle-password {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px;
    transition: color 0.2s ease;
}

.toggle-password:hover {
    color: #7c3aed;
}

/* Opciones del formulario */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    font-size: 14px;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.checkbox-wrapper input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #7c3aed;
}

.checkbox-label {
    color: #6b7280;
}

.forgot-link {
    color: #7c3aed;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.forgot-link:hover {
    color: #6d28d9;
}

/* Botón de submit */
.submit-btn {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, #7c3aed, #a78bfa);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.4);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.5);
}

.submit-btn:active {
    transform: translateY(0);
}

.btn-icon {
    transition: transform 0.3s ease;
}

.submit-btn:hover .btn-icon {
    transform: translateX(4px);
}

/* Spinner de carga */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px 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); }
}

/* Mensaje de error */
.error-message {
    margin-top: 16px;
    padding: 12px 16px;
    background: #fef2f2;
    border: 1px solid #fee2e2;
    border-radius: 8px;
    color: #dc2626;
    font-size: 14px;
    display: none;
}

.error-message:not(:empty) {
    display: block;
}

/* Footer del formulario */
.form-footer {
    text-align: center;
    font-size: 14px;
    color: #6b7280;
}

.signup-link {
    color: #7c3aed;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.signup-link:hover {
    color: #6d28d9;
}

/* ==============================================
   RESPONSIVE - TABLET
   ============================================== */

@media (max-width: 1024px) {
    .login-container {
        grid-template-columns: 1fr;
    }

    .login-visual {
        display: none;
    }

    .login-form-section {
        padding: 60px 40px;
    }
}

/* ==============================================
   RESPONSIVE - MÓVIL
   ============================================== */

@media (max-width: 640px) {
    .login-form-section {
        padding: 40px 24px;
    }

    .form-wrapper {
        max-width: 100%;
    }

    .login-logo {
        margin-bottom: 32px;
    }

    .form-title {
        font-size: 28px;
    }

    .form-subtitle {
        font-size: 14px;
    }

    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}
