/* Brand colours mirror BrandColors in lib/app.dart. */
:root {
  color-scheme: light;
  --bg: #fffaf0;
  --surface: #ffffff;
  --surface-low: #fff4e0;
  --text: #1c1d24;
  --muted: #5a4a3c;
  --outline: #8f7a66;
  --outline-soft: #e2d2bc;
  --primary: #bf4b00;
  --on-primary: #ffffff;
  --accent: #fb6404;
  --error: #b3261e;
  --error-bg: #fde7e4;
  --radius: 16px;
  --shadow: 0 1px 2px rgb(28 29 36 / 6%), 0 8px 24px rgb(28 29 36 / 6%);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #16161b;
    --surface: #1d1d23;
    --surface-low: #222228;
    --text: #f5efe3;
    --muted: #cfc4b6;
    --outline: #8e857a;
    --outline-soft: #45413b;
    --primary: #ff8a3d;
    --on-primary: #1c1d24;
    --accent: #fb6404;
    --error: #ffb4ab;
    --error-bg: #3b1a17;
    --shadow: none;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

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

.brand { display: block; width: min(320px, 80vw); margin: 8px auto 28px; }
.brand img { display: block; width: 100%; height: auto; }
.brand .dark { display: none; }
@media (prefers-color-scheme: dark) {
  .brand .light { display: none; }
  .brand .dark { display: block; }
}

main { width: 100%; max-width: 440px; }

.card {
  background: var(--surface);
  border: 1px solid var(--outline-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 24px;
}
.card + .card { margin-top: 16px; }

h1 { font-size: 1.375rem; line-height: 1.3; margin: 0 0 8px; text-wrap: balance; }
h2 { font-size: 0.8125rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin: 24px 0 8px; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }

ul.checks { list-style: none; padding: 0; margin: 0; }
ul.checks li { position: relative; padding: 6px 0 6px 28px; }
ul.checks li::before {
  content: "";
  position: absolute; left: 4px; top: 13px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent);
}

dl.facts { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; overflow-wrap: anywhere; font-weight: 600; }

label { display: block; font-weight: 600; font-size: 0.875rem; margin: 16px 0 6px; }
input {
  width: 100%;
  font: inherit;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--outline);
  border-radius: 10px;
  padding: 12px 14px;
}
input:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; border-color: transparent; }

.actions { display: grid; gap: 10px; margin-top: 24px; }
button {
  font: inherit;
  font-weight: 600;
  min-height: 48px;
  border-radius: 999px;
  padding: 0 20px;
  cursor: pointer;
  border: 1px solid var(--outline);
  background: transparent;
  color: var(--text);
}
button.primary { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
button:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
button:disabled { opacity: 0.6; cursor: progress; }
button.link {
  min-height: 0; padding: 0; border: 0; border-radius: 0;
  color: var(--primary); font-weight: 600; text-decoration: underline;
}
button.small-btn { min-height: 36px; padding: 0 14px; font-size: 0.875rem; }

a { color: var(--primary); font-weight: 600; }

.notice {
  background: var(--surface-low);
  border-radius: 12px;
  padding: 12px 14px;
  margin-top: 20px;
  font-size: 0.875rem;
  color: var(--muted);
}
.form-error {
  background: var(--error-bg);
  color: var(--error);
  border-radius: 10px;
  padding: 10px 12px;
  margin-top: 16px;
  font-size: 0.875rem;
}

.grants { list-style: none; padding: 0; margin: 0; }
.grants li {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 0; border-top: 1px solid var(--outline-soft);
}
.grants li:first-child { border-top: 0; }
.grants .name { font-weight: 600; overflow-wrap: anywhere; }

.spinner {
  width: 28px; height: 28px; margin: 8px auto;
  border: 3px solid var(--outline-soft); border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }

footer { margin-top: 32px; font-size: 0.8125rem; color: var(--muted); text-align: center; }

[hidden] { display: none !important; }

/* Headings receive focus programmatically when a view changes, for screen
   readers; they are not interactive, so no focus ring. */
h1:focus { outline: none; }
.card > :last-child { margin-bottom: 0; }
