/* Base styles shared by the public site and the staff workspace. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-body);
  color: var(--color-text);
  background: var(--color-page);
  font-feature-settings: 'cv11', 'ss01';
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, picture, video { display: block; max-width: 100%; height: auto; }
h1, h2, h3, h4 { margin: 0; color: var(--color-navy); line-height: var(--leading-tight); letter-spacing: -0.015em; text-wrap: balance; }
h1 { font-size: var(--text-4xl); font-weight: 700; letter-spacing: -0.025em; }
h2 { font-size: var(--text-3xl); font-weight: 680; }
h3 { font-size: var(--text-xl); font-weight: 640; line-height: var(--leading-snug); }
h4 { font-size: var(--text-lg); font-weight: 620; }
p { margin: 0; text-wrap: pretty; }
p + p { margin-top: var(--space-4); }
ul, ol { margin: 0; padding: 0; }
a { color: var(--color-link); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--color-navy); text-decoration-thickness: 2px; }
strong { font-weight: 640; }
small { font-size: var(--text-sm); }
hr { border: 0; border-top: 1px solid var(--color-border); margin: var(--space-6) 0; }
address { font-style: normal; }
table { border-collapse: collapse; }
[hidden] { display: none !important; }

:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--radius-sm); }
.on-dark :focus-visible, .on-dark:focus-visible { box-shadow: 0 0 0 3px var(--color-navy), 0 0 0 5px var(--color-white); }

.skip-link {
  position: absolute; left: var(--space-4); top: -100px; z-index: 1000;
  background: var(--color-navy); color: var(--color-white); padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md); font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: var(--space-4); color: var(--color-white); }

.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;
}

.container { width: 100%; max-width: calc(var(--container) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }
.container--narrow { max-width: calc(var(--container-narrow) + var(--gutter) * 2); }
.prose { max-width: var(--measure); }
.prose > * + * { margin-top: var(--space-4); }
.prose h2 { font-size: var(--text-2xl); margin-top: var(--space-7); }
.prose h3 { margin-top: var(--space-6); }
.prose ul { padding-left: 1.25em; }
.prose li + li { margin-top: var(--space-2); }
.muted { color: var(--color-text-secondary); }

/* ---------------------------------------------------------------- buttons */
.btn {
  --btn-bg: var(--color-navy); --btn-fg: var(--color-white); --btn-border: var(--color-navy);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: var(--control-h); padding: 0 var(--space-5);
  font: inherit; font-size: var(--text-base); font-weight: 600; line-height: 1.2; letter-spacing: 0;
  color: var(--btn-fg); background: var(--btn-bg); border: 1.5px solid var(--btn-border);
  border-radius: var(--radius-md); text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn:hover { --btn-bg: var(--color-navy-strong); --btn-border: var(--color-navy-strong); color: var(--btn-fg); text-decoration: none; }
.btn:disabled, .btn[aria-disabled='true'] { opacity: 0.55; cursor: not-allowed; }
.btn--secondary { --btn-bg: var(--color-white); --btn-fg: var(--color-navy); --btn-border: var(--color-border-strong); }
.btn--secondary:hover { --btn-bg: var(--color-section); --btn-fg: var(--color-navy); --btn-border: var(--color-navy); }
.btn--light { --btn-bg: var(--color-white); --btn-fg: var(--color-navy); --btn-border: var(--color-white); }
.btn--light:hover { --btn-bg: #E6EEF6; --btn-border: #E6EEF6; --btn-fg: var(--color-navy); }
.btn--outline-light { --btn-bg: transparent; --btn-fg: var(--color-white); --btn-border: rgba(255, 255, 255, 0.85); }
.btn--outline-light:hover { --btn-bg: rgba(255, 255, 255, 0.12); --btn-border: var(--color-white); --btn-fg: var(--color-white); }
.btn--ghost { --btn-bg: transparent; --btn-fg: var(--color-navy); --btn-border: transparent; }
.btn--ghost:hover { --btn-bg: var(--color-section); --btn-border: transparent; --btn-fg: var(--color-navy); }
.btn--danger { --btn-bg: var(--color-white); --btn-fg: var(--color-error); --btn-border: var(--color-error); }
.btn--danger:hover { --btn-bg: var(--color-error-bg); --btn-fg: var(--color-error); --btn-border: var(--color-error); }
.btn--sm { min-height: 40px; padding: 0 var(--space-4); font-size: var(--text-sm); }
.btn--block { width: 100%; }
.btn .icon { width: 18px; height: 18px; flex: none; }

.link-arrow { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--color-navy); text-decoration: none; }
.link-arrow::after { content: '→'; transition: transform 0.15s ease; }
.link-arrow:hover { color: var(--color-navy); text-decoration: underline; }
.link-arrow:hover::after { transform: translateX(3px); }

/* ---------------------------------------------------------------- forms */
.field { display: grid; gap: 6px; }
.field + .field, .field-row + .field, .field + .field-row, .field-row + .field-row, fieldset + .field, .field + fieldset { margin-top: var(--space-5); }
.field-row { display: grid; gap: var(--space-5); }
@media (min-width: 640px) { .field-row--2 { grid-template-columns: 1fr 1fr; } .field-row--3 { grid-template-columns: repeat(3, 1fr); } }
label, .label, legend { font-weight: 600; font-size: var(--text-sm); color: var(--color-navy); }
.label-hint { font-weight: 400; color: var(--color-text-secondary); }
.hint { font-size: var(--text-sm); color: var(--color-text-secondary); margin: 0; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { padding: 0; margin-bottom: var(--space-2); }
input[type='text'], input[type='email'], input[type='tel'], input[type='number'], input[type='date'], input[type='time'],
input[type='search'], input[type='url'], select, textarea {
  width: 100%; min-height: var(--control-h); padding: 10px 14px;
  font: inherit; font-size: 1rem; line-height: 1.4; color: var(--color-text);
  background: var(--color-white); border: 1.5px solid var(--color-border-strong); border-radius: var(--radius-md);
  transition: border-color 0.15s ease;
}
textarea { min-height: 112px; resize: vertical; }
select { appearance: none; padding-right: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%230B2A4A' stroke-width='1.8'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
input:hover, select:hover, textarea:hover { border-color: var(--color-navy); }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--color-navy); box-shadow: 0 0 0 3px rgba(22, 136, 213, 0.45); border-radius: var(--radius-md); }
input[aria-invalid='true'], select[aria-invalid='true'], textarea[aria-invalid='true'] { border-color: var(--color-error); border-width: 2px; }
.field-error { display: flex; gap: 6px; align-items: flex-start; color: var(--color-error); font-size: var(--text-sm); font-weight: 560; margin: 0; }
.field-error::before { content: '!'; flex: none; display: inline-grid; place-items: center; width: 18px; height: 18px; margin-top: 2px; border-radius: 50%; background: var(--color-error); color: #fff; font-size: 12px; font-weight: 700; }

.choice { display: flex; align-items: flex-start; gap: var(--space-3); font-weight: 400; font-size: var(--text-base); color: var(--color-text); cursor: pointer; min-height: 44px; padding-block: 10px; }
.choice input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--color-navy); flex: none; }
.choice-group { display: grid; gap: 0; }
.segmented { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.segmented label { position: relative; display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--space-4); border: 1.5px solid var(--color-border-strong); border-radius: var(--radius-md); background: var(--color-white); font-size: var(--text-sm); font-weight: 600; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.segmented label:has(input:checked) { border-color: var(--color-navy); background: var(--color-navy); color: var(--color-white); }
.segmented label:has(input:focus-visible) { box-shadow: var(--focus-ring); }

/* ---------------------------------------------------------------- notices */
.notice { display: flex; gap: var(--space-3); padding: var(--space-4); border-radius: var(--radius-md); border: 1px solid; font-size: var(--text-sm); line-height: 1.5; }
.notice__icon { flex: none; width: 20px; height: 20px; margin-top: 1px; }
.notice > div > * + * { margin-top: var(--space-2); }
.notice--info { background: var(--color-info-bg); border-color: #BCD5EA; color: var(--color-info); }
.notice--success { background: var(--color-success-bg); border-color: #A9D8BE; color: var(--color-success); }
.notice--error { background: var(--color-error-bg); border-color: #F2B8B2; color: var(--color-error); }
.notice--warning { background: var(--color-warning-bg); border-color: #F0D58F; color: var(--color-warning); }
.notice a { color: inherit; font-weight: 600; }
.notice ul { padding-left: 1.2em; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: var(--text-xs); font-weight: 600; line-height: 1.6; border: 1px solid transparent; white-space: nowrap; }
.badge::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge--neutral { background: var(--color-section); color: var(--color-text-secondary); border-color: var(--color-border); }
.badge--info { background: var(--color-info-bg); color: var(--color-info); }
.badge--success { background: var(--color-success-bg); color: var(--color-success); }
.badge--warning { background: var(--color-warning-bg); color: var(--color-warning); }
.badge--error { background: var(--color-error-bg); color: var(--color-error); }
.badge--plain::before { display: none; }

.env-banner { background: var(--color-warning-bg); color: var(--color-warning); border-bottom: 1px solid #F0D58F; font-size: var(--text-sm); font-weight: 560; text-align: center; padding: var(--space-2) var(--gutter); }

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

/* Fields inside a grid row are spaced by the grid gap only. */
.field-row > .field + .field { margin-top: 0; }
/* Legends behave like block headings (not drawn on the fieldset border). */
fieldset > legend { float: left; width: 100%; }
fieldset > legend + * { clear: both; }
.field { align-content: start; }
