:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --text: #1c2430;
  --muted: #5b6575;
  --line: #d5dae1;
  --accent: #1f5fbf;
  --accent-text: #ffffff;
  --problem: #b42318;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12161c;
    --card: #1b2129;
    --text: #e6e9ee;
    --muted: #9aa4b2;
    --line: #333c48;
    --accent: #5b9bf0;
    --accent-text: #0b1220;
    --problem: #f97066;
  }
}

* {
  box-sizing: border-box;
}

/* `form { display: grid }` below would otherwise beat the browser's own. */
[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 16px;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}

main {
  width: 100%;
  max-width: 380px;
  padding: 28px 24px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
}

h1 {
  margin: 0 0 8px;
  font-size: 20px;
}

#state {
  margin: 0 0 20px;
  color: var(--muted);
}

form {
  display: grid;
  gap: 10px;
}

label {
  font-weight: 600;
  font-size: 14px;
}

input {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

button {
  padding: 10px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: var(--accent-text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

button:disabled {
  opacity: 0.55;
  cursor: default;
}

#check:empty {
  display: none;
}

#problem {
  margin: 0;
  min-height: 1.5em;
  color: var(--problem);
  font-size: 14px;
}
