@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Fraunces:opsz,wght@9..144,500;9..144,600&display=swap");

:root {
  --bg: #0b0e14;
  --bg-elev: #12151f;
  --bg-card: #161a26;
  --border: #262b3a;
  --text: #eef0f6;
  --text-muted: #9aa1b4;
  --accent: #6ea8fe;
  --accent-strong: #4f8bf0;
  --danger: #ff6b6b;
  --focus-ring: rgba(110, 168, 254, 0.45);
  --shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.6);
  --radius: 14px;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-serif: "Fraunces", Georgia, serif;
}

:root[data-theme="light"] {
  --bg: #f4f5f9;
  --bg-elev: #ffffff;
  --bg-card: #ffffff;
  --border: #e2e4ec;
  --text: #171923;
  --text-muted: #5b6072;
  --accent: #3468d1;
  --accent-strong: #2c56ac;
  --danger: #c92a2a;
  --focus-ring: rgba(52, 104, 209, 0.35);
  --shadow: 0 24px 60px -24px rgba(30, 40, 70, 0.25);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text);
  background:
    radial-gradient(circle at 20% -10%, rgba(110, 168, 254, 0.16), transparent 45%),
    radial-gradient(circle at 100% 0%, rgba(126, 87, 255, 0.10), transparent 40%),
    var(--bg);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.login-shell {
  width: 100%;
  max-width: 380px;
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px 32px 32px;
  animation: rise 0.5s ease both;
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #7e57ff);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0b0e14;
  font-weight: 700;
  font-family: var(--font-serif);
  font-size: 18px;
  flex-shrink: 0;
}

.brand-name {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 19px;
  letter-spacing: 0.01em;
}

h1 {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 600;
  margin: 0 0 6px;
}

.subtitle {
  color: var(--text-muted);
  font-size: 14px;
  margin: 0 0 28px;
  line-height: 1.5;
}

form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

input {
  font: inherit;
  color: var(--text);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 13px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--focus-ring);
}

button {
  font: inherit;
  font-weight: 600;
  color: #0b0e14;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  border: none;
  border-radius: 10px;
  padding: 12px 16px;
  margin-top: 8px;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.15s ease, box-shadow 0.15s ease;
}

button:hover { filter: brightness(1.05); }
button:active { transform: translateY(1px); }

button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--focus-ring);
}

button:disabled {
  opacity: 0.6;
  cursor: progress;
}

.error {
  display: none;
  color: var(--danger);
  font-size: 13px;
  background: rgba(255, 107, 107, 0.1);
  border: 1px solid rgba(255, 107, 107, 0.35);
  border-radius: 10px;
  padding: 10px 12px;
}

.error.visible { display: block; }

.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 999px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.theme-toggle:hover { color: var(--text); border-color: var(--accent); }

.lang-toggle {
  position: fixed;
  top: 20px;
  left: 20px;
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.lang-toggle button {
  font: inherit;
  font-weight: 500;
  font-size: 12.5px;
  color: var(--text-muted);
  background: transparent;
  border: 0;
  border-radius: 999px;
  padding: 6px 12px;
  margin: 0;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.lang-toggle button:hover { color: var(--text); }

.lang-toggle button[aria-checked="true"] {
  background: var(--accent);
  color: #0b0e14;
}

.footnote {
  margin-top: 24px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}

@media (max-width: 375px) {
  .login-card { padding: 32px 22px 26px; }
  h1 { font-size: 21px; }
}
