/* Design tokens and shared components. Values and roles are documented in DESIGN.md. */

:root {
  /* colour */
  --band: #2c1000;
  --green-dark: #0d3d35;
  --green-light: #d6f5f0;          /* Light Green, PMS 9500 C */
  --green-light-hover: #c2e3dd;
  --footer: var(--green-dark);
  --ink: #111111;
  --ink-2: #4a4a4a;
  --ink-3: #6e6e6e;
  --black: #000000;
  --surface: #ffffff;
  --surface-2: #f5f4f1;
  --line: #e4e2de;
  --field: #8c8c8c;
  --placeholder: #767676;
  --accent: #00fccd;
  --accent-ink: #006b57;
  --error: #c4122f;
  --error-bg: #fdecee;

  /* type */
  --font: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* spacing */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px;
  --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px;
  --content: 1200px;
  --gutter: 16px;

  /* shape */
  --r-sm: 6px;
  --r-lg: 16px;
  --r-pill: 999px;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.04), 0 12px 32px rgb(0 0 0 / 0.06);

  color-scheme: light;
}
@media (min-width: 640px) { :root { --gutter: 24px; } }
@media (min-width: 1024px) { :root { --gutter: 32px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 24px;
  color: var(--ink);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg { display: block; max-width: 100%; }
h1, h2, h3, p, ol, ul, figure { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.container {
  width: 100%;
  max-width: calc(var(--content) + var(--gutter) * 2);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

:focus-visible { outline: 2px solid var(--black); outline-offset: 2px; }

.skip-link {
  position: absolute; left: 16px; top: -100px; z-index: 10;
  padding: 12px 20px; border-radius: var(--r-pill);
  background: var(--black); color: #fff; text-decoration: none; font-weight: 500;
}
.skip-link:focus { top: 16px; outline: 2px solid var(--accent); outline-offset: 2px; }

.eyebrow {
  font-size: 12px; line-height: 16px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-2);
}
.eyebrow__sep { margin: 0 0.35em; font-weight: 400; }
.nowrap { white-space: nowrap; }
/* Keep the eyebrow on one line on common phone widths (360px and up). */
@media (max-width: 400px) {
  .eyebrow { letter-spacing: 0.05em; }
  .eyebrow__sep { margin: 0 0.2em; }
}

/* ---------------------------------------------------------------- buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 28px;
  border: 1.5px solid transparent; border-radius: var(--r-pill);
  font: 500 16px/1.2 var(--font); text-align: center; text-decoration: none;
  cursor: pointer; white-space: nowrap;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.btn svg { flex: none; }
.btn--primary { background: var(--black); color: #fff; }
.btn--primary:hover { background: #2b2b2b; }
.btn--primary[disabled], .btn--primary[aria-disabled="true"] { background: #bdbdbd; cursor: not-allowed; }
.btn--brand { background: var(--green-light); color: var(--green-dark); }
.btn--brand:hover { background: var(--green-light-hover); }
.btn--brand[disabled] { background: var(--green-light); cursor: progress; }
.btn--secondary { background: var(--surface); color: var(--green-dark); border-color: var(--green-dark); }
.btn--secondary:hover { background: var(--green-light); }
.btn--quiet {
  min-height: 44px; padding: 0 4px; border: 0; background: none; color: var(--ink);
  text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px;
}
.btn--quiet:hover { text-decoration-thickness: 2px; }
.btn--sm { min-height: 44px; padding: 0 18px; font-size: 14px; }
.btn--block { width: 100%; }
.btn.is-loading { cursor: progress; }

.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid currentColor; border-top-color: transparent; /* follows the button's text colour */
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- fields */

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field__label { font-size: 14px; line-height: 20px; font-weight: 500; color: var(--ink); }
.field__label .opt { color: var(--ink-3); font-weight: 400; }
.field__hint { font-size: 14px; line-height: 20px; color: var(--ink-3); }
.field__error {
  display: flex; gap: 6px; align-items: flex-start;
  font-size: 14px; line-height: 20px; font-weight: 500; color: var(--error);
}
.field__error svg { flex: none; margin-top: 2px; }

.input {
  width: 100%; height: 52px; padding: 0 14px;
  font: 400 16px/24px var(--font); color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--field); border-radius: var(--r-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none; appearance: none;
}
.input::placeholder { color: var(--placeholder); opacity: 1; }
.input:hover { border-color: var(--ink); }
.input:focus { outline: none; border-color: var(--black); box-shadow: inset 0 0 0 1px var(--black); }
.input[aria-invalid="true"] { border-color: var(--error); box-shadow: inset 0 0 0 1px var(--error); }
.input[readonly] { background: var(--surface-2); border-color: var(--line); }

select.input {
  padding-right: 44px; cursor: pointer; text-overflow: ellipsis;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23111' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 20px;
}
select.input.is-empty { color: var(--placeholder); }
select.input option { color: var(--ink); }

/* ---------------------------------------------------------------- surfaces */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}

.alert {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 16px; border-radius: var(--r-sm);
  background: var(--error-bg); color: var(--error);
  font-size: 14px; line-height: 20px; font-weight: 500;
}
.alert svg { flex: none; margin-top: 1px; }

/* ---------------------------------------------------------------- simple message pages */

.message-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--surface-2); }
.message { max-width: 520px; display: grid; gap: 16px; justify-items: start; }
.message h1 { font-size: 32px; line-height: 38px; letter-spacing: -0.02em; }
.message p:not(.eyebrow) { color: var(--ink-2); font-size: 18px; line-height: 28px; }
.message .btn { margin-top: 8px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}
