/* Shared styles for the three pages. Plain CSS — no framework, no build step. */

:root {
  --ink: #1a1a1a;
  --muted: #6b6b6b;
  --line: #dcdcdc;
  --surface: #ffffff;
  --page: #f6f6f4;
  --accent: #2f5d6e;
  --accent-dark: #244a58;
  --danger: #a53f31;
  --danger-bg: #faeae8;
  --ok: #3f7355;
  --ok-bg: #e6f0e9;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #ececec;
    --muted: #a0a0a0;
    --line: #3a3a3a;
    --surface: #1f1f1f;
    --page: #151515;
    --accent: #6ea3b5;
    --accent-dark: #85b6c6;
    --danger: #e79a90;
    --danger-bg: #2c1a18;
    --ok: #8fc4a4;
    --ok-bg: #17251c;
  }
}

* {
  box-sizing: border-box;
}

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

main {
  width: 100%;
  max-width: 26rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 2rem;
}

h1 {
  margin: 0 0 0.35rem;
  font-size: 1.4rem;
  letter-spacing: -0.01em;
}

.sub {
  margin: 0 0 1.5rem;
  color: var(--muted);
  font-size: 0.94rem;
}

label {
  display: block;
  margin-bottom: 1rem;
}

.label-text {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.88rem;
  font-weight: 600;
}

input {
  width: 100%;
  padding: 0.6rem 0.7rem;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
}

input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.hint {
  margin: 0.3rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

button {
  width: 100%;
  padding: 0.65rem 1rem;
  font: inherit;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}

button:hover:not(:disabled) {
  background: var(--accent-dark);
}

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

/*
 * Messages are hidden by an EMPTY `hidden` attribute rather than a class, so a message is
 * invisible until something puts text in it. A styling change cannot accidentally reveal an
 * empty box.
 *
 * role="alert" so a screen reader announces an error when it appears — a validation message
 * nobody hears is a validation message that did not happen.
 */
.message {
  margin: 0 0 1rem;
  padding: 0.65rem 0.8rem;
  border-radius: 6px;
  font-size: 0.9rem;
}

.message[hidden] {
  display: none;
}

.message.error {
  color: var(--danger);
  background: var(--danger-bg);
  border: 1px solid var(--danger);
}

.message.ok {
  color: var(--ok);
  background: var(--ok-bg);
  border: 1px solid var(--ok);
}

.foot {
  margin: 1.25rem 0 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.86rem;
}

a {
  color: var(--accent);
}

dl.profile {
  margin: 0 0 1.5rem;
}

dl.profile dt {
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

dl.profile dd {
  margin: 0.15rem 0 0.9rem;
  font-weight: 600;
}

/*
 * Visually hidden but still read aloud. Used for a table caption and an icon-only column
 * header — `display: none` would remove them from the accessibility tree too, which defeats
 * the point of having written them.
 */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
