/* MasonByte e-filing portal (slice S3b). WCAG 2.1 AA: every colour pair below is
   checked by axe in portal/test; text contrast is at least 4.5:1 and borders and
   focus rings at least 3:1. Layout reflows to 320px wide without sideways scrolling. */

:root {
  color-scheme: light;
  --ink: #1b2230;
  --muted: #4a5466;
  --paper: #ffffff;
  --tint: #f3f5f9;
  --line: #5b6474;
  --brand: #1d3b8a;
  --brand-ink: #ffffff;
  --error: #b3261e;
  --banner: #fff4cc;
  --banner-ink: #3d3100;
  --focus: #1d3b8a;
}

*, *::before, *::after { box-sizing: border-box; }

html { font-size: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1rem/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow-wrap: break-word;
}

a { color: var(--brand); text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }

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

.skip-link {
  position: absolute; left: 0.5rem; top: -4rem;
  background: var(--brand); color: var(--brand-ink);
  padding: 0.6rem 1rem; z-index: 10; border-radius: 0 0 4px 4px;
}
.skip-link:focus { top: 0; }
.skip-link:focus-visible { outline-color: var(--ink); }

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

.stage-banner {
  background: var(--banner); color: var(--banner-ink);
  padding: 0.5rem 1rem; margin: 0; text-align: center; font-size: 0.95rem;
  border-bottom: 1px solid #8a7300;
}

.site-header {
  display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; align-items: center; justify-content: space-between;
  padding: 0.9rem 1rem; border-bottom: 1px solid #d5dae3;
  max-width: 60rem; margin: 0 auto;
}
.brand { font-weight: 700; font-size: 1.15rem; color: var(--ink); text-decoration: none; }
.brand span { font-weight: 400; color: var(--muted); }
.site-nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; margin: 0; padding: 0; }
.site-nav a[aria-current="page"] { font-weight: 700; text-decoration: none; }

main { display: block; max-width: 40rem; margin: 0 auto; padding: 1.5rem 1rem 3rem; }
main:focus { outline: none; }

h1 { font-size: 1.85rem; line-height: 1.2; margin: 0.5rem 0 1rem; }
h2 { font-size: 1.3rem; line-height: 1.25; margin: 1.75rem 0 0.5rem; }
p, ul, ol { margin: 0 0 1rem; }
.lead { font-size: 1.1rem; }

.site-footer {
  border-top: 1px solid #d5dae3; background: var(--tint);
  padding: 1.25rem 1rem; font-size: 0.95rem;
}
.site-footer > * { max-width: 40rem; margin-left: auto; margin-right: auto; }
.site-footer p { margin-bottom: 0.4rem; }

/* Forms */
.field { margin: 0 0 1.4rem; }
label, legend { display: block; font-weight: 600; margin-bottom: 0.25rem; }
.hint { display: block; color: var(--muted); margin: 0 0 0.35rem; font-size: 0.95rem; }
input[type="email"], input[type="password"], input[type="text"] {
  display: block; width: 100%; max-width: 26rem;
  font: inherit; color: var(--ink); background: var(--paper);
  padding: 0.55rem 0.65rem; border: 2px solid var(--line); border-radius: 4px;
}
input[aria-invalid="true"] { border-color: var(--error); }
fieldset { border: 0; padding: 0; margin: 0 0 1.4rem; }
.choice { display: flex; gap: 0.6rem; align-items: flex-start; margin: 0.4rem 0; }
.choice input { width: 1.25rem; height: 1.25rem; margin: 0.15rem 0 0; accent-color: var(--brand); flex: none; }
.choice label { font-weight: 400; margin: 0; }

.field-error { color: var(--error); font-weight: 600; margin: 0 0 0.35rem; }
.field-error:empty { display: none; }

button, .button {
  display: inline-block; font: inherit; font-weight: 600; cursor: pointer;
  padding: 0.6rem 1.2rem; border-radius: 4px; border: 2px solid var(--brand);
  background: var(--brand); color: var(--brand-ink); text-decoration: none;
}
button.secondary, .button.secondary { background: var(--paper); color: var(--brand); }
button:hover, .button:hover { text-decoration: underline; }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; margin-top: 0.5rem; }

.error-summary {
  border: 3px solid var(--error); padding: 0.9rem 1rem; margin: 0 0 1.5rem; border-radius: 4px;
}
.error-summary h2 { margin-top: 0; font-size: 1.15rem; }
.error-summary ul { margin: 0; padding-left: 1.2rem; }
.error-summary a { color: var(--error); font-weight: 600; }
.error-summary:focus-visible { outline-offset: 3px; }

.notice { border-left: 5px solid var(--brand); background: var(--tint); padding: 0.75rem 1rem; margin: 0 0 1.5rem; }
.notice p:last-child { margin-bottom: 0; }

[hidden] { display: none !important; }

/* Terms */
.terms-text {
  border: 1px solid var(--line); border-radius: 4px; padding: 0.75rem 1rem;
  max-height: 22rem; overflow-y: auto; background: var(--tint); margin: 0 0 1rem;
}

/* Account */
.org-list { list-style: none; padding: 0; }
.org-list li { border: 1px solid #c4cad4; border-radius: 4px; padding: 0.75rem 1rem; margin-bottom: 0.6rem; }
.org-list .role { color: var(--muted); }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* Members */
.members-table { width: 100%; border-collapse: collapse; margin: 0 0 1.5rem; }
.members-table th, .members-table td { text-align: left; padding: 0.55rem 0.5rem; border-bottom: 1px solid #c4cad4; vertical-align: middle; }
.members-table td:first-child { overflow-wrap: anywhere; }
select { font: inherit; color: var(--ink); background: var(--paper); padding: 0.4rem; border: 2px solid var(--line); border-radius: 4px; }
.member-controls { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
