* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
}

:root {
    --primary-blue: #0891b2;
    --border-color: #e2e8f0;
    --text-muted: #64748b;
    --text-main: #111827;
    --bg-main: #edf2f7;
}

body {
    min-height: 100vh;
    background: var(--bg-main);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

/* ==================== HEADER ==================== */
.auth-header {
    position: absolute;
    top: 20px;
    right: 0;
    width: 100%;
    z-index: 100;
    display: flex;
    justify-content: flex-end;
    padding: 0 30px;
}

.auth-header-inner {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    width: 100%;
    max-width: 1300px;
}

/* Selector de idioma - Siempre a la derecha */
.lang-switch {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 8px 16px;
    border-radius: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.lang-switch a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    opacity: 0.6;
    transition: all 0.3s ease;
    padding: 4px 8px;
    border-radius: 20px;
}

.lang-switch a.active,
.lang-switch a:hover {
    opacity: 1;
    font-weight: 600;
    color: var(--primary-blue);
    background: rgba(30, 64, 175, 0.08);
}

.lang-switch .divider {
    color: var(--border-color);
    font-weight: 300;
}

/* ==================== MAIN ==================== */
.auth-main {
    height: 100%;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* ==================== LOGIN CONTAINER ==================== */
.login-container {
    width: 100%;
    max-width: 1300px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ==================== TARJETA PRINCIPAL ==================== */
.login-card {
    width: 100%;
    max-width: 1100px;
    display: grid;
    grid-template-columns: 1fr 450px;
    background: white;
    border-radius: 28px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .15);
    overflow: hidden;
    height: clamp(500px, 85vh, 750px);
    align-items: stretch;
}

/* ==================== PANEL IZQUIERDO ==================== */
.login-left {
    position: relative;
    background: linear-gradient(135deg, #0891b2, #06b6d4);
    border-top-left-radius: 28px;
    border-bottom-left-radius: 28px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.left-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
            rgba(8, 145, 178, 0.4) 0%,
            rgba(104, 216, 236, 0.85) 100%);
    z-index: 2;
}

.left-content {
    position: relative;
    z-index: 2;
    color: white;
    padding: 50px;
    max-width: 100%;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.left-content .badge {
    display: inline-block;
    padding: 6px 16px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-bottom: 20px;
    backdrop-filter: blur(4px);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.left-image-container {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    z-index: 1;
}

.left-illustration {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    filter: none;
}

.left-content h1 {
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin-bottom: 12px;
}

.left-content p {
    opacity: 0.9;
    font-size: 0.95rem;
    line-height: 1.6;
    max-width: 400px;
}

/* ==================== PANEL DERECHO ==================== */
.login-right {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 40px 50px;
    position: relative;
    overflow-y: auto;
    height: 100%;
    border-top-right-radius: 28px;
    border-bottom-right-radius: 28px;
    background: white;
}

.login-right::-webkit-scrollbar {
    width: 6px;
}

.login-right::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 6px;
}

.login-right::-webkit-scrollbar-track {
    background-color: white;
}

/* ==================== SECCIÓN DEL LOGO ==================== */
.login-brand-section {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f1f5f9;
}

.brand-logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    width: 45px;
    height: 45px;
    object-fit: contain;
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.2;
}

.brand-title span {
    color: var(--primary-blue);
}

.brand-subtitle {
    font-size: 0.6rem;
    color: var(--text-muted);
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 600;
}

/* ==================== HEADER DEL FORMULARIO ==================== */
.form-header {
    margin-bottom: 25px;
}

.form-header h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 4px;
}

.form-header p {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.5;
}

/* ==================== GRUPOS DE FORMULARIO ==================== */
.form-group {
    position: relative;
    margin-bottom: 25px;
}

/* ESTILOS DEL INPUT */
.form-control {
    width: 100%;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: #f8fafc;
    color: var(--text-main);
    outline: none;
    transition: all 0.2s ease;
    font-size: 0.95rem;
    height: 52px;
}

.form-control:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 4px rgba(3, 145, 178, 0.08);
}

/* ETIQUETA FLOTANTE */
.form-group label {
    position: absolute;
    top: 50%;
    left: 16px;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    transition: all 0.2s ease;
    background: transparent;
    padding: 0 4px;
    font-size: 0.9rem;
    z-index: 5;
}

.form-control:focus+label,
.form-control:not(:placeholder-shown)+label {
    top: -8px;
    background: white;
    padding: 0 6px;
    font-size: 0.7rem;
    color: var(--primary-blue);
    font-weight: 600;
}

/* ESTADO DE ERROR */
.form-control.is-invalid {
    border-color: #ef4444;
}

.form-control.is-invalid:focus {
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.08);
}

/* Ajustes de label para el estado inválido flotante */
.form-control.is-invalid+label {
    color: #ef4444;
}

.form-control.is-invalid:focus+label,
.form-control.is-invalid:not(:placeholder-shown)+label {
    color: #ef4444;
    background: white;
}

.invalid-feedback {
    display: block;
    margin-top: 6px;
    color: #ef4444;
    font-size: 0.75rem;
    font-weight: 500;
}

/* ==================== OPCIONES DE LOGIN ==================== */
.login-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    font-size: 0.85rem;
}

.remember {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--text-muted);
}

.remember input {
    accent-color: var(--primary-blue);
    width: 16px;
    height: 16px;
}

.forgot-link {
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.85rem;
}

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

/* ==================== BOTÓN DE LOGIN ==================== */
.login-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 14px;
    background: var(--primary-blue);
    color: white;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.login-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(8, 145, 178, 0.3);
}

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

/* ==================== RESPONSIVE ==================== */
@media(max-width: 900px) {
    body {
        padding: 20px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        min-height: 100vh;
    }

    .auth-header {
        position: relative;
        top: 0;
        padding: 10px 20px;
        justify-content: flex-end;
        margin-bottom: 20px;
        width: 100%;
        max-width: 480px;
        box-sizing: border-box;
    }

    .auth-main {
        padding: 0;
        width: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .login-container {
        margin-top: 0;
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .login-card {
        grid-template-columns: 1fr;
        max-width: 480px;
        width: 100%;
        height: auto;
        min-height: auto;
        border-radius: 28px;
    }

    .login-left {
        display: block !important;
        height: 200px;
        border-radius: 28px 28px 0 0;
        order: -1;
    }

    .left-content {
        padding: 20px;
    }

    .left-content h1 {
        font-size: 1.5rem;
    }

    .left-content p {
        font-size: 0.85rem;
    }

    .left-content .badge {
        font-size: 0.65rem;
        padding: 4px 12px;
        margin-bottom: 15px;
    }

    .login-right {
        border-radius: 28px;
        padding: 35px 30px;
        height: auto;
        overflow: visible;
    }

    .lang-switch {
        padding: 6px 14px;
    }
}

@media(max-width: 480px) {
    body {
        padding: 15px;
    }

    .login-right {
        padding: 25px 20px;
    }

    .form-header h2 {
        font-size: 1.2rem;
    }

    .login-options {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .brand-title {
        font-size: 1.3rem;
    }

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

    .auth-header {
        padding: 10px 0;
        margin-bottom: 15px;
    }

    .lang-switch {
        padding: 4px 12px;
        gap: 6px;
    }

    .lang-switch a {
        font-size: 0.75rem;
        padding: 2px 6px;
    }

    .login-card {
        border-radius: 20px;
    }
}