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

:root {
  --bg-from: #0f0f14;
  --bg-via: #1a1625;
  --bg-to: #0f0f14;
  --login-chrome-bg: #0f0f14;
  --glass-bg: rgba(255, 255, 255, 0.04);
  --glass-border: rgba(167, 139, 250, 0.15);
  --accent: #a78bfa;
  --accent-glow: rgba(167, 139, 250, 0.3);
  --text-primary: #e5e7eb;
  --text-muted: rgba(229, 231, 235, 0.5);
  --login-card-bg: rgba(255, 255, 255, 0.04);
  --login-input-bg: rgba(255, 255, 255, 0.03);
  --login-input-border: rgba(167, 139, 250, 0.2);
  --login-locale-menu-bg: rgba(20, 18, 35, 0.96);
  --login-locale-option-color: rgba(229, 231, 235, 0.9);
  --login-locale-option-hover-color: #fff;
  --login-footer-bg: rgba(15, 15, 20, 0.9);
  --login-footer-border: rgba(167, 139, 250, 0.1);
  --login-social-color: rgba(229, 231, 235, 0.35);
  --login-legal-color: rgba(229, 231, 235, 0.3);
  --login-legal-separator: rgba(229, 231, 235, 0.15);
  --login-copyright-color: rgba(255, 255, 255, 0.2);
}

html[data-theme="winter"] {
  --bg-from: #e9e4ff;
  --bg-via: #fce7f3;
  --bg-to: #cffafe;
  --login-chrome-bg: #ffffff;
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(56, 86, 175, 0.18);
  --accent: #4f46e5;
  --accent-glow: rgba(124, 58, 237, 0.45);
  --text-primary: #1f2a44;
  --text-muted: rgba(31, 42, 68, 0.6);
  --login-card-bg: rgba(255, 255, 255, 0.85);
  --login-input-bg: rgba(255, 255, 255, 0.85);
  --login-input-border: rgba(79, 70, 229, 0.25);
  --login-locale-menu-bg: rgba(255, 255, 255, 0.98);
  --login-locale-option-color: rgba(31, 42, 68, 0.85);
  --login-locale-option-hover-color: #1f2a44;
  --login-footer-bg: rgba(245, 247, 251, 0.95);
  --login-footer-border: rgba(56, 86, 175, 0.18);
  --login-social-color: rgba(31, 42, 68, 0.55);
  --login-legal-color: rgba(31, 42, 68, 0.6);
  --login-legal-separator: rgba(31, 42, 68, 0.25);
  --login-copyright-color: rgba(31, 42, 68, 0.5);
}

html {
  min-height: 100%;
  background: var(--login-chrome-bg);
}

body { min-height: 100%; }

body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background-color: var(--login-chrome-bg);
  background-image: linear-gradient(135deg, var(--bg-from), var(--bg-via), var(--bg-to));
  background-size: 400% 400%;
  animation: gradientShift 12s ease infinite;
  position: relative;
  overflow-x: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  color: var(--text-primary);
}

body::before {
  content: '';
  position: fixed;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  top: -100px;
  right: -100px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
  bottom: -80px;
  left: -80px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes floatUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Navbar ── */

.login-navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--login-chrome-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(167, 139, 250, 0.1);
  padding: env(safe-area-inset-top, 0px) max(1.5rem, env(safe-area-inset-right, 0px)) 0 max(1.5rem, env(safe-area-inset-left, 0px));
}

.login-navbar__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  height: 56px;
  gap: 1rem;
}

.login-navbar__brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.3px;
  flex-shrink: 0;
  transition: color 0.2s ease;
}

.login-navbar__brand:hover { color: var(--accent); }

.login-navbar__logo {
  width: 22px;
  height: 22px;
  color: var(--accent);
  flex-shrink: 0;
}

.login-navbar__toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 0.25rem;
  margin-left: auto;
}

.login-navbar__links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
}

.login-navbar__link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  transition: color 0.2s ease, background 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.login-navbar__link:hover {
  color: var(--text-primary);
  background: rgba(167, 139, 250, 0.08);
}

.login-navbar__locale-details {
  position: relative;
  display: inline-block;
}

.login-navbar__locale-details > summary {
  list-style: none;
  cursor: pointer;
}

.login-navbar__locale-details > summary::-webkit-details-marker { display: none; }
.login-navbar__locale-details > summary::marker { content: ""; }

.login-navbar__locale-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 180px;
  background: var(--login-locale-menu-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  padding: 6px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.login-navbar__locale-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--login-locale-option-color);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.login-navbar__locale-option:hover {
  background: rgba(167, 139, 250, 0.18);
  color: var(--login-locale-option-hover-color);
}

.login-navbar__locale-option--active {
  color: var(--accent);
  background: rgba(167, 139, 250, 0.12);
}

@media (max-width: 640px) {
  .login-navbar__toggle { display: block; }

  .login-navbar__links {
    display: none;
    position: absolute;
    top: calc(56px + env(safe-area-inset-top, 0px));
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(15, 15, 20, 0.98);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid rgba(167, 139, 250, 0.1);
    padding: 0.5rem 0;
    gap: 0;
  }

  .login-navbar__links--open { display: flex; }

  .login-navbar__link {
    padding: 0.65rem 1.5rem;
    width: 100%;
    border-radius: 0;
  }

  .login-navbar__link--right { margin-left: 0; }
}

@media (min-width: 641px) {
  .login-navbar__link--right { margin-left: auto; }
}

/* ── Main Content ── */

.login-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem max(1.5rem, env(safe-area-inset-right, 0px)) 2rem max(1.5rem, env(safe-area-inset-left, 0px));
  position: relative;
  z-index: 1;
}

/* ── Login Card ── */

.login-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 24px;
  padding: 3rem 2.5rem;
  max-width: 420px;
  width: 100%;
  text-align: center;
  animation: floatUp 0.6s ease-out forwards;
  position: relative;
  z-index: 1;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.login-brand {
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: -0.5px;
  margin-bottom: 0.25rem;
}

.login-divider {
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  margin: 1.25rem auto;
  border-radius: 2px;
}

.login-tagline {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.65;
  max-width: 320px;
  margin: 0 auto;
}

.login-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 2rem;
  padding: 0.8rem 1.75rem;
  width: 100%;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.15), rgba(167, 139, 250, 0.15));
  border: 1px solid rgba(215, 160, 150, 0.3);
  border-radius: 100px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease, transform 0.3s ease, filter 0.3s ease;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(251, 191, 36, 0.05), 0 4px 15px rgba(167, 139, 250, 0.05);
  position: relative;
  overflow: hidden;
}

.login-btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
  box-shadow: none;
}

.login-btn:disabled::before {
  display: none;
}

.login-btn::before {
  content: '';
  position: absolute;
  top: 0; left: -100%; width: 50%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  transform: skewX(-20deg);
  transition: left 0.5s ease;
}

.login-btn:hover::before {
  left: 150%;
}

.login-btn:hover {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.25), rgba(167, 139, 250, 0.25));
  border-color: rgba(251, 191, 36, 0.5);
  transform: translateY(-2px);
  box-shadow: -8px 8px 30px rgba(251, 191, 36, 0.3), 8px 8px 30px rgba(167, 139, 250, 0.3);
  color: #fff;
}

.login-btn:disabled:hover {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.15), rgba(167, 139, 250, 0.15));
  border-color: rgba(215, 160, 150, 0.3);
  transform: none;
  box-shadow: none;
  color: var(--text-primary);
}

.login-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  flex-shrink: 0;
  filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.5));
}

.login-flash {
  margin-top: 1.25rem;
  padding: 0.6rem 1rem;
  border-radius: 12px;
  font-size: 0.82rem;
  line-height: 1.5;
}

.login-flash--notice {
  background: rgba(167, 139, 250, 0.1);
  border: 1px solid rgba(167, 139, 250, 0.2);
  color: var(--accent);
}

.login-flash--alert {
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.2);
  color: #f87171;
}

/* ── Rune Section ── */

.login-rune-section {
  margin-top: 1.25rem;
}

.login-rune-toggle {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
  transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease, transform 0.3s ease, filter 0.3s ease;
  padding: 0.5rem 1.25rem;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  border-radius: 100px;
  margin-bottom: 0.5rem;
}

.login-rune-toggle:hover {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.08);
  box-shadow: inset 0 0 10px rgba(251, 191, 36, 0.1);
  text-shadow: 0 0 8px rgba(251, 191, 36, 0.4);
}

.login-rune-icon {
  width: 18px;
  height: 18px;
  color: #fbbf24;
  filter: drop-shadow(0 0 5px rgba(251, 191, 36, 0.5));
  transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease, transform 0.3s ease, filter 0.3s ease;
}

.login-rune-toggle:hover .login-rune-icon {
  color: #fcd34d;
  filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.8));
  transform: scale(1.1) rotate(15deg);
}

.login-rune-input-group {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.login-rune-input {
  width: 100%;
  padding: 0.8rem 1rem;
  background: rgba(251, 191, 36, 0.06);
  border: 1px solid rgba(251, 191, 36, 0.25);
  border-radius: 12px;
  color: var(--text-primary);
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 1rem;
  letter-spacing: 3px;
  text-align: center;
  text-transform: uppercase;
  outline: none;
  transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease, transform 0.3s ease, filter 0.3s ease;
}

.login-rune-input::placeholder {
  text-transform: none;
  letter-spacing: normal;
  font-family: inherit;
  color: var(--text-muted);
  opacity: 0.5;
}

.login-rune-input:focus {
  background: rgba(251, 191, 36, 0.1);
  border-color: rgba(251, 191, 36, 0.6);
  box-shadow: 0 0 25px rgba(251, 191, 36, 0.2), inset 0 0 10px rgba(251, 191, 36, 0.1);
  transform: scale(1.02);
}

.login-btn--rune {
  margin-top: 0;
  /* Already styled by login-btn with gold-purple background, but let's make it more golden */
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.2), rgba(245, 158, 11, 0.2));
  border-color: rgba(251, 191, 36, 0.4);
}

.login-btn--rune:hover {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.35), rgba(245, 158, 11, 0.35));
  border-color: rgba(251, 191, 36, 0.7);
  box-shadow: 0 8px 30px rgba(251, 191, 36, 0.3), 0 0 15px rgba(245, 158, 11, 0.4);
}

/* ── Form Fields ── */

.login-form {
  margin-top: 1.5rem;
  text-align: left;
}

.login-field {
  margin-bottom: 1rem;
}

.login-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  letter-spacing: 0.3px;
}

.login-input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(167, 139, 250, 0.2);
  border-radius: 12px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.92rem;
  outline: none;
  transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease, transform 0.3s ease, filter 0.3s ease;
}

.login-input::placeholder {
  color: var(--text-muted);
  opacity: 0.5;
}

.login-input:focus {
  background: rgba(167, 139, 250, 0.06);
  border-color: rgba(167, 139, 250, 0.5);
  box-shadow: 0 0 20px rgba(167, 139, 250, 0.15);
}

.login-turnstile {
  position: relative;
  min-height: 74px;
  margin-top: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  overflow: hidden;
}

.login-turnstile:not(.login-turnstile--ready) {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(167, 139, 250, 0.12);
}

.login-turnstile:not(.login-turnstile--ready)::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 20%, rgba(167, 139, 250, 0.14) 50%, transparent 80%);
  transform: translateX(-100%);
  animation: turnstileShimmer 1.6s ease-in-out infinite;
}

.login-turnstile .cf-turnstile {
  position: relative;
  z-index: 1;
}

@keyframes turnstileShimmer {
  to {
    transform: translateX(100%);
  }
}

/* ── Alt Actions (links below form) ── */

.login-alt-action {
  margin-top: 1rem;
  text-align: center;
  font-size: 0.85rem;
}

.login-alt-text {
  color: var(--text-muted);
  margin-right: 0.3rem;
}

.login-alt-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.login-alt-link:hover {
  color: #c4b5fd;
  text-decoration: underline;
}

.login-alt-link--subtle {
  font-weight: 500;
  font-size: 0.82rem;
  opacity: 0.7;
}

.login-alt-link--subtle:hover {
  opacity: 1;
}

.hidden { display: none !important; }

/* ── CLI Authorization ── */

.cli-auth-card {
  align-self: flex-start;
  max-width: 760px;
  text-align: left;
  margin-top: 2rem;
  margin-bottom: 2rem;
}

.cli-auth-card .login-brand,
.cli-auth-card .login-tagline {
  text-align: center;
}

.cli-auth-card--success {
  max-width: 460px;
  text-align: center;
}

.cli-auth-tagline {
  margin-bottom: 1.25rem;
}

.cli-auth-code {
  width: 100%;
  padding: 1rem;
  margin: 0 auto 1rem;
  border-radius: 16px;
  border: 1px solid rgba(167, 139, 250, 0.25);
  background: rgba(255, 255, 255, 0.05);
  color: var(--accent);
  font-family: "SF Mono", "Fira Code", ui-monospace, monospace;
  font-size: clamp(2rem, 8vw, 3rem);
  font-weight: 800;
  letter-spacing: 0.16em;
  text-align: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.cli-auth-meta {
  margin: 0 auto 1.25rem;
  color: var(--text-muted);
  text-align: center;
  font-size: 0.85rem;
  line-height: 1.5;
}

.cli-auth-meta strong {
  color: var(--text-primary);
}

.cli-auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cli-auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: rgba(229, 231, 235, 0.45);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cli-auth-divider::before,
.cli-auth-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: rgba(167, 139, 250, 0.14);
}

.cli-auth-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
}

.cli-auth-toolbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.cli-auth-link-button {
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0.25rem 0.35rem;
  border-radius: 8px;
}

.cli-auth-link-button:hover {
  background: rgba(167, 139, 250, 0.1);
  color: #c4b5fd;
}

.cli-auth-scope-list {
  max-height: min(28rem, 58vh);
  overflow-y: auto;
  padding-right: 0.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.cli-auth-scope-group {
  border: 1px solid rgba(167, 139, 250, 0.14);
  border-radius: 16px;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.035);
}

.cli-auth-scope-group h2 {
  margin: 0 0 0.75rem;
  color: rgba(229, 231, 235, 0.58);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.cli-auth-scope-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem 0.8rem;
}

.cli-auth-scope {
  min-width: 0;
}

.cli-auth-scope-label,
.cli-auth-resource-list label {
  display: flex !important;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  color: var(--text-primary);
  font-size: 0.78rem;
  line-height: 1.35;
  cursor: pointer;
}

.cli-auth-scope-label span,
.cli-auth-resource-list span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cli-auth-scope-label input,
.cli-auth-resource-list input {
  flex-shrink: 0;
  accent-color: #a78bfa;
}

.cli-auth-granular {
  margin: 0.45rem 0 0 1.4rem;
  padding: 0.65rem;
  border-left: 2px solid rgba(167, 139, 250, 0.22);
  color: var(--text-muted);
}

.cli-auth-granular p {
  margin: 0 0 0.5rem;
  font-size: 0.74rem;
  font-weight: 600;
}

.cli-auth-resource-list {
  display: flex;
  max-height: 8rem;
  overflow-y: auto;
  flex-direction: column;
  gap: 0.25rem;
}

.cli-auth-resource-list label {
  padding: 0.35rem 0.45rem;
  border-radius: 8px;
}

.cli-auth-resource-list label:hover {
  background: rgba(255, 255, 255, 0.055);
}

.cli-auth-error {
  margin: 0;
  color: #f87171;
  font-size: 0.78rem;
}

.cli-auth-actions {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.25rem;
}

.cli-auth-action {
  width: auto;
  min-width: 9rem;
  margin-top: 0;
}

.login-btn--secondary {
  background: rgba(255, 255, 255, 0.035);
  border-color: rgba(167, 139, 250, 0.18);
  box-shadow: none;
}

.login-btn--secondary:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(167, 139, 250, 0.35);
  box-shadow: none;
}

.cli-auth-alert {
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 16px;
  padding: 1rem;
  background: rgba(251, 191, 36, 0.08);
  color: #fde68a;
  text-align: center;
}

.cli-auth-alert strong {
  display: block;
  margin-bottom: 0.35rem;
  color: #fbbf24;
}

.cli-auth-alert p {
  margin: 0;
  color: var(--text-primary);
  font-size: 0.9rem;
  line-height: 1.5;
}

.cli-auth-code-form {
  display: flex;
  gap: 0.75rem;
  align-items: stretch;
}

.cli-auth-code-input {
  text-align: center;
  text-transform: uppercase;
  font-family: "SF Mono", "Fira Code", ui-monospace, monospace;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.cli-auth-verify {
  width: auto;
  margin-top: 0;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

.cli-auth-success-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 4rem;
  height: 4rem;
  margin: 0 auto 1.25rem;
  color: #6ee7b7;
  border-radius: 999px;
  border: 1px solid rgba(16, 185, 129, 0.3);
  background: rgba(16, 185, 129, 0.1);
  box-shadow: 0 0 32px rgba(16, 185, 129, 0.16);
}

.cli-auth-success-icon svg {
  width: 2rem;
  height: 2rem;
}

.cli-auth-manage-link {
  margin-top: 1.5rem;
}

@media (max-width: 640px) {
  .cli-auth-card {
    max-width: none;
    padding: 2rem 1.25rem;
  }

  .cli-auth-toolbar,
  .cli-auth-actions,
  .cli-auth-code-form {
    flex-direction: column;
    align-items: stretch;
  }

  .cli-auth-toolbar-actions {
    justify-content: space-between;
  }

  .cli-auth-scope-grid {
    grid-template-columns: 1fr;
  }

  .cli-auth-action,
  .cli-auth-verify {
    width: 100%;
  }
}

/* ── Footer ── */

.login-footer-bar {
  position: relative;
  z-index: 1;
  background: var(--login-footer-bg);
  border-top: 1px solid var(--login-footer-border);
  padding: 2rem max(1.5rem, env(safe-area-inset-right, 0px)) calc(env(safe-area-inset-bottom, 0px) + 1.5rem) max(1.5rem, env(safe-area-inset-left, 0px));
}

.login-footer-bar__inner {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

.login-footer-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.01em;
}

.login-footer-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow:
    0 0 0 1px rgba(167, 139, 250, 0.3),
    0 4px 14px rgba(123, 93, 243, 0.2);
}

.login-footer-family {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: 0.1rem 0.15rem;
  font-size: 0.78rem;
  color: var(--login-legal-color);
  margin-bottom: 1rem;
}

.login-footer-family-link {
  color: inherit;
  text-decoration: none;
  padding: 0.15rem 0.25rem;
  border-radius: 4px;
  transition: color 0.15s ease;
}

.login-footer-family-link:hover {
  color: var(--accent);
  text-decoration: underline;
}

.login-footer-family-sep {
  color: var(--login-legal-separator);
  margin: 0 0.2rem;
}

.login-social-icons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.login-social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--login-social-color);
  transition: color 0.25s ease, transform 0.25s ease;
  text-decoration: none;
}

.login-social-icon:hover {
  color: var(--accent);
  transform: translateY(-2px);
}

.login-support {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.95rem;
  margin-bottom: 1rem;
  border: 1px solid rgba(0, 87, 183, 0.45);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(0, 87, 184, 0.15) 0%, rgba(255, 221, 0, 0.08) 100%);
  color: var(--text-primary);
  font-size: 0.82rem;
}

.login-support-flag {
  font-size: 1.05em;
  line-height: 1;
}

.login-support-text strong {
  color: var(--text-primary);
  margin-right: 0.35rem;
}

.login-support-sub {
  color: var(--login-legal-color);
  font-size: 0.92em;
}

.login-legal-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  font-size: 0.78rem;
}

.login-legal-links a {
  color: var(--login-legal-color);
  text-decoration: none;
  transition: color 0.2s ease;
}

.login-legal-links a:hover {
  color: var(--accent);
  text-decoration: none;
}

.login-legal-separator {
  color: var(--login-legal-separator);
}

.login-copyright {
  font-size: 0.75rem;
  color: var(--login-copyright-color);
  letter-spacing: 0.5px;
}

/* ── Cookie Banner (Login Override) ── */
#cookie-banner {
  position: fixed;
  bottom: 1rem;
  left: 1rem;
  right: 1rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 16px;
  padding: 1.25rem;
  z-index: 50;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  color: var(--text-primary);
}

#cookie-banner.hidden {
  display: none !important;
}

#cookie-banner .text-sm {
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--text-primary);
}

#cookie-banner .flex {
  display: flex;
}

#cookie-banner .shrink-0 {
  flex-shrink: 0;
}

#cookie-banner .justify-end {
  justify-content: flex-end;
}

#cookie-banner .gap-2 {
  gap: 0.5rem;
}

#cookie-banner .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease, transform 0.2s ease, filter 0.2s ease;
  font-family: inherit;
  border: 1px solid transparent;
}

#cookie-banner .btn-primary {
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.2), rgba(139, 92, 246, 0.2));
  border: 1px solid rgba(167, 139, 250, 0.35);
  color: #fff;
}

#cookie-banner .btn-primary:hover {
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.35), rgba(139, 92, 246, 0.35));
}

#cookie-banner .btn-ghost {
  background: transparent;
  color: var(--text-muted);
}

#cookie-banner .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

@media (min-width: 640px) {
  #cookie-banner {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: 500px;
    bottom: 2rem;
  }
}

/* ── Login Toast Notifications ── */

.login-toast-container {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 1rem);
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: calc(100% - 2rem);
  max-width: 28rem;
  pointer-events: none;
}

.login-toast {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1rem;
  border-radius: 100px;
  font-size: 0.875rem;
  font-weight: 500;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  pointer-events: auto;
  animation: loginToastSlideIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  will-change: transform, opacity;
  box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.5);
}

.login-toast--success {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
}

.login-toast--error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.login-toast__icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.login-toast--success .login-toast__icon { color: #10b981; filter: drop-shadow(0 0 6px rgba(16, 185, 129, 0.5)); }
.login-toast--error .login-toast__icon { color: #ef4444; filter: drop-shadow(0 0 6px rgba(239, 68, 68, 0.5)); }

.login-toast__message {
  flex: 1;
  min-width: 0;
}

.login-toast__close {
  background: none;
  border: none;
  color: inherit;
  opacity: 0.5;
  cursor: pointer;
  padding: 0.15rem 0.3rem;
  font-size: 0.75rem;
  border-radius: 50%;
  transition: opacity 0.2s ease, background 0.2s ease;
  flex-shrink: 0;
  font-family: inherit;
}

.login-toast__close:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.1);
}

.login-toast--exiting {
  animation: loginToastSlideOut 0.25s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes loginToastSlideIn {
  from { opacity: 0; transform: translateY(-20px) scale(0.92); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes loginToastSlideOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(-16px) scale(0.9); }
}

/* ── Field Validation States ── */

.login-input--error {
  border-color: rgba(248, 113, 113, 0.5) !important;
  box-shadow: 0 0 15px rgba(248, 113, 113, 0.15) !important;
}

.login-field__error {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.78rem;
  color: #f87171;
  animation: loginFieldErrorIn 0.2s ease;
}

@keyframes loginFieldErrorIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

html[data-ui-effects="reduced"],
html[data-ui-effects="reduced"] * {
  scroll-behavior: auto !important;
}

html[data-ui-effects="reduced"] *,
html[data-ui-effects="reduced"] *::before,
html[data-ui-effects="reduced"] *::after {
  animation: none !important;
  transition: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

html[data-ui-effects="reduced"] .login-rune-icon,
html[data-ui-effects="reduced"] .login-toast__icon {
  filter: none !important;
}
