:root {
  --bg: #040b08;
  --emerald: #2ee59d;
  --emerald-2: #1b8f63;
  --orange: #ff7a30;
  --cream: #fde7d1;
  --text: #e8f5ee;
  --muted: #8ba89a;
  --line: rgba(46, 229, 157, .14);
  --danger: #ff5a6a;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: Inter, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

#fx { position: fixed; inset: 0; z-index: 0; }

.aurora { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.aurora span {
  position: absolute; border-radius: 50%; filter: blur(90px); opacity: .45;
  animation: float 18s ease-in-out infinite alternate;
}
.aurora span:nth-child(1) { width: 560px; height: 560px; background: #0f7a52; top: -160px; left: -120px; }
.aurora span:nth-child(2) { width: 460px; height: 460px; background: #c2501a; bottom: -180px; right: -100px; animation-delay: -6s; opacity: .32; }
.aurora span:nth-child(3) { width: 380px; height: 380px; background: #0c5a5a; top: 40%; left: 45%; animation-delay: -12s; opacity: .3; }
@keyframes float { to { transform: translate(60px, -40px) scale(1.15); } }

.grid-overlay {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse at center, #000 10%, transparent 75%);
  opacity: .35;
}

.login-shell {
  position: relative; z-index: 1; min-height: 100vh;
  display: grid; grid-template-columns: 1.1fr 1fr; align-items: center;
  max-width: 1280px; margin: 0 auto; padding: 40px;
  gap: 40px;
}

.brand-side { padding: 20px 40px; animation: rise .9s cubic-bezier(.2,.8,.2,1) both; }
.emblem-wrap { position: relative; width: 190px; height: 190px; display: grid; place-items: center; margin-bottom: 36px; }
.emblem { width: 150px; height: 150px; position: relative; z-index: 2; filter: drop-shadow(0 0 30px rgba(46,229,157,.35)); animation: hover 5s ease-in-out infinite; }
.emblem-ring { position: absolute; inset: 0; border-radius: 50%; border: 1px solid rgba(46,229,157,.25); }
.emblem-ring.r1 { animation: spin 14s linear infinite; border-top-color: var(--emerald); border-right-color: transparent; }
.emblem-ring.r2 { inset: -18px; border-style: dashed; border-color: rgba(255,122,48,.25); animation: spin 26s linear infinite reverse; }
.emblem-ring.r3 { inset: -40px; border-color: rgba(46,229,157,.08); }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes hover { 50% { transform: translateY(-8px); } }

.brand-title { font-family: Sora, sans-serif; font-size: clamp(40px, 5vw, 64px); font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.brand-title span {
  background: linear-gradient(90deg, var(--emerald), #9df5cf 40%, var(--orange));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  background-size: 200% auto; animation: shine 6s linear infinite;
}
@keyframes shine { to { background-position: 200% center; } }
.brand-sub { margin-top: 20px; color: var(--cream, #fde7d1); font-family: Sora, sans-serif; font-size: 19px; font-weight: 500; letter-spacing: -.01em; line-height: 1.5; max-width: 480px; opacity: .92; }
.brand-stats { list-style: none; display: flex; gap: 34px; margin-top: 40px; }
.brand-stats li { display: flex; flex-direction: column; gap: 4px; }
.brand-stats strong { font-family: Sora, sans-serif; font-size: 30px; color: var(--text); }
.brand-stats span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .12em; }

.form-side { display: flex; flex-direction: column; align-items: center; gap: 18px; animation: rise .9s .15s cubic-bezier(.2,.8,.2,1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } }

.login-card {
  position: relative; width: 100%; max-width: 440px;
  padding: 40px 36px 30px;
  background: linear-gradient(160deg, rgba(18, 38, 30, .78), rgba(8, 18, 14, .86));
  border: 1px solid rgba(46,229,157,.18);
  border-radius: 24px;
  backdrop-filter: blur(22px);
  box-shadow: 0 30px 80px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.05);
  overflow: hidden;
  --mx: 50%; --my: 0%;
}
.card-glow {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(420px circle at var(--mx) var(--my), rgba(46,229,157,.14), transparent 45%);
  transition: opacity .3s;
}
.login-card::before {
  content: ""; position: absolute; inset: -1px; border-radius: 24px; padding: 1px; pointer-events: none;
  background: linear-gradient(130deg, rgba(46,229,157,.7), transparent 35%, transparent 65%, rgba(255,122,48,.6));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}

.card-head { display: flex; align-items: center; gap: 14px; margin-bottom: 30px; position: relative; }
.mini-emblem { width: 48px; height: 48px; }
.card-head h2 { font-family: Sora, sans-serif; font-size: 21px; font-weight: 700; }
.card-head p { color: var(--muted); font-size: 14px; margin-top: 2px; }

.field { position: relative; display: block; margin-bottom: 16px; }
.field input {
  width: 100%; height: 58px; padding: 22px 48px 8px 48px;
  background: rgba(4, 12, 9, .7); color: var(--text);
  border: 1px solid rgba(139,168,154,.2); border-radius: 14px;
  font: 500 15px Inter, sans-serif; outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.field input:focus { border-color: var(--emerald); box-shadow: 0 0 0 4px rgba(46,229,157,.12); background: rgba(4,14,10,.9); }
.field > span {
  position: absolute; left: 48px; top: 19px; color: var(--muted); font-size: 15px; pointer-events: none;
  transition: transform .2s, font-size .2s, color .2s, top .2s;
}
.field input:focus + span, .field input:not(:placeholder-shown) + span { top: 9px; font-size: 11px; color: var(--emerald); letter-spacing: .04em; }
.field > svg { position: absolute; left: 16px; top: 19px; width: 20px; height: 20px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: stroke .2s; }
.field input:focus ~ svg { stroke: var(--emerald); }
.toggle-pass { position: absolute; right: 10px; top: 11px; width: 36px; height: 36px; border: 0; background: transparent; border-radius: 10px; cursor: pointer; display: grid; place-items: center; }
.toggle-pass:hover { background: rgba(46,229,157,.1); }
.toggle-pass svg { width: 19px; height: 19px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.toggle-pass.on svg { stroke: var(--emerald); }

.caps-warning { color: var(--orange); font-size: 12.5px; margin: -6px 0 12px 4px; }
.form-error {
  background: rgba(255,90,106,.1); border: 1px solid rgba(255,90,106,.35); color: #ffb3bb;
  padding: 11px 14px; border-radius: 12px; font-size: 14px; margin-bottom: 14px;
}

.btn-login {
  position: relative; width: 100%; height: 56px; margin-top: 6px;
  border: 0; border-radius: 14px; cursor: pointer; overflow: hidden;
  font: 700 16px Sora, sans-serif; color: #04110b; letter-spacing: .01em;
  background: linear-gradient(110deg, var(--emerald), #1fc985 45%, #ffb36b 100%);
  background-size: 200% 100%;
  box-shadow: 0 12px 30px rgba(46,229,157,.25);
  transition: transform .15s, box-shadow .25s, background-position .6s;
}
.btn-login:hover { background-position: 100% 0; box-shadow: 0 16px 40px rgba(46,229,157,.35); transform: translateY(-1px); }
.btn-login:active { transform: translateY(1px) scale(.99); }
.btn-login .spinner, .btn-login .check { position: absolute; inset: 0; margin: auto; opacity: 0; transition: opacity .2s; }
.btn-login .spinner { width: 24px; height: 24px; border: 3px solid rgba(4,17,11,.25); border-top-color: #04110b; border-radius: 50%; animation: spin .7s linear infinite; }
.btn-login .check { width: 26px; height: 26px; fill: none; stroke: #04110b; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 30; stroke-dashoffset: 30; }
.btn-login.loading .label { opacity: 0; }
.btn-login.loading .spinner { opacity: 1; }
.btn-login.success .label, .btn-login.success .spinner { opacity: 0; }
.btn-login.success .check { opacity: 1; animation: draw .45s .05s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.btn-login .ripple { position: absolute; border-radius: 50%; background: rgba(255,255,255,.5); transform: scale(0); animation: ripple .6s linear; pointer-events: none; }
@keyframes ripple { to { transform: scale(4); opacity: 0; } }

.secure-note { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 20px; color: var(--muted); font-size: 12.5px; }
.secure-note svg { width: 15px; height: 15px; fill: none; stroke: var(--emerald); stroke-width: 2; }
.copyright { color: rgba(139,168,154,.55); font-size: 12px; }

.shake { animation: shake .45s cubic-bezier(.36,.07,.19,.97); }
@keyframes shake { 20%, 60% { transform: translateX(-9px); } 40%, 80% { transform: translateX(9px); } }

body.leaving .login-shell { animation: leave .6s forwards cubic-bezier(.7,0,.3,1); }
@keyframes leave { to { opacity: 0; transform: scale(1.04); filter: blur(6px); } }

@media (max-width: 960px) {
  .login-shell { grid-template-columns: 1fr; padding: 28px 18px; gap: 10px; }
  .brand-side { text-align: center; padding: 10px; }
  .emblem-wrap { margin: 0 auto 24px; width: 130px; height: 130px; }
  .emblem { width: 104px; height: 104px; }
  .brand-sub { margin-inline: auto; font-size: 15px; }
  .brand-stats { justify-content: center; gap: 22px; margin-top: 24px; }
  .brand-stats strong { font-size: 22px; }
  .login-card { padding: 32px 22px 24px; }
}
@media (max-width: 960px) and (max-height: 800px) { .brand-sub, .brand-stats { display: none; } }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
