/* Child Care Subsidy Calculator. Values are from norfolk-county-design-system/tokens.css
   (Lexend, square corners, green-600 action colour). Lexend is self-hosted (SIL OFL 1.1), so the
   page makes no third-party requests. */

@font-face {
  font-family: "Lexend";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("/child-care-subsidy-calculator/lexend-latin.woff2") format("woff2");
}

:root {
  --nc-green-900: #03372c;
  --nc-green-700: #055b4a;
  --nc-green-600: #056652;
  --nc-grey-50: #f8f9f9;
  --nc-grey-200: #cccccc;
  --nc-grey-700: #414042;
  --nc-error: #903e3c;
  --panel: #f1f9fd;          /* the live calculator's info-box tint */
  --text: #000000;
  --bg: #ffffff;
  --font: "Lexend", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-weight: 300;
  font-size: 18px;
  line-height: 1.5;
  letter-spacing: 0.01em;
}

a { color: var(--nc-green-600); font-weight: 700; }
/* Inline links in sentences are about 20px tall; the padding brings each tap target to 24px+ (WCAG 2.5.8) */
p a { padding: 3px 0; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--nc-green-900); outline-offset: 2px; }

.skip {
  position: absolute; left: 8px; top: -100px;
  background: var(--bg); padding: 8px 12px; z-index: 10;
}
.skip:focus { top: 8px; }

.masthead {
  padding: 16px;
  border-bottom: 6px solid var(--nc-green-700);
}
.masthead a { display: inline-block; }
.masthead img { display: block; width: 100%; max-width: 480px; height: auto; }

main {
  max-width: 760px;
  margin: 0 auto;
  padding: 8px 16px 32px;
}

h1 {
  font-weight: 700;
  font-size: 35px;
  line-height: 1.2;
  letter-spacing: -0.06px;
  margin: 24px 0 16px;
}

.panel {
  background: var(--panel);
  padding: 4px 16px;
  margin-bottom: 16px;
}

.lede { font-weight: 500; }

fieldset {
  border: 1px solid var(--nc-grey-200);
  margin: 0 0 20px;
  padding: 8px 16px 16px;
  min-width: 0;            /* lets the fieldset shrink on narrow screens */
}
legend { font-weight: 700; font-size: 20px; padding: 0 6px; }

.field { margin: 14px 0; }
.field label { display: block; font-weight: 500; margin-bottom: 4px; }

input[type="text"] {
  font: inherit;
  font-weight: 400;
  font-size: 18px;
  color: inherit;
  background: var(--bg);
  border: 1px solid var(--nc-grey-700);
  border-radius: 0;
  padding: 8px 10px;
  min-height: 44px;
  width: 100%;
  max-width: 16em;
}
.money { position: relative; display: block; max-width: 16em; }
.money::before {
  content: "$";
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  color: var(--nc-grey-700);
  pointer-events: none;
}
.money input { padding-left: 24px; }
.count input { max-width: 5em; }

.or { margin: 18px 0 0; }

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 4px 0 24px; }
button {
  font: inherit;
  font-weight: 600;
  font-size: 18px;
  min-height: 48px;
  padding: 10px 28px;
  border: 1px solid var(--nc-green-600);
  border-radius: 0;
  background: var(--nc-green-600);
  color: #ffffff;
  cursor: pointer;
}
button:hover { background: #ffffff; color: var(--nc-green-600); }
button.secondary { background: #ffffff; color: var(--nc-green-600); }
button.secondary:hover { background: var(--nc-green-600); color: #ffffff; }

#outcome:focus { outline: none; }

.notice {
  border-left: 6px solid var(--nc-error);
  background: #fbf3f3;
  padding: 4px 16px;
  margin-bottom: 16px;
}

#result {
  background: var(--panel);
  padding: 4px 16px 16px;
  border-left: 6px solid var(--nc-green-600);
}
#result[data-eligible="no"] { border-left-color: var(--nc-grey-700); }

.verdict { font-weight: 700; font-size: 22px; margin: 12px 0; }

.figures { margin: 0 0 12px; }
.figures div { margin: 0 0 8px; }
.figures dt { font-weight: 500; }
.figures dd { margin: 0; font-size: 20px; font-weight: 600; }

.note { font-weight: 500; }

.brackets {
  border-collapse: collapse;
  background: #ffffff;
  width: 100%;
  margin-top: 8px;
}
.brackets caption { text-align: left; font-weight: 600; padding-bottom: 6px; }
.brackets th, .brackets td {
  border: 1px solid #e5e7eb;
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
  font-size: 16px;
}
.brackets thead th { background: #f3f4f6; border: 2px solid #d1d5db; font-weight: 600; }
.brackets tbody th { font-weight: 400; }
.brackets td { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }

.privacy { font-size: 16px; color: var(--nc-grey-700); margin-top: 24px; }

footer {
  border-top: 6px solid var(--nc-green-700);
  padding: 16px;
  text-align: center;
  font-size: 16px;
}
footer a { display: inline-block; padding: 8px 0; }

@media (max-width: 575px) {
  body { font-size: 16px; }
  h1 { font-size: 26px; }
  legend { font-size: 18px; }
  fieldset { padding: 8px 12px 12px; }
  .brackets th, .brackets td { padding: 8px 6px; font-size: 15px; }
}
