/* ═══════════════════════════════════════════════════════
   ENCARGA Login — Tech-Forward Design
   Matching landing aesthetic: Navy, Blue, Green, Glassmorphism
   ═══════════════════════════════════════════════════════ */

:root {
    --navy: #0A1628;
    --navy-light: #0F2035;
    --blue: #1976D2;
    --blue-dark: #0D47A1;
    --blue-light: #E3F2FD;
    --blue-glow: rgba(25, 118, 210, .35);
    --green: #2E7D32;
    --green-accent: #4CAF50;
    --green-glow: rgba(76, 175, 80, .35);
    --white: #FFFFFF;
    --gray-400: #94A3B8;
    --gray-500: #64748B;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --radius: 16px;
    --radius-lg: 24px;
    --transition: .35s cubic-bezier(.4, 0, .2, 1);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    background: var(--navy);
    min-height: 100vh;
}

/* ═══════════════════════════════════════════════════════
   LAYOUT — Two Columns
   ═══════════════════════════════════════════════════════ */
.login-wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* ─── LEFT: Form ────────────────────────────────────── */
.login-left {
    flex: 0 0 44%;
    background: linear-gradient(160deg, var(--navy) 0%, var(--navy-light) 60%, #0A2A3C 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 2.5rem;
    position: relative;
    z-index: 2;
}

.login-left::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(25, 118, 210, .05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(25, 118, 210, .05) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridDrift 25s linear infinite;
    pointer-events: none;
}

@keyframes gridDrift {
    0% {
        background-position: 0 0;
    }

    100% {
        background-position: 50px 50px;
    }
}

.login-container {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 420px;
    animation: fadeSlideUp .6s ease-out;
}

@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ─── RIGHT: Visual Showcase ────────────────────────── */
.login-right {
    flex: 0 0 56%;
    background: linear-gradient(160deg, #051020 0%, var(--navy) 40%, #0A2A3C 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    position: relative;
    overflow: hidden;
}

/* Gradient orbs */
.login-right::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    top: -15%;
    right: -10%;
    background: radial-gradient(circle, rgba(25, 118, 210, .18) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(60px);
    animation: orbPulse 7s ease-in-out infinite;
    z-index: 0;
}

.login-right::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    bottom: -15%;
    left: -10%;
    background: radial-gradient(circle, rgba(76, 175, 80, .12) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(60px);
    animation: orbPulse 9s ease-in-out infinite 2s;
    z-index: 0;
}

@keyframes orbPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: .6;
    }

    50% {
        transform: scale(1.15);
        opacity: 1;
    }
}

.right-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 560px;
    animation: fadeSlideLeft .8s ease-out .2s both;
}

@keyframes fadeSlideLeft {
    from {
        opacity: 0;
        transform: translateX(40px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ═══════════════════════════════════════════════════════
   BRAND / LOGO
   ═══════════════════════════════════════════════════════ */
.brand-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.brand-logo-link {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    margin-bottom: 1.5rem;
    transition: var(--transition);
}

.brand-logo-link:hover {
    transform: translateY(-2px);
}

.brand-logo-link img {
    height: 42px;
    width: auto;
    filter: drop-shadow(0 4px 12px rgba(25, 118, 210, .3));
}

.brand-logo-link span {
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--white);
    letter-spacing: .5px;
}

.brand-header h2 {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--white);
    margin: 0 0 .4rem;
}

.brand-header p {
    color: rgba(255, 255, 255, .5);
    font-size: .9rem;
    margin: 0;
}

/* ═══════════════════════════════════════════════════════
   FORM STYLES
   ═══════════════════════════════════════════════════════ */
.login-form-card {
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: var(--radius-lg);
    padding: 2rem;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.input-group-float {
    position: relative;
    margin-bottom: 1.25rem;
}

.form-control-float {
    width: 100%;
    padding: 1rem 1rem 1rem 2.8rem;
    font-size: .9375rem;
    font-family: var(--font);
    background: rgba(255, 255, 255, .07);
    border: 2px solid rgba(255, 255, 255, .12);
    border-radius: 14px;
    color: var(--white);
    transition: var(--transition);
    outline: none;
}

.form-control-float:focus {
    background: rgba(255, 255, 255, .1);
    border-color: var(--blue);
    box-shadow: 0 0 0 4px rgba(25, 118, 210, .15), 0 0 20px rgba(25, 118, 210, .1);
}

.form-control-float::placeholder {
    color: rgba(255, 255, 255, .4);
}

.input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, .4);
    font-size: .95rem;
    transition: var(--transition);
    pointer-events: none;
}

.form-control-float:focus~.input-icon {
    color: var(--blue);
}

.toggle-password {
    position: absolute;
    right: .75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255, 255, 255, .4);
    cursor: pointer;
    padding: .4rem;
    border-radius: 8px;
    transition: var(--transition);
    font-size: .9rem;
}

.toggle-password:hover {
    color: var(--white);
    background: rgba(255, 255, 255, .1);
}

/* Remember me */
.form-extras {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.form-extras label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, .5);
    font-size: .85rem;
    cursor: pointer;
}

.form-extras input[type="checkbox"] {
    accent-color: var(--blue);
    width: 16px;
    height: 16px;
}

.form-extras a {
    color: var(--blue);
    font-size: .85rem;
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.form-extras a:hover {
    color: #64B5F6;
}

/* Login button */
.btn-login {
    width: 100%;
    padding: 1rem;
    font-size: .95rem;
    font-weight: 700;
    font-family: var(--font);
    color: var(--white);
    background: linear-gradient(135deg, var(--green-accent) 0%, var(--green) 100%);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 20px rgba(76, 175, 80, .3);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-login:hover {
    background: linear-gradient(135deg, #66BB6A 0%, var(--green-accent) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 28px rgba(76, 175, 80, .45);
}

.btn-login:active {
    transform: translateY(0);
}

/* Alert */
.alert-custom {
    background: rgba(239, 68, 68, .15);
    border: 1px solid rgba(239, 68, 68, .3);
    border-radius: 14px;
    color: #fca5a5;
    padding: .875rem 1rem;
    margin-top: 1.25rem;
    font-size: .875rem;
    text-align: center;
}

/* Back to landing button */
.btn-back-landing {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, .55);
    text-decoration: none;
    font-size: .88rem;
    font-weight: 500;
    padding: 8px 20px;
    border: 1px solid rgba(255, 255, 255, .15);
    border-radius: 10px;
    transition: var(--transition);
    background: transparent;
}

.btn-back-landing:hover {
    color: var(--white);
    border-color: var(--blue);
    background: rgba(25, 118, 210, .1);
}

/* Footer */
.login-footer {
    text-align: center;
    margin-top: 2rem;
    color: rgba(255, 255, 255, .35);
    font-size: .78rem;
    line-height: 1.6;
}

.login-footer a {
    color: var(--blue);
    text-decoration: none;
    transition: var(--transition);
}

.login-footer a:hover {
    color: #64B5F6;
}

/* ═══════════════════════════════════════════════════════
   RIGHT PANEL — Visual Showcase
   ═══════════════════════════════════════════════════════ */

/* Neural canvas */
.login-neural-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    opacity: .25;
}

.login-neural-bg canvas {
    width: 100%;
    height: 100%;
}

/* Tablet showcase */
.device-showcase {
    position: relative;
    margin-bottom: 2rem;
    display: inline-block;
}

.showcase-tablet {
    width: 100%;
    max-width: 420px;
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 80px rgba(0, 0, 0, .5), 0 0 40px rgba(25, 118, 210, .12);
    animation: deviceFloat 5s ease-in-out infinite;
    border: 1px solid rgba(255, 255, 255, .08);
}

@keyframes deviceFloat {

    0%,
    100% {
        transform: translateY(0) rotate(-2deg);
    }

    50% {
        transform: translateY(-14px) rotate(1deg);
    }
}

/* Floating cards on right panel */
.login-float-card {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(15, 25, 45, .8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 14px;
    padding: 10px 14px;
    color: var(--white);
    animation: cardBob 4s ease-in-out infinite;
    box-shadow: 0 8px 32px rgba(0, 0, 0, .3);
    z-index: 3;
}

.login-float-card small {
    display: block;
    font-size: .7rem;
    opacity: .7;
}

.login-float-card strong {
    font-size: .9rem;
    font-weight: 700;
}

.lfc-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .85rem;
}

.lfc-icon.green {
    background: rgba(76, 175, 80, .25);
    color: var(--green-accent);
}

.lfc-icon.blue {
    background: rgba(25, 118, 210, .25);
    color: #64B5F6;
}

.lfc-icon.purple {
    background: rgba(123, 31, 162, .25);
    color: #CE93D8;
}

.lfc-1 {
    top: 8%;
    left: 2%;
    animation-delay: 0s;
}

.lfc-2 {
    top: 40%;
    right: 0%;
    animation-delay: 1.2s;
}

.lfc-3 {
    bottom: 12%;
    left: 5%;
    animation-delay: 2.4s;
}

@keyframes cardBob {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-12px);
    }
}

/* Robot showcase */
.robot-container {
    position: relative;
    display: inline-block;
    margin-top: 1.5rem;
}

.robot-login {
    width: 140px;
    filter: drop-shadow(0 16px 40px rgba(25, 118, 210, .3));
    animation: robotHover 4s ease-in-out infinite;
}

@keyframes robotHover {

    0%,
    100% {
        transform: translateY(0) rotate(-2deg);
    }

    50% {
        transform: translateY(-12px) rotate(2deg);
    }
}

.robot-shadow-login {
    width: 80px;
    height: 12px;
    background: radial-gradient(ellipse, rgba(25, 118, 210, .2) 0%, transparent 70%);
    border-radius: 50%;
    margin: 8px auto 0;
    animation: shadowBob 4s ease-in-out infinite;
}

@keyframes shadowBob {

    0%,
    100% {
        transform: scaleX(1);
        opacity: .5;
    }

    50% {
        transform: scaleX(.65);
        opacity: .25;
    }
}

/* Right panel text */
.right-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--white);
    margin-bottom: .5rem;
    line-height: 1.3;
}

.right-title .gradient-text {
    background: linear-gradient(135deg, var(--blue) 0%, var(--green-accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.right-desc {
    color: rgba(255, 255, 255, .5);
    font-size: .95rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

/* Feature pills */
.feature-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.feat-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 50px;
    padding: 8px 18px;
    font-size: .82rem;
    font-weight: 500;
    color: rgba(255, 255, 255, .7);
    transition: var(--transition);
}

.feat-pill:hover {
    background: rgba(255, 255, 255, .12);
    color: var(--white);
    transform: translateY(-2px);
}

.feat-pill i {
    color: var(--green-accent);
    font-size: .75rem;
}

/* ═══════════════════════════════════════════════════════
   ROBOT SVG STYLES (same as landing)
   ═══════════════════════════════════════════════════════ */
.robot-head {
    fill: var(--blue);
}

.robot-neck {
    fill: var(--blue-dark);
}

.robot-body {
    fill: var(--blue);
}

.robot-arm {
    fill: var(--blue-dark);
}

.robot-hand {
    fill: var(--blue-dark);
}

.robot-leg {
    fill: var(--blue-dark);
}

.robot-foot {
    fill: var(--navy);
}

.robot-ear {
    fill: var(--blue-dark);
}

.robot-eye {
    fill: var(--blue-dark);
    animation: robotBlink 4s ease-in-out infinite;
}

@keyframes robotBlink {

    0%,
    42%,
    46%,
    100% {
        ry: inherit;
    }

    44% {
        ry: .5;
    }
}

.antenna-tip {
    fill: var(--green-accent);
    animation: antennaPulse 2s ease-in-out infinite;
}

@keyframes antennaPulse {

    0%,
    100% {
        filter: drop-shadow(0 0 4px rgba(76, 175, 80, .5));
    }

    50% {
        filter: drop-shadow(0 0 14px rgba(76, 175, 80, .9));
    }
}

.antenna-pulse {
    fill: none;
    stroke: var(--green-accent);
    stroke-width: 1.5;
    opacity: 0;
    animation: antennaRing 2s ease-out infinite;
}

@keyframes antennaRing {
    0% {
        r: 6;
        opacity: .6;
    }

    100% {
        r: 24;
        opacity: 0;
    }
}

.robot-core {
    fill: var(--green-accent);
    animation: corePulse 2s ease-in-out infinite;
}

@keyframes corePulse {

    0%,
    100% {
        opacity: .7;
        filter: drop-shadow(0 0 6px rgba(76, 175, 80, .3));
    }

    50% {
        opacity: 1;
        filter: drop-shadow(0 0 16px rgba(76, 175, 80, .8));
    }
}

/* ═══════════════════════════════════════════════════════
   PARTICLES (left side)
   ═══════════════════════════════════════════════════════ */
#loginParticles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.login-particle {
    position: absolute;
    border-radius: 50%;
    background: var(--blue);
    opacity: .08;
    animation: particleDrift linear infinite;
}

@keyframes particleDrift {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }

    10% {
        opacity: .08;
    }

    90% {
        opacity: .08;
    }

    100% {
        transform: translateY(-100vh) translateX(30px);
        opacity: 0;
    }
}

/* ═══════════════════════════════════════════════════════
   LOADING OVERLAY (preserved from original)
   ═══════════════════════════════════════════════════════ */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: linear-gradient(160deg, var(--navy) 0%, var(--navy-light) 50%, #0A2A3C 100%);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity .5s ease;
}

.loading-overlay.active {
    display: flex;
    animation: fadeInOverlay .5s ease forwards;
}

@keyframes fadeInOverlay {
    to {
        opacity: 1;
    }
}

.loading-content {
    text-align: center;
    color: white;
    max-width: 500px;
    padding: 2rem;
    animation: scaleIn .6s cubic-bezier(.68, -.55, .265, 1.55) .2s both;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(.5);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.loading-icon {
    width: 160px;
    height: 160px;
    margin: 0 auto 2rem;
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(16px);
    animation: floatLoader 3s ease-in-out infinite;
}

@keyframes floatLoader {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.loading-logo-img {
    width: 100px;
    height: 100px;
    object-fit: contain;
    animation: pulseLogo 2s ease-in-out infinite;
    filter: drop-shadow(0 4px 15px rgba(0, 0, 0, .3));
}

@keyframes pulseLogo {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: .85;
        transform: scale(.95);
    }
}

.loading-title {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: .5rem;
    color: var(--white);
}

.loading-subtitle {
    font-size: 1rem;
    color: rgba(255, 255, 255, .6);
    margin-bottom: 2rem;
}

.progress-container {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    position: relative;
}

.progress-wrapper {
    background: rgba(255, 255, 255, .1);
    border-radius: 50px;
    height: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .08);
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--blue) 0%, var(--green-accent) 100%);
    border-radius: 50px;
    width: 0%;
    transition: width .5s cubic-bezier(.4, 0, .2, 1);
    box-shadow: 0 0 16px rgba(25, 118, 210, .5);
    position: relative;
    overflow: hidden;
}

.progress-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .3), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    to {
        left: 200%;
    }
}

.progress-percentage {
    position: absolute;
    right: -55px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, .12);
    color: white;
    font-weight: 700;
    font-size: .85rem;
    padding: 5px 12px;
    border-radius: 50px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, .15);
    min-width: 48px;
    text-align: center;
}

.progress-text {
    margin-top: 1.25rem;
    font-size: .9rem;
    color: rgba(255, 255, 255, .7);
    font-weight: 500;
}

.loading-particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: -1;
}

.loading-particles .particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, .3);
    border-radius: 50%;
    animation: loadParticle 15s infinite ease-in-out;
}

@keyframes loadParticle {

    0%,
    100% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        transform: translateY(-100vh) translateX(50px);
        opacity: 0;
    }
}

/* ═══════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════ */

/* Tablet landscape */
@media (max-width: 1199px) {
    .login-left {
        flex: 0 0 46%;
        padding: 2.5rem 2rem;
    }

    .login-right {
        flex: 0 0 54%;
    }

    .showcase-tablet {
        max-width: 360px;
    }

    .robot-login {
        width: 120px;
    }
}

/* Tablet portrait */
@media (max-width: 991px) {
    .login-wrapper {
        flex-direction: column;
    }

    .login-left {
        flex: none;
        min-height: 100vh;
        padding: 2rem 1.5rem;
    }

    .login-right {
        display: none;
    }

    .login-container {
        max-width: 400px;
    }

    .brand-header {
        margin-bottom: 2rem;
    }
}

/* Phone */
@media (max-width: 767px) {
    .login-left {
        padding: 1.5rem 1.25rem;
    }

    .login-container {
        max-width: 100%;
    }

    .brand-logo-link img {
        height: 36px;
    }

    .brand-logo-link span {
        font-size: 1.3rem;
    }

    .brand-header h2 {
        font-size: 1.35rem;
    }

    .brand-header p {
        font-size: .85rem;
    }

    .login-form-card {
        padding: 1.5rem;
        border-radius: var(--radius);
    }

    .form-control-float {
        padding: .875rem .875rem .875rem 2.5rem;
        font-size: .9rem;
    }

    .btn-login {
        padding: .875rem;
        font-size: .9rem;
    }

    .login-footer {
        margin-top: 1.5rem;
    }
}

/* Small phone */
@media (max-width: 399px) {
    .login-left {
        padding: 1rem;
    }

    .brand-logo-link img {
        height: 30px;
    }

    .brand-logo-link span {
        font-size: 1.1rem;
    }

    .brand-header h2 {
        font-size: 1.2rem;
    }

    .login-form-card {
        padding: 1.25rem;
    }

    .form-control-float {
        font-size: .85rem;
    }
}

/* Touch-friendly */
@media (pointer: coarse) {
    .form-control-float {
        min-height: 48px;
    }

    .btn-login {
        min-height: 48px;
    }

    .toggle-password {
        min-width: 44px;
        min-height: 44px;
    }
}

/* Landscape phone */
@media (max-height: 500px) and (orientation: landscape) {
    .login-left {
        padding: 1rem 2rem;
    }

    .brand-header {
        margin-bottom: 1rem;
    }

    .login-form-card {
        padding: 1.25rem;
    }

    .input-group-float {
        margin-bottom: .75rem;
    }

    .login-footer {
        margin-top: 1rem;
    }
}