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

:root {
  --bg:      #0d0f14;
  --card:    #13161e;
  --border:  #ffffff12;
  --accent:  #6c63ff;
  --accent2: #00d4ff;
  --text:    #e8eaf0;
  --muted:   #8890a4;
  --error:   #ff4d4d;
  --radius:  14px;
  --font:    'Segoe UI', system-ui, sans-serif;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── LAYOUT ── */
.login-page {
  position: relative;
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow: hidden;
}

.login-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 36px 36px;
  box-shadow: 0 32px 80px rgba(0,0,0,.5);
}

/* ── BRAND ── */
.login-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 28px;
}

.brand-hex  { font-size: 1.8rem; color: var(--accent); line-height: 1; }
.brand-name { font-size: 1.2rem; font-weight: 800; letter-spacing: -.3px; }
.brand-tag  {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(108,99,255,.15);
  border: 1px solid rgba(108,99,255,.3);
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 2px;
}

/* ── HEADINGS ── */
.login-title {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -.02em;
  margin-bottom: 8px;
}

.login-sub {
  color: var(--muted);
  font-size: .92rem;
  margin-bottom: 28px;
}

/* ── ALERT ── */
.alert {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: .9rem;
  margin-bottom: 20px;
}

.alert-error {
  background: rgba(255,77,77,.1);
  border: 1px solid rgba(255,77,77,.35);
  color: #ff7070;
}
.alert-icon { font-size: 1rem; }

/* ── FORM ── */
.login-form { display: flex; flex-direction: column; gap: 20px; }

.field { display: flex; flex-direction: column; gap: 6px; }

.field-label {
  font-size: .85rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.field-wrap { position: relative; }

.field-input {
  width: 100%;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 1rem;
  font-family: var(--font);
  padding: 12px 44px 12px 16px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}

.field-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(108,99,255,.2);
}

.field-input--error { border-color: var(--error); }
.field-input--error:focus { box-shadow: 0 0 0 3px rgba(255,77,77,.2); }

.toggle-pw {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  transition: color .2s;
}
.toggle-pw:hover { color: var(--text); }

/* ── SUBMIT ── */
.btn-submit {
  width: 100%;
  padding: 14px;
  background: var(--accent);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--font);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 24px rgba(108,99,255,.4);
  transition: background .2s, transform .15s, box-shadow .15s;
  margin-top: 4px;
}
.btn-submit:hover:not(:disabled) {
  background: #5952e0;
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(108,99,255,.5);
}
.btn-submit:disabled { opacity: .7; cursor: not-allowed; transform: none; }

.btn-spinner svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── FOOTER ── */
.login-footer { margin-top: 24px; text-align: center; }
.back-link {
  color: var(--muted);
  font-size: .88rem;
  text-decoration: none;
  transition: color .2s;
}
.back-link:hover { color: var(--text); }

/* ── BG GLOW ── */
.login-bg { position: fixed; inset: 0; pointer-events: none; z-index: 0; }

.glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: .25;
}
.glow-1 {
  width: 500px;
  height: 500px;
  background: var(--accent);
  top: -150px;
  right: -100px;
}
.glow-2 {
  width: 400px;
  height: 400px;
  background: var(--accent2);
  bottom: -120px;
  left: -80px;
}

/* ── RESPONSIVE ── */
@media (max-width: 480px) {
  .login-card { padding: 32px 24px 28px; }
}
