/* =========================================================
   ZDZAP - LUXURY WIDE FIXED LEFT-SIDEBAR LOGIN SYSTEM
   ========================================================= */

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

:root {
    --bg-dark: #050807;
    --panel-bg: rgba(8, 13, 10, 0.94);
    --panel-border: rgba(34, 197, 94, 0.32);

    --primary-green: #22c55e;
    --primary-green-light: #4ade80;
    --primary-green-dark: #15803d;
    --primary-green-glow: rgba(34, 197, 94, 0.35);

    --input-bg: #101914;
    --input-border: rgba(255, 255, 255, 0.1);
    --input-border-hover: rgba(34, 197, 94, 0.4);
    --input-focus-border: #22c55e;
    --input-focus-ring: rgba(34, 197, 94, 0.25);

    --text-pure: #ffffff;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --text-dim: #64748b;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;

    --transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html, body {
    min-height: 100vh;
    width: 100%;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow-x: hidden;
}

/* =========================================================
   BACKGROUND SHOWCASE (/img/background2.png - SEM BLUR)
   ========================================================= */
.bg-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('/img/background2.png');
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
    opacity: 1;
    filter: none;
    transform: none;
}

.bg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, rgba(5, 8, 7, 0.9) 0%, rgba(5, 8, 7, 0.35) 540px, transparent 75%);
}

/* =========================================================
   MAIN SPLIT-SCREEN LAYOUT WRAPPER
   ========================================================= */
.login-layout-wrapper {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    width: 100%;
    display: flex;
}

/* =========================================================
   FIXED WIDE LEFT-SIDE SOLID BLACK PANEL WITH DYNAMIC GLOW EDGE
   ========================================================= */
.login-left-panel {
    position: relative;
    width: 520px;
    min-width: 480px;
    max-width: 560px;
    min-height: 100vh;
    background: #040705 !important;
    border-top-right-radius: 36px;
    border-bottom-right-radius: 36px;
    border-right: none;
    box-shadow: 25px 0 80px rgba(0, 0, 0, 0.98), 10px 0 40px rgba(34, 197, 94, 0.15);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 44px 50px;
    overflow-y: auto;
    z-index: 10;
}

/* Ultra-Thin Modern Glowing Hairline (1px Fino & Tecnológico) */
.login-left-panel::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 1px;
    height: 100%;
    border-top-right-radius: 36px;
    border-bottom-right-radius: 36px;
    background: linear-gradient(180deg, 
        transparent 0%, 
        rgba(34, 197, 94, 0.1) 10%, 
        rgba(74, 222, 128, 0.6) 35%, 
        #22c55e 50%, 
        rgba(74, 222, 128, 0.6) 65%, 
        rgba(34, 197, 94, 0.1) 90%, 
        transparent 100%
    );
    box-shadow: 
        0 0 8px rgba(34, 197, 94, 0.45),
        0 0 18px rgba(34, 197, 94, 0.2);
    pointer-events: none;
    animation: pulseEdgeGlow 3s ease-in-out infinite alternate;
}

@keyframes pulseEdgeGlow {
    0% {
        opacity: 0.65;
        box-shadow: 0 0 6px rgba(34, 197, 94, 0.35), 0 0 12px rgba(34, 197, 94, 0.15);
    }
    100% {
        opacity: 1;
        box-shadow: 0 0 12px rgba(34, 197, 94, 0.7), 0 0 24px rgba(34, 197, 94, 0.3);
    }
}

.panel-inner-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 22px;
    margin: auto 0;
}

/* Brand Header */
/* Brand Header (Centralizado) */
.panel-brand-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
    margin-bottom: 4px;
}

.brand-logo-box {
    width: 84px;
    height: 84px;
    border-radius: 22px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
    border: 1px solid rgba(34, 197, 94, 0.4);
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.8), 0 0 25px rgba(34, 197, 94, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.18);
    transition: var(--transition);
    margin: 0 auto;
}

.brand-logo-box:hover {
    transform: translateY(-2px) scale(1.05);
    border-color: rgba(34, 197, 94, 0.65);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.9), 0 0 35px rgba(34, 197, 94, 0.5);
}

.brand-logo {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.8)) drop-shadow(0 0 16px rgba(34, 197, 94, 0.45));
}

.brand-text-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    width: 100%;
}

.brand-badge-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 4px 14px;
    border-radius: 50px;
    background: rgba(34, 197, 94, 0.14);
    border: 1px solid rgba(34, 197, 94, 0.35);
    color: #4ade80;
    font-size: 0.70rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    margin: 0 auto;
}

.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 8px #22c55e;
}

.panel-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.95rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.02em;
    line-height: 1.15;
    text-align: center;
}

.panel-subtitle {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.5;
    text-align: center;
    max-width: 390px;
    margin: 0 auto;
}

/* =========================================================
   ALERTS (DYNAMIC)
   ========================================================= */
.alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.84rem;
    font-weight: 500;
}

.alert-error {
    background: rgba(239, 68, 68, 0.16);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5;
}

.alert-success {
    background: rgba(34, 197, 94, 0.16);
    border: 1px solid rgba(34, 197, 94, 0.4);
    color: #86efac;
}

/* =========================================================
   FORM & WIDE INPUTS
   ========================================================= */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

.input-label {
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-main);
    letter-spacing: 0.01em;
}

.label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.input-container {
    position: relative;
    display: flex;
    align-items: center;
    border-radius: var(--radius-md);
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    height: 50px;
    transition: var(--transition);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.05);
}

.input-container:hover {
    border-color: var(--input-border-hover);
    background: #14201a;
}

.input-container:focus-within {
    border-color: var(--input-focus-border);
    box-shadow: 0 0 0 3px var(--input-focus-ring), 0 0 20px rgba(34, 197, 94, 0.25);
    background: #16241d;
}

.field-icon {
    position: absolute;
    left: 16px;
    color: var(--text-dim);
    font-size: 1.2rem;
    pointer-events: none;
    transition: var(--transition);
}

.input-container:focus-within .field-icon {
    color: var(--primary-green-light);
}

.modern-input {
    width: 100%;
    height: 100%;
    background: transparent;
    border: none;
    padding: 0 46px 0 48px;
    color: var(--text-pure);
    font-family: inherit;
    font-size: 0.94rem;
    font-weight: 500;
    outline: none;
}

.modern-input::placeholder {
    color: var(--text-dim);
    font-weight: 400;
}

/* Autofill Fix */
.modern-input:-webkit-autofill,
.modern-input:-webkit-autofill:hover, 
.modern-input:-webkit-autofill:focus, 
.modern-input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px #101914 inset !important;
    -webkit-text-fill-color: #ffffff !important;
    caret-color: #ffffff !important;
    font-family: inherit !important;
    font-size: 0.94rem !important;
    border-radius: var(--radius-md) !important;
    transition: background-color 5000s ease-in-out 0s;
}

.modern-input:autofill {
    background-color: #101914 !important;
    color: #ffffff !important;
}

/* Toggle Password Button */
.btn-toggle-eye {
    position: absolute;
    right: 12px;
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: var(--transition);
}

.btn-toggle-eye:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

/* =========================================================
   OPTIONS ROW: REMEMBER ME & FORGOT LINK
   ========================================================= */
.form-options-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 2px 0 6px 0;
}

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

.custom-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    transition: var(--transition);
}

.custom-checkbox:hover {
    border-color: rgba(255, 255, 255, 0.3);
}

.custom-checkbox:checked {
    background: var(--primary-green);
    border-color: var(--primary-green);
}

.custom-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 4.5px;
    top: 2px;
    width: 4px;
    height: 7px;
    border: solid #032014;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.forgot-link {
    color: var(--primary-green);
    text-decoration: none;
    font-size: 0.84rem;
    font-weight: 600;
    transition: var(--transition);
}

.forgot-link:hover {
    color: var(--primary-green-light);
    text-decoration: underline;
}

/* =========================================================
   BUTTONS: ENTRAR & REGISTRAR
   ========================================================= */
.form-buttons-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 6px;
}

/* Enter Button (Primary Gradient) */
.btn-enter {
    flex: 1.25;
    height: 50px;
    background: linear-gradient(135deg, #4ade80 0%, #22c55e 60%, #16a34a 100%);
    border: none;
    border-radius: var(--radius-md);
    color: #032014;
    font-family: 'Outfit', sans-serif;
    font-size: 0.98rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 6px 22px -2px rgba(34, 197, 94, 0.55), inset 0 1px 1px rgba(255, 255, 255, 0.4);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.btn-enter:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px -2px rgba(34, 197, 94, 0.75), 0 0 25px rgba(34, 197, 94, 0.4);
    background: linear-gradient(135deg, #6ee7b7 0%, #4ade80 60%, #22c55e 100%);
}

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

.btn-enter i {
    font-size: 1.15rem;
    transition: transform 0.2s ease;
}

.btn-enter:hover i {
    transform: translateX(4px);
}

/* Register Button */
.btn-register {
    flex: 1;
    height: 50px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    transition: var(--transition);
}

.btn-register:hover {
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.4);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.btn-register i {
    color: var(--primary-green);
    font-size: 1.1rem;
}

/* Spinner */
.btn-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(3, 32, 20, 0.3);
    border-radius: 50%;
    border-top-color: #032014;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.btn-enter.loading .btn-text,
.btn-enter.loading i {
    display: none;
}

.btn-enter.loading .btn-spinner {
    display: block;
}

/* =========================================================
   PANEL FOOTER
   ========================================================= */
.panel-footer {
    margin-top: 10px;
    text-align: center;
    font-size: 0.78rem;
    color: var(--text-dim);
}

.panel-footer .footer-highlight {
    color: var(--primary-green);
    font-weight: 600;
}

/* =========================================================
   RIGHT SHOWCASE STAGE
   ========================================================= */
.login-right-stage {
    flex: 1;
    min-height: 100vh;
}

/* =========================================================
   VALIDATION OVERLAY
   ========================================================= */
.validation-overlay {
    position: absolute;
    inset: 0;
    background: rgba(7, 12, 9, 0.96);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 50;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s ease;
    transform: scale(0.98);
}

.validation-overlay.active {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
}

.validation-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 380px;
    padding: 24px;
}

.validation-logo-wrapper {
    position: relative;
    width: 90px;
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.validation-ring {
    position: absolute;
    inset: -6px;
    border: 2.5px solid rgba(34, 197, 94, 0.15);
    border-top-color: #22c55e;
    border-right-color: #4ade80;
    border-radius: 50%;
    animation: spinRing 1s linear infinite;
}

@keyframes spinRing {
    to { transform: rotate(360deg); }
}

.validation-logo-box {
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.val-logo {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 16px rgba(34, 197, 94, 0.5));
    animation: pulseValLogo 2s infinite alternate ease-in-out;
}

@keyframes pulseValLogo {
    0% { transform: scale(0.95); filter: drop-shadow(0 0 10px rgba(34, 197, 94, 0.4)); }
    100% { transform: scale(1.05); filter: drop-shadow(0 0 20px rgba(34, 197, 94, 0.7)); }
}

.validation-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.35rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 6px;
}

.validation-status {
    font-size: 0.88rem;
    color: #94a3b8;
    margin-bottom: 16px;
    min-height: 20px;
}

.validation-bar-container {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 12px;
}

.validation-bar-progress {
    height: 100%;
    width: 20%;
    background: linear-gradient(90deg, #22c55e, #4ade80);
    border-radius: 10px;
    transition: width 0.35s ease, background 0.35s ease;
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.8);
}

.validation-bar-progress.error {
    background: #ef4444;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.8);
    width: 100% !important;
}

.validation-bar-progress.success {
    background: #22c55e;
    width: 100% !important;
}

.btn-retry {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5;
    padding: 7px 18px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-family: inherit;
    transition: var(--transition);
    margin-top: 6px;
}

.btn-retry:hover {
    background: rgba(239, 68, 68, 0.25);
    color: #ffffff;
    transform: translateY(-1px);
}

/* =========================================================
   RESPONSIVE DESIGN
   ========================================================= */
@media (max-width: 960px) {
    .login-layout-wrapper {
        justify-content: center;
        align-items: center;
        padding: 20px;
    }

    .login-left-panel {
        width: 100%;
        max-width: 480px;
        min-width: unset;
        min-height: unset;
        border-radius: 20px;
        border: 1px solid var(--panel-border);
        padding: 36px 32px;
        box-shadow: 0 25px 60px rgba(0, 0, 0, 0.95);
    }

    .login-right-stage {
        display: none;
    }
}

@media (max-width: 480px) {
    .login-left-panel {
        padding: 26px 20px;
    }

    .form-buttons-row {
        flex-direction: column;
        gap: 10px;
    }

    .btn-enter, .btn-register {
        width: 100%;
    }
}
