:root {
  --bg: #f7f7f5;
  --text: #1f1d1a;
  --muted: #6c675f;
  --card: #ffffff;
  --line: #cfd3dc;
  --accent: #2f46c8;
  --on-accent: #ffffff;
  --warn: #9a5b00;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1218;
    --text: #e9ecf2;
    --muted: #9aa3b5;
    --card: #171b24;
    --line: #333b4d;
    --accent: #8fa2ff;
    --on-accent: #0f1218;
    --warn: #f2b880;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}

.page {
  max-width: 420px;
  margin: 0 auto;
  padding: 2rem 1.25rem;
}

h1 {
  margin: 0 0 1.25rem;
  font-size: 1.6rem;
}

.form {
  padding: 1.25rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.label {
  display: block;
  margin: 0 0 0.35rem;
  font-size: 0.92rem;
  font-weight: 600;
}

.input {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

.input:focus-visible,
.toggle:focus-visible,
.submit:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

#email {
  margin-bottom: 1rem;
}

/* The button sits inside the field, so the input needs room on the right for it. */
.field {
  position: relative;
}

.field .input {
  padding-right: 7.5rem;
}

.toggle {
  position: absolute;
  top: 50%;
  right: 0.35rem;
  transform: translateY(-50%);
  min-height: 2.25rem;
  padding: 0 0.7rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}

.toggle:hover {
  text-decoration: underline;
}

/* Keeps its height when empty, so the form does not jump when the message appears. */
.hint {
  min-height: 1.5rem;
  margin: 0.4rem 0 0.75rem;
  color: var(--warn);
  font-size: 0.88rem;
}

.submit {
  width: 100%;
  min-height: 2.75rem;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: var(--on-accent);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.status {
  min-height: 1.4rem;
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Edge draws its own reveal icon in password fields. Ours replaces it. */
input::-ms-reveal {
  display: none;
}
