/* FileMyAccounts — calm, readable, mobile first. WCAG 2.2 AA. */
:root {
  --text: #1b1b1b;
  --muted: #4a4a4a;           /* 8.9:1 on --bg */
  --bg: #fbfaf6;
  --surface: #ffffff;
  --panel: #eef5f2;
  --border: #6b6b6b;          /* 3:1+ for UI parts */
  --brand: #0b5c4a;           /* 7.4:1 on white */
  --brand-dark: #073d31;
  --link: #0b5c4a;
  --link-visited: #4b2c74;
  --error: #b3261e;           /* 6.1:1 on --bg */
  --warn-bg: #fff4d6;
  --focus: #1b1b1b;
  --focus-halo: #ffd84d;
  --radius: 6px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --text: #f2f2ee;
    --muted: #c9c9c3;
    --bg: #141614;
    --surface: #1d201d;
    --panel: #1b2a25;
    --border: #9a9a94;
    --brand: #7fd1b9;
    --brand-dark: #a6e3d1;
    --link: #8fdcc4;
    --link-visited: #c9b3ef;
    --error: #ff9d94;
    --warn-bg: #3a3215;
    --focus: #ffd84d;
    --focus-halo: #141614;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Verdana, Arial, Helvetica, sans-serif;
  font-size: 1.125rem;   /* 18px at default browser settings */
  line-height: 1.6;
  overflow-wrap: break-word;
}

.wrap { max-width: 42rem; margin: 0 auto; padding: 0 1rem; }

h1, h2, h3 { line-height: 1.3; margin: 1.5em 0 0.5em; }
h1 { font-size: 1.75rem; margin-top: 1.25rem; }
h2 { font-size: 1.375rem; }
h3 { font-size: 1.15rem; }
p, ul, ol, dl, table { margin: 0 0 1rem; }
ul, ol { padding-left: 1.5rem; }
li { margin-bottom: 0.4rem; }
.lead { font-size: 1.2rem; }

a { color: var(--link); text-underline-offset: 0.15em; text-decoration-thickness: 1px; }
a:visited { color: var(--link-visited); }
a:hover { text-decoration-thickness: 3px; }

/* Visible focus for everything (WCAG 2.4.7, 2.4.11, 2.4.13) */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px var(--focus-halo);
}
[tabindex="-1"]:focus { outline: none; box-shadow: none; }

.skip-link {
  position: absolute; left: 1rem; top: -100px;
  background: var(--surface); color: var(--text);
  padding: 0.75rem 1rem; z-index: 10; border: 2px solid var(--text);
}
.skip-link:focus { top: 0.5rem; }

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

.site-header { border-bottom: 1px solid var(--border); background: var(--surface); }
.site-header .wrap { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; padding-top: 0.75rem; padding-bottom: 0.75rem; }
.brand { font-weight: bold; font-size: 1.25rem; color: var(--text); text-decoration: none; padding: 0.25rem 0; }
.brand:visited { color: var(--text); }
.brand:hover { text-decoration: underline; }
.tag {
  font-size: 0.9rem; border: 1px solid var(--brand); color: var(--brand);
  padding: 0.1rem 0.5rem; border-radius: 999px;
}

main { padding-bottom: 2rem; }
main:focus { outline: none; }

.panel {
  background: var(--panel); border-left: 6px solid var(--brand);
  padding: 0.25rem 1rem 0.5rem; margin: 2rem 0; border-radius: var(--radius);
}
.panel--plain { border-left-color: var(--border); background: var(--surface); }
.panel h2 { margin-top: 1rem; }

.small-print { color: var(--muted); font-size: 1rem; }

/* Forms */
.field { margin-bottom: 1.5rem; }
.field--error { border-left: 5px solid var(--error); padding-left: 0.9rem; }
label { display: block; font-weight: bold; margin-bottom: 0.25rem; }
.hint { color: var(--muted); margin: 0 0 0.5rem; font-size: 1rem; }
input[type="email"], input[type="text"] {
  display: block; width: 100%; max-width: 30rem;
  font: inherit; color: var(--text); background: var(--surface);
  border: 2px solid var(--text); border-radius: 0; padding: 0.5rem 0.6rem; min-height: 2.75rem;
}
.input--short { max-width: 12rem; letter-spacing: 0.05em; text-transform: uppercase; }
input[aria-invalid="true"] { border-color: var(--error); border-width: 3px; }
.error-message { color: var(--error); font-weight: bold; margin: 0 0 0.5rem; }

.checkbox { display: flex; gap: 0.75rem; align-items: flex-start; }
.checkbox input { width: 1.75rem; height: 1.75rem; margin: 0.1rem 0 0; flex: none; accent-color: var(--brand); }
.checkbox label { font-weight: normal; margin: 0; }

.button {
  display: inline-block; font: inherit; font-weight: bold; cursor: pointer;
  background: var(--brand); color: #ffffff; border: 2px solid transparent;
  border-radius: var(--radius); padding: 0.6rem 1.25rem; min-height: 2.75rem;
  text-decoration: none; box-shadow: 0 2px 0 var(--brand-dark);
}
.button:visited { color: #ffffff; }
.button:hover { background: var(--brand-dark); }
.button--secondary { background: var(--surface); color: var(--brand); border-color: var(--brand); box-shadow: none; }
.button--secondary:visited { color: var(--brand); }
.button--secondary:hover { background: var(--panel); }
.button[disabled] { opacity: 0.7; cursor: wait; }
@media (prefers-color-scheme: dark) {
  .button:not(.button--secondary), .button:not(.button--secondary):visited { color: #0b1a15; }
}

/* Honeypot: hidden from people and screen readers */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Error summary + notices */
.error-summary {
  border: 4px solid var(--error); padding: 0.25rem 1rem 0.5rem; margin: 1.5rem 0; background: var(--surface);
}
.error-summary h2 { margin-top: 0.75rem; }
.error-summary a { color: var(--error); font-weight: bold; }
.notice, .message, .draft-note {
  border: 3px solid var(--brand); background: var(--surface); padding: 0.25rem 1rem 0.5rem; margin: 1.5rem 0;
}
.notice { border-color: var(--error); }
.draft-note { border-color: #8a6d00; background: var(--warn-bg); }
.message h1 { margin-top: 0.75rem; }

/* Results */
.summary { margin: 0 0 1.5rem; }
.summary > div { display: flex; flex-wrap: wrap; gap: 0 1rem; border-bottom: 1px solid var(--border); padding: 0.5rem 0; }
.summary dt { font-weight: bold; flex: 1 1 12rem; }
.summary dd { margin: 0; flex: 2 1 14rem; }
.badge { display: inline-block; padding: 0.05rem 0.5rem; border-radius: var(--radius); border: 2px solid currentColor; }
.badge--overdue { color: var(--error); }
.badge--today, .badge--soon { color: #7a4d00; }
.badge--upcoming { color: var(--brand); }
@media (prefers-color-scheme: dark) { .badge--today, .badge--soon { color: #ffcf66; } }
.result h2 { margin-top: 1.25rem; }

table { border-collapse: collapse; width: 100%; }
caption { text-align: left; font-weight: bold; padding-bottom: 0.5rem; }
th, td { text-align: left; padding: 0.5rem; border-bottom: 1px solid var(--border); vertical-align: top; }

.ticks { padding-left: 1.5rem; }

.site-footer { border-top: 1px solid var(--border); background: var(--surface); padding: 1.5rem 0 2rem; font-size: 1rem; }
.footer-links { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.footer-links a { display: inline-block; padding: 0.25rem 0; }

@media (min-width: 40rem) {
  h1 { font-size: 2.1rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

@media print {
  .site-header, .site-footer, form, .panel { display: none; }
}
