:root {
  color-scheme: light dark;
  --bg-top: #eef1ff;
  --bg-bottom: #f7f8fb;
  --glass-bg: rgba(255, 255, 255, 0.55);
  --glass-border: rgba(255, 255, 255, 0.6);
  --text: #14161c;
  --text-muted: #6b7280;
  --accent: #e21a1f;
  --accent-hover: #c4141a;
  --field-bg: rgba(255, 255, 255, 0.7);
  --field-border: rgba(20, 22, 28, 0.1);
  --shadow: 0 20px 60px rgba(20, 30, 60, 0.18);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-top: #1b1530;
    --bg-bottom: #0e0f14;
    --glass-bg: rgba(30, 32, 40, 0.55);
    --glass-border: rgba(255, 255, 255, 0.12);
    --text: #f1f2f5;
    --text-muted: #9aa1ab;
    --field-bg: rgba(255, 255, 255, 0.08);
    --field-border: rgba(255, 255, 255, 0.14);
    --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 20% -10%, rgba(226, 26, 31, 0.16), transparent 55%),
    radial-gradient(circle at 90% 10%, rgba(60, 90, 230, 0.18), transparent 50%),
    linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.card {
  width: 100%;
  max-width: 420px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 28px;
  padding: 36px 32px;
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

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

.brand-icon {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #ff5b52, var(--accent));
  box-shadow: 0 10px 24px rgba(226, 26, 31, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.brand-icon svg { width: 32px; height: 32px; }

.brand h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand p {
  margin: 0;
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
}

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

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

.field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  padding-left: 4px;
}

.field input {
  font-size: 16px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--field-border);
  background: var(--field-bg);
  color: var(--text);
  backdrop-filter: blur(6px);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input::placeholder { color: var(--text-muted); opacity: 0.7; }

.field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(226, 26, 31, 0.15);
}

.hint {
  font-size: 12px;
  color: var(--text-muted);
  padding-left: 4px;
  margin: -8px 0 0;
}

button.primary {
  margin-top: 6px;
  padding: 15px 20px;
  border: none;
  border-radius: 18px;
  font-size: 16px;
  font-weight: 600;
  color: white;
  background: linear-gradient(160deg, #ff5b52, var(--accent));
  box-shadow: 0 12px 28px rgba(226, 26, 31, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
}

button.primary:hover { transform: translateY(-1px); box-shadow: 0 16px 34px rgba(226, 26, 31, 0.4); }
button.primary:active { transform: translateY(0); }
button.primary:disabled { opacity: 0.55; cursor: default; transform: none; }

.error {
  display: none;
  font-size: 13px;
  color: var(--accent);
  background: rgba(226, 26, 31, 0.1);
  border-radius: 12px;
  padding: 10px 14px;
}
.error.visible { display: block; }

.success {
  display: none;
  text-align: center;
  gap: 10px;
}
.success.visible { display: flex; flex-direction: column; align-items: center; }

.success-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(41, 163, 74, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}
.success-icon svg { width: 28px; height: 28px; }

.footer-link {
  margin-top: 24px;
  text-align: center;
  font-size: 13px;
}

.footer-link a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}
.footer-link a:hover { text-decoration: underline; }

.pill-toggle {
  display: flex;
  background: var(--field-bg);
  border: 1px solid var(--field-border);
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 24px;
}

.pill-toggle a {
  flex: 1;
  text-align: center;
  padding: 9px 0;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  color: var(--text-muted);
  transition: background 0.15s ease, color 0.15s ease;
}

.pill-toggle a.active {
  background: linear-gradient(160deg, #ff5b52, var(--accent));
  color: white;
  box-shadow: 0 6px 14px rgba(226, 26, 31, 0.3);
}
