@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
    --auth-primary: #4338ca;
    --auth-primary-hover: #3730a3;
    --auth-primary-light: #eef2ff;
    --auth-primary-glow: rgba(67, 56, 202, 0.25);
    
    --auth-text-main: #0f172a;
    --auth-text-muted: #64748b;
    --auth-text-light: #94a3b8;
    
    --auth-border: #e2e8f0;
    --auth-border-focus: #4338ca;
    --auth-bg-input: #ffffff;
    --auth-bg-page: #f8fafc;
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', system-ui, -apple-system, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body.auth-body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: var(--font-body);
    background: var(--auth-bg-page);
    color: var(--auth-text-main);
    -webkit-font-smoothing: antialiased;
}

/* Split Screen Layout Container */
.auth-split-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
    overflow-x: hidden;
}

/* ==========================================================================
   LEFT HERO PANEL (Enterprise Brand & Security - Captura 2)
   ========================================================================== */
.auth-hero-panel {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 44%;
    min-width: 420px;
    max-width: 580px;
    background: linear-gradient(145deg, #1e1b4b 0%, #312e81 35%, #4338ca 75%, #3b82f6 100%);
    color: #ffffff;
    padding: 48px 44px;
    position: relative;
    overflow: hidden;
    box-shadow: 10px 0 35px rgba(0, 0, 0, 0.12);
}

/* Background Ambient Glows & Tech Grid */
.auth-hero-panel::before {
    content: '';
    position: absolute;
    top: -150px;
    right: -150px;
    width: 420px;
    height: 420px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.35) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.auth-hero-panel::after {
    content: '';
    position: absolute;
    bottom: -100px;
    left: -100px;
    width: 380px;
    height: 380px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.25) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.hero-header-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
    z-index: 2;
}

.hero-logo-box {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 800;
    font-family: var(--font-heading);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.hero-brand-meta {
    display: flex;
    flex-direction: column;
}

.hero-brand-title {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #ffffff;
    line-height: 1.1;
}

.hero-brand-tagline {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #a5b4fc;
    margin-top: 2px;
}

/* Center Hero Content */
.hero-body-content {
    margin: 40px 0;
    position: relative;
    z-index: 2;
}

.hero-pill-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #e0e7ff;
    margin-bottom: 22px;
    backdrop-filter: blur(8px);
}

.hero-pill-badge .pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 10px #34d399;
}

.hero-heading {
    font-family: var(--font-heading);
    font-size: 2.15rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.03em;
    margin-bottom: 16px;
    color: #ffffff;
}

.hero-subtext {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #cbd5e1;
    max-width: 440px;
    margin-bottom: 32px;
}

/* Enterprise Security Highlights (Captura 2 Illustration / Security Cards) */
.hero-features-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.hero-feature-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 16px;
    backdrop-filter: blur(12px);
    transition: all 0.25s ease;
}

.hero-feature-item:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.28);
    transform: translateX(4px);
}

.feature-icon-circle {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.16);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #ffffff;
}

.feature-icon-circle svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.feature-text-block {
    display: flex;
    flex-direction: column;
}

.feature-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: #ffffff;
}

.feature-caption {
    font-size: 0.76rem;
    color: #94a3b8;
    margin-top: 1px;
}

/* Bottom Footer in Hero */
.hero-footer-bar {
    position: relative;
    z-index: 2;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.hero-public-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #e0e7ff;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    transition: all 0.2s ease;
}

.hero-public-link:hover {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    transform: translateY(-1px);
}

.hero-version-text {
    font-size: 0.72rem;
    color: #94a3b8;
    font-weight: 500;
}

/* ==========================================================================
   RIGHT FORM PANEL (Clean Corporate Form - Captura 2)
   ========================================================================== */
.auth-form-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 28px;
    background: #ffffff;
    position: relative;
}

.auth-form-card {
    width: 100%;
    max-width: 440px;
    display: flex;
    flex-direction: column;
}

/* Form Header */
.form-header-area {
    margin-bottom: 28px;
}

.form-mobile-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.form-mobile-logo {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--auth-primary);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-family: var(--font-heading);
}

.form-title {
    font-family: var(--font-heading);
    font-size: 1.9rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--auth-text-main);
    margin-bottom: 6px;
}

.form-subtitle {
    font-size: 0.92rem;
    color: var(--auth-text-muted);
}

/* Flash Messages */
.auth-flash-container,
.alert {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.86rem;
    font-weight: 500;
    line-height: 1.4;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-error,
.auth-alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.alert-success,
.auth-alert-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.auth-alert-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 1px;
}

.auth-alert-icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

/* Login Form Fields */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-field-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.form-field-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--auth-text-main);
    letter-spacing: -0.01em;
}

/* Input Wrapper with Left and Right Icons */
.input-control-wrap {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.input-icon-left {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: #94a3b8;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
    z-index: 2;
}

.input-icon-left svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.auth-input {
    width: 100%;
    height: 48px;
    border: 1px solid var(--auth-border);
    border-radius: 12px;
    background: #f8fafc;
    color: var(--auth-text-main);
    font-family: inherit;
    font-size: 0.95rem;
    padding: 0 16px;
    padding-left: 44px;
    padding-right: 46px; /* Space for eye icon */
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
}

.auth-input:hover {
    border-color: #cbd5e1;
    background: #ffffff;
}

.auth-input:focus {
    border-color: var(--auth-primary);
    background: #ffffff;
    box-shadow: 0 0 0 4px var(--auth-primary-glow);
}

.input-control-wrap:focus-within .input-icon-left {
    color: var(--auth-primary);
}

/* Eye Toggle Button ("icono ojo") */
.toggle-password-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border: 0;
    background: transparent;
    color: #94a3b8;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.18s ease;
    padding: 0;
    z-index: 3;
}

.toggle-password-btn:hover {
    color: var(--auth-text-main);
    background: #f1f5f9;
}

.toggle-password-btn:focus-visible {
    outline: 2px solid var(--auth-primary);
    outline-offset: 1px;
}

.toggle-password-btn svg {
    width: 19px;
    height: 19px;
    fill: currentColor;
}

/* Secondary Actions Row */
.form-actions-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: -4px;
}

.remember-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--auth-text-muted);
    cursor: pointer;
    user-select: none;
}

.remember-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 1px solid var(--auth-border);
    accent-color: var(--auth-primary);
    cursor: pointer;
}

.public-portal-link {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--auth-primary);
    text-decoration: none;
    transition: color 0.18s ease;
}

.public-portal-link:hover {
    color: var(--auth-primary-hover);
    text-decoration: underline;
}

/* Submit CTA Button */
.auth-submit-btn {
    width: 100%;
    height: 48px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--auth-primary) 0%, #4f46e5 100%);
    color: #ffffff;
    font-family: inherit;
    font-size: 0.96rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 14px rgba(67, 56, 202, 0.35);
    margin-top: 4px;
}

.auth-submit-btn:hover {
    background: linear-gradient(135deg, var(--auth-primary-hover) 0%, #4338ca 100%);
    box-shadow: 0 6px 20px rgba(67, 56, 202, 0.45);
    transform: translateY(-1px);
}

.auth-submit-btn:active {
    transform: translateY(0);
}

.auth-submit-btn .btn-arrow-icon {
    width: 18px;
    height: 18px;
    fill: currentColor;
    transition: transform 0.2s ease;
}

.auth-submit-btn:hover .btn-arrow-icon {
    transform: translateX(3px);
}

/* Enterprise Security Badge Divider (Captura 2 bottom) */
.form-security-footer {
    margin-top: 36px;
    padding-top: 22px;
    border-top: 1px solid var(--auth-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.security-badge-row {
    display: flex;
    align-items: center;
    gap: 18px;
}

.security-badge-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.73rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.security-badge-item svg {
    width: 14px;
    height: 14px;
    fill: #10b981;
}

.copyright-text {
    font-size: 0.72rem;
    color: #94a3b8;
    text-align: center;
}

/* ==========================================================================
   RESPONSIVE MEDIA QUERIES
   ========================================================================== */
@media (min-width: 960px) {
    .auth-hero-panel {
        display: flex;
    }
    
    .form-mobile-brand {
        display: none;
    }
}

@media (max-width: 959px) {
    .auth-form-panel {
        padding: 32px 20px;
        background: radial-gradient(circle at top right, #e0e7ff 0%, transparent 60%), #f8fafc;
    }

    .auth-form-card {
        background: #ffffff;
        padding: 32px 24px;
        border-radius: 20px;
        border: 1px solid var(--auth-border);
        box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.06);
    }
}
