:root {
    --blue:        #1B72B8;
    --blue-dark:   #0D5A9E;
    --blue-light:  #E8F2FC;
    --orange:      #F7941D;
    --orange-dark: #D97B0A;
    --orange-light:#FEF3E2;
    --dark:        #0f172a;
    --gray:        #64748b;
}

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

body { font-family: 'Inter', sans-serif; min-height: 100vh; overflow-x: hidden; }

/* ===== LEFT PANEL ===== */
.auth-left {
    min-height: 100vh;
    background: linear-gradient(160deg, #0a1e35 0%, #0d3a6e 40%, #1B72B8 80%, #1e8cc9 100%);
    position: relative; overflow: hidden;
    display: flex; flex-direction: column; justify-content: center;
    padding: 3rem;
}

.auth-left::before {
    content: '';
    position: absolute; inset: 0;
    background: url('https://images.unsplash.com/photo-1497366216548-37526070297c?w=900&q=60') center/cover no-repeat;
    opacity: 0.05;
}

.deco { position: absolute; border-radius: 50%; animation: float 7s ease-in-out infinite; }
.deco-1 { width: 320px; height: 320px; background: rgba(247,148,29,0.08); top: -100px; right: -80px; animation-delay: 0s; }
.deco-2 { width: 200px; height: 200px; background: rgba(255,255,255,0.04); bottom: 40px; left: -70px; animation-delay: 2.5s; }
.deco-3 { width: 100px; height: 100px; background: rgba(247,148,29,0.1); top: 38%; right: 8%; animation-delay: 4s; }
.deco-4 { width: 60px; height: 60px; background: rgba(255,255,255,0.06); top: 18%; left: 12%; animation-delay: 1.5s; }

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-18px); }
}

.left-content { position: relative; z-index: 2; }

.brand-wrap {
    display: flex; flex-direction: column;
    align-items: flex-start; gap: 10px; margin-bottom: 2.5rem;
}

.login-logo-left {
    width: auto; height: auto;
    max-width: 100%; max-height: 52px;
    filter: brightness(0) invert(1);
    display: block;
}

.admin-tag-standalone {
    display: inline-block;
    font-size: 0.65rem; font-weight: 700; letter-spacing: 2px;
    color: rgba(255,255,255,0.5); text-transform: uppercase;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    padding: 3px 10px; border-radius: 100px;
}

.hero-headline {
    font-size: 2.55rem; font-weight: 800; color: white;
    line-height: 1.18; letter-spacing: -1px; margin-bottom: 1.1rem;
}

.hero-headline .hl {
    position: relative; display: inline-block;
    color: var(--orange);
}

.hero-sub {
    color: rgba(255,255,255,0.62); font-size: 0.95rem;
    line-height: 1.7; margin-bottom: 2.25rem; max-width: 390px;
}

.pills { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 2.5rem; }

.pill {
    display: flex; align-items: center; gap: 7px;
    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.12);
    color: white; padding: 7px 15px;
    border-radius: 100px; font-size: 0.8rem; font-weight: 500;
}

.pill i { color: var(--orange); }

.stats-row { display: flex; gap: 2.25rem; margin-bottom: 2.5rem; }
.stat-item .num {
    font-size: 1.75rem; font-weight: 800; display: block;
    color: var(--orange);
}
.stat-item .lbl { font-size: 0.74rem; color: rgba(255,255,255,0.5); font-weight: 500; }

.sec-card {
    background: rgba(255,255,255,0.06);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px; padding: 1.15rem 1.4rem;
    display: flex; gap: 14px; align-items: center;
}

.sec-icon {
    width: 46px; height: 46px; border-radius: 12px;
    background: rgba(247,148,29,0.2);
    border: 1px solid rgba(247,148,29,0.3);
    display: flex; align-items: center; justify-content: center;
    color: var(--orange); font-size: 1.2rem; flex-shrink: 0;
}

.sec-title { font-size: 0.88rem; font-weight: 700; color: white; margin-bottom: 2px; }
.sec-desc { font-size: 0.77rem; color: rgba(255,255,255,0.5); line-height: 1.4; }

.sec-note {
    display: flex; align-items: center; gap: 7px;
    margin-top: 1.2rem; font-size: 0.76rem; color: rgba(255,255,255,0.35);
}

/* ===== RIGHT PANEL ===== */
.auth-right {
    min-height: 100vh;
    background: #f0f6fc;
    display: flex; align-items: center; justify-content: center; padding: 2rem;
}

.login-card {
    background: white; border-radius: 24px;
    padding: 2.75rem 2.5rem; width: 100%; max-width: 440px;
    box-shadow: 0 20px 60px rgba(27,114,184,0.14), 0 4px 16px rgba(0,0,0,0.04);
    border-top: 4px solid var(--orange);
}

.admin-badge {
    display: inline-flex; align-items: center; gap: 7px;
    background: var(--orange-light); border: 1px solid rgba(247,148,29,0.3);
    color: var(--orange-dark); font-size: 0.75rem; font-weight: 700;
    padding: 5px 13px; border-radius: 100px; margin-bottom: 1.25rem; letter-spacing: 0.3px;
}

.right-brand { margin-bottom: 1.5rem; }
.login-logo-right {
    width: auto; height: auto;
    max-width: 100%; max-height: 40px;
    display: block;
}

.login-title {
    font-size: 1.7rem; font-weight: 800; color: var(--dark);
    letter-spacing: -0.5px; margin-bottom: 0.35rem;
}

.login-subtitle { color: var(--gray); font-size: 0.875rem; margin-bottom: 0; }
.hr-line { height: 1px; background: #e2e8f0; margin: 1.5rem 0; }

.form-label { font-size: 0.83rem; font-weight: 700; color: #374151; margin-bottom: 0.4rem; }

.input-wrap { position: relative; }

.input-icon {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    font-size: 0.9rem; z-index: 2; pointer-events: none;
    color: var(--blue);
}

.form-ctrl {
    width: 100%; padding: 0.78rem 1rem 0.78rem 2.65rem;
    border: 1.5px solid #e2e8f0; border-radius: 12px;
    font-size: 0.9rem; font-family: 'Inter', sans-serif;
    color: var(--dark); background: #fafbfd; transition: all 0.25s; outline: none;
}

.form-ctrl:focus {
    border-color: var(--blue); background: white;
    box-shadow: 0 0 0 4px rgba(27,114,184,0.1);
}

.form-ctrl.is-invalid { border-color: #ef4444; background: #fff5f5; }

.toggle-pwd {
    position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
    color: #9ca3af; cursor: pointer; font-size: 0.9rem; z-index: 2;
    border: none; background: none; padding: 0; transition: color 0.2s;
}

.toggle-pwd:hover { color: var(--blue); }

.form-options {
    display: flex; align-items: center; justify-content: space-between;
    margin: 1rem 0 1.5rem; font-size: 0.84rem;
}

.form-check-label { color: var(--gray); cursor: pointer; }
.form-check-input:checked { background-color: var(--blue); border-color: var(--blue); }

.forgot-link { color: var(--blue); text-decoration: none; font-weight: 600; font-size: 0.84rem; }
.forgot-link:hover { color: var(--blue-dark); text-decoration: underline; }

.btn-login {
    width: 100%; padding: 0.88rem;
    background: linear-gradient(135deg, var(--blue), #2484d0);
    border: none; border-radius: 12px;
    color: white; font-weight: 700; font-size: 0.95rem;
    font-family: 'Inter', sans-serif; cursor: pointer;
    transition: all 0.3s; position: relative; letter-spacing: 0.2px;
    box-shadow: 0 4px 16px rgba(27,114,184,0.3);
}

.btn-login:hover {
    background: linear-gradient(135deg, var(--blue-dark), var(--blue));
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(27,114,184,0.4);
}

.btn-login:active { transform: translateY(0); }
.btn-login .spinner-border { width: 18px; height: 18px; border-width: 2.5px; }

.btn-login-wrap { position: relative; }
.btn-orange-stripe {
    width: 100%; height: 4px;
    background: linear-gradient(90deg, var(--orange), var(--orange-dark));
    border-radius: 0 0 8px 8px; margin-top: -2px;
}

.alert-err { background:#fef2f2; border:1px solid #fecaca; color:#dc2626; padding:0.75rem 1rem; border-radius:10px; font-size:0.875rem; display:none; align-items:center; gap:8px; margin-bottom:1.25rem; }
.alert-ok  { background:#f0fdf4; border:1px solid #bbf7d0; color:#16a34a; padding:0.75rem 1rem; border-radius:10px; font-size:0.875rem; display:none; align-items:center; gap:8px; margin-bottom:1.25rem; }

.field-err { font-size:0.78rem; color:#ef4444; margin-top:4px; display:none; }

.login-footer-note {
    text-align:center; font-size:0.76rem; color:#94a3b8; margin-top:1.5rem;
}
.login-footer-note a { color: var(--blue); font-weight: 600; text-decoration: none; }
.login-footer-note a:hover { color: var(--orange); }

@media (max-width: 767px) {
    .auth-left { display: none; }
    .auth-right { min-height: 100vh; }
}

@media (max-width: 991px) {
    .auth-left { min-height: auto; padding: 2.5rem 2rem; }
    .hero-headline { font-size: 1.9rem; }
}

/* ===== AI SHOWCASE (only while an AI is connected) ===== */
.lg-ai {
    --ai-a: #6366f1; --ai-c: #F7941D; --ai-d: #22d3ee;
    position: relative; overflow: hidden; isolation: isolate; max-width: 470px; margin-bottom: 2rem;
    border-radius: 20px; padding: 1.25rem 1.3rem 1.2rem; color: #fff;
    background: linear-gradient(135deg, rgba(10, 14, 45, .72), rgba(17, 26, 70, .55));
    backdrop-filter: blur(14px); box-shadow: 0 20px 50px rgba(3, 7, 30, .45);
    animation: lgEnter .8s cubic-bezier(.2, .8, .2, 1) .15s both;
}
@keyframes lgEnter { from { opacity: 0; transform: translateY(16px) scale(.98); } }
.lg-ai::before {   /* animated gradient border */
    content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px; z-index: 2; pointer-events: none;
    background: linear-gradient(90deg, var(--ai-a), var(--ai-d), var(--ai-c), var(--ai-a)); background-size: 300% 100%;
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
    animation: lgFlow 6s linear infinite;
}
@keyframes lgFlow { to { background-position: 300% 0; } }
.lg-aurora { position: absolute; border-radius: 50%; filter: blur(50px); z-index: -1; }
.lg-aurora.a1 { width: 260px; height: 260px; background: var(--ai-a); opacity: .5; top: -130px; left: -70px; animation: lgDrift 13s ease-in-out infinite; }
.lg-aurora.a2 { width: 220px; height: 220px; background: var(--ai-d); opacity: .28; bottom: -140px; right: -40px; animation: lgDrift 16s ease-in-out infinite reverse; }
@keyframes lgDrift { 50% { transform: translate(60px, 30px) scale(1.15); } }
.lg-spark {
    position: absolute; left: var(--x); top: var(--y); width: 3px; height: 3px; border-radius: 50%; background: #fff; z-index: -1;
    box-shadow: 0 0 8px 2px rgba(255,255,255,.55); opacity: 0; animation: lgTwinkle 3.4s ease-in-out var(--d) infinite;
}
@keyframes lgTwinkle { 50% { opacity: .9; transform: scale(1.5); } }

.lg-ai-head { display: flex; align-items: center; gap: 1rem; }
.lg-orb { position: relative; flex-shrink: 0; width: 76px; height: 76px; }
.lg-orb .ring { position: absolute; inset: 0; border-radius: 50%; }
.lg-orb .r1 {
    background: conic-gradient(from 0deg, transparent, var(--ai-d), transparent 35%, var(--ai-a), transparent 70%, var(--ai-c), transparent);
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px));
    mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px));
    animation: lgSpin 6s linear infinite;
}
.lg-orb .r2 { inset: 9px; border: 1px dashed rgba(165, 180, 252, .45); animation: lgSpin 14s linear infinite reverse; }
@keyframes lgSpin { to { transform: rotate(360deg); } }
.lg-orb .core {
    position: absolute; inset: 18px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1rem;
    background: radial-gradient(circle at 35% 30%, #c7d2fe, var(--ai-a) 45%, #312e81);
    box-shadow: 0 0 22px rgba(99,102,241,.8), 0 0 50px rgba(34,211,238,.35); animation: lgGlow 2.8s ease-in-out infinite;
}
@keyframes lgGlow { 50% { box-shadow: 0 0 32px rgba(99,102,241,1), 0 0 70px rgba(34,211,238,.55); transform: scale(1.06); } }

.lg-ai-copy { min-width: 0; }
.lg-live {
    display: inline-flex; align-items: center; gap: 7px; font-size: .7rem; font-weight: 600; padding: 3px 11px 3px 9px; border-radius: 30px;
    background: rgba(34, 211, 238, .1); border: 1px solid rgba(34, 211, 238, .35); color: #a5f3fc;
}
.lg-live .dot { width: 7px; height: 7px; border-radius: 50%; background: #22d3ee; animation: lgPing 1.8s ease-out infinite; }
@keyframes lgPing { 0% { box-shadow: 0 0 0 0 rgba(34,211,238,.7); } 70%, 100% { box-shadow: 0 0 0 8px rgba(34,211,238,0); } }
.lg-ai-title { font-size: 1.25rem; font-weight: 800; letter-spacing: -.4px; margin: .45rem 0 .2rem; line-height: 1.2; color: #fff; }
.lg-shine {
    background: linear-gradient(90deg, #a5b4fc, #67e8f9, #fdba74, #a5b4fc); background-size: 300% 100%;
    -webkit-background-clip: text; background-clip: text; color: transparent; animation: lgFlow 5s linear infinite;
}
.lg-rotator { font-size: .82rem; color: rgba(255,255,255,.72); margin: 0; min-height: 1.3em; }
.lg-rotator #lgRotate { display: inline-block; transition: opacity .35s, transform .35s; }
.lg-rotator #lgRotate.out { opacity: 0; transform: translateY(5px); }
.lg-rotator .caret { display: inline-block; width: 2px; height: .95em; background: #67e8f9; margin-left: 3px; vertical-align: -2px; animation: lgCaret 1s steps(1) infinite; }
@keyframes lgCaret { 50% { opacity: 0; } }

.lg-feats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 1.05rem; }
.lg-feat {
    display: flex; flex-direction: column; gap: 7px; padding: .65rem .7rem; border-radius: 13px;
    background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1);
    transition: transform .2s, border-color .2s, background .2s;
    animation: lgEnter .6s cubic-bezier(.2,.8,.2,1) calc(.55s + var(--i) * .13s) both;
}
.lg-feat:hover { transform: translateY(-3px); background: rgba(255,255,255,.1); border-color: rgba(103,232,249,.4); }
.lg-feat .ic {
    width: 30px; height: 30px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: .78rem;
    background: linear-gradient(135deg, var(--ai-a), #1B72B8); box-shadow: 0 5px 14px rgba(99,102,241,.4);
}
.lg-feat:nth-child(2) .ic { background: linear-gradient(135deg, #0891b2, #1B72B8); }
.lg-feat:nth-child(3) .ic { background: linear-gradient(135deg, var(--ai-c), #db2777); }
.lg-feat strong { display: block; font-size: .76rem; color: #fff; }
.lg-feat small { display: block; font-size: .66rem; color: rgba(255,255,255,.58); line-height: 1.3; }

@media (max-width: 1199px) { .lg-feats { grid-template-columns: minmax(0, 1fr); } .lg-feat { flex-direction: row; align-items: center; } }
@media (prefers-reduced-motion: reduce) {
    .lg-ai, .lg-ai *, .lg-ai::before { animation: none !important; transition: none !important; }
    .lg-spark { opacity: .5; }
}
