:root {
  --bg: #09111f;
  --bg-2: #0e182b;
  --panel: rgba(15, 23, 42, 0.82);
  --line: rgba(148, 163, 184, 0.14);
  --line-strong: rgba(148, 163, 184, 0.2);
  --text: #e5eefc;
  --muted: #8d9bb7;
  --muted-2: #6f7c98;
  --accent: #6f63ff;
  --accent-2: #8b7bff;
  --accent-soft: rgba(111, 99, 255, 0.15);
  --danger-soft: rgba(239, 68, 68, 0.14);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.36);
  --radius: 22px;
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html[data-theme="light"] {
  --bg: #eef2fb;
  --bg-2: #e1e8f6;
  --panel: rgba(255, 255, 255, 0.88);
  --line: rgba(15, 23, 42, 0.08);
  --line-strong: rgba(15, 23, 42, 0.14);
  --text: #0f172a;
  --muted: #475569;
  --muted-2: #64748b;
  --accent: #5b4eff;
  --accent-2: #766cff;
  --accent-soft: rgba(91, 78, 255, 0.12);
  --shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; margin: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  background:
    radial-gradient(circle at top left, rgba(111, 99, 255, 0.22), transparent 30%),
    radial-gradient(circle at bottom right, rgba(34, 197, 94, 0.1), transparent 22%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  color: var(--text);
}

button, input { font: inherit; }
button { cursor: pointer; }

.icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.login-card {
  width: min(480px, 100%);
  padding: 28px;
}

.landing-card { width: min(440px, 100%); }

.login-card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.login-theme-toggle {
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 8px 11px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(148, 163, 184, 0.06);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.login-theme-toggle:hover {
  border-color: rgba(111, 99, 255, 0.45);
  background: var(--accent-soft);
}

.login-card h1 {
  margin: 14px 0 0;
  font-size: 32px;
  letter-spacing: -0.04em;
}

.login-card p { margin: 10px 0 0; color: var(--muted); }

.login-badge {
  display: inline-flex;
  align-items: center;
  padding: 9px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-2);
  font-size: 13px;
  font-weight: 700;
}

.login-form { display: grid; gap: 14px; margin-top: 20px; }
.landing-help { font-size: 13px; text-align: center; }

.login-error {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--danger-soft);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #ffb8b8;
}

html[data-theme="light"] .login-error { color: #991b1b; }

.field { display: grid; gap: 8px; }

.field-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.required { color: #ff8c8c; margin-left: 3px; }

.input {
  width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  padding: 12px 14px;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

html[data-theme="light"] .input { background: rgba(255, 255, 255, 0.78); }

.input:focus {
  border-color: rgba(111, 99, 255, 0.65);
  box-shadow: 0 0 0 4px rgba(111, 99, 255, 0.14);
}

.input::placeholder { color: var(--muted-2); }

.button {
  border: none;
  border-radius: 16px;
  padding: 12px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease, opacity 140ms ease;
}

.button:hover { transform: translateY(-1px); }

.button-primary {
  color: white;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 14px 28px rgba(111, 99, 255, 0.28);
}

@media (max-width: 640px) {
  .login-screen {
    height: 100dvh;
    min-height: 0;
    overflow-y: auto;
    place-items: start center;
    padding: max(16px, env(safe-area-inset-top, 0px)) 16px max(16px, env(safe-area-inset-bottom, 0px));
    overscroll-behavior: contain;
  }

  .login-card { padding: 22px; }
}
