/* 100+ Club: the "Garden Party" look. Calm, soft and friendly, and still big
   and clear (brief §2): 18px text, 48px+ buttons, strong contrast, a visible
   focus ring, a word beside every colour.

   The charity's own colours come from Settings, via --primary, --secondary
   and --accent set in _head.html. Everything else here is fixed.
   Animation is gentle and switches off for anyone whose device asks for
   less motion (see the end of this file). */
@font-face { font-family: "Atkinson Hyperlegible"; src: url("../fonts/AtkinsonHyperlegible-Regular.43b63ccfb94f.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("../fonts/AtkinsonHyperlegible-Bold.4de508efffb2.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Lexend"; src: url("../fonts/Lexend-Variable.cb01f8c583a9.ttf") format("truetype"); font-weight: 400 800; font-display: swap; }

:root {
  --primary: #29498D; --secondary: #79ABDB; --accent: #D8137C;
  --text: #14213d; --muted: #3f4a5e; --bg: #FFFFFF; --surface: #fff; --border: #c9d6ea;
  --sky: #E3EFFA; --hill-back: #BFE0B4; --hill-front: #94C987; --sun: #FFD166;
  --soft: #F3F7FC;
  --paid: #1d6b34; --paid-bg: #dff3e4;
  --due: #7a4b00; --due-bg: #fff0c2;
  --grace: #8a3c00; --grace-bg: #ffe0c7;
  --release: #9b1c1c; --release-bg: #fde0e0;
  --free: #34495e; --free-bg: #eef1f5;
  --radius: 28px; --radius-sm: 18px;
  --shadow: 0 8px 24px rgba(41, 73, 141, .10);
  --shadow-lift: 0 16px 32px rgba(41, 73, 141, .16);
  --focus: #ffbf47;
  --display: "Lexend", "Atkinson Hyperlegible", Arial, sans-serif;
}
/* The sky follows the charity's second colour where the browser can mix it. */
@supports (background: color-mix(in srgb, red 50%, white)) {
  :root { --sky: color-mix(in srgb, var(--secondary) 22%, white); --soft: color-mix(in srgb, var(--secondary) 9%, white); }
}

* { box-sizing: border-box; }
html { font-size: 112.5%; } /* 18px */
body { margin: 0; font-family: "Atkinson Hyperlegible", Arial, sans-serif; line-height: 1.5; color: var(--text); background: var(--bg); }
a { color: var(--primary); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 4px solid var(--focus); outline-offset: 2px; box-shadow: 0 0 0 7px var(--text); border-radius: 6px; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; color: var(--primary); line-height: 1.2; margin: 0 0 .6em; }
h1 { font-size: 2.1rem; } h2 { font-size: 1.4rem; } h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; max-width: 46em; }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--focus); color: #000; padding: 12px 16px; z-index: 10; }
.skip-link:focus { left: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* The sky band at the top of every page, with hills along its bottom edge */
.sky { position: relative; overflow: hidden; background: var(--sky); padding-bottom: 64px; }
.sky.tall { padding-bottom: 130px; }
.hills { position: absolute; left: 0; bottom: 0; width: 100%; height: 70px; display: block; }
.sky.tall .hills { height: 150px; }
.hill-back { fill: var(--hill-back); } .hill-front { fill: var(--hill-front); }
.account-bar { max-width: 1200px; margin: 0 auto; padding: 8px 24px 0; display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 6px 16px; font-size: .9rem; position: relative; }
.account-bar a, .account-bar button { color: var(--primary); }
.topbar { max-width: 1200px; margin: 0 auto; padding: 10px 24px 0; display: flex; flex-wrap: wrap; align-items: center; gap: 14px 16px; position: relative; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--primary); text-decoration: none; font-family: var(--display); font-weight: 700; font-size: 1.25rem; }
.brand img { height: 46px; background: #fff; border-radius: 14px; padding: 4px 8px; box-shadow: var(--shadow); }
.brand-mark { width: 46px; height: 46px; border-radius: 14px; background: var(--primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: .85rem; }
.main-nav { margin-left: auto; }
.main-nav ul { list-style: none; margin: 0; padding: 6px; display: flex; flex-wrap: wrap; gap: 4px; background: #fff; border-radius: 999px; box-shadow: 0 4px 14px rgba(41, 73, 141, .10); }
.main-nav a { display: inline-flex; align-items: center; min-height: 48px; padding: 0 18px; border-radius: 999px; font-weight: 700; font-size: 1.05rem; text-decoration: none; color: var(--primary); }
.main-nav a:hover { background: var(--soft); }
.main-nav a[aria-current="page"] { background: var(--primary); color: #fff; }
.demo-banner { background: #9b1c1c; color: #fff; text-align: center; padding: 8px 16px; font-weight: 700; position: relative; }
.link-button { background: none; border: none; padding: 0; font: inherit; text-decoration: underline; cursor: pointer; min-height: 0; color: inherit; }

/* Page content sits on white, lifted slightly into the sky */
main { max-width: 1200px; margin: 0 auto; padding: 28px 24px 64px; position: relative; }
main.lifted { margin-top: -90px; padding-top: 0; }
.narrow { max-width: 760px; }
main.narrow { margin-left: auto; margin-right: auto; margin-top: -40px; padding-top: 0; }
.page-panel { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px 32px; }
main > h1:first-child, main > .narrow > h1:first-child { margin-top: 0; }

/* Buttons: pill shaped, at least 48px tall, always with words */
.button, button, input[type=submit] {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 54px; padding: 10px 26px; border-radius: 999px;
  font: inherit; font-weight: 700; font-size: 1.05rem; line-height: 1.2; text-align: center;
  background: var(--primary); color: #fff; border: 2px solid var(--primary); cursor: pointer; text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.button:hover, button:hover { filter: brightness(1.12); transform: translateY(-1px); }
.button:active, button:active { transform: scale(.98); }
.button.secondary, button.secondary { background: #fff; color: var(--primary); }
.button.danger, button.danger { background: var(--release); border-color: var(--release); }
.button.big, button.big { min-height: 66px; font-size: 1.2rem; padding: 14px 34px; }
.button.small, button.small { min-height: 48px; padding: 6px 18px; font-size: 1rem; }
.link-button:hover, .link-button:active { transform: none; filter: none; }
.button-row { display: flex; gap: 12px; flex-wrap: wrap; margin: 20px 0; align-items: center; }
.button-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin: 16px 0 24px; }
.button-grid .button { justify-content: flex-start; text-align: left; }

/* Today: the hero */
.hero { max-width: 1200px; margin: 0 auto; padding: 34px 24px 0; display: flex; flex-wrap: wrap; align-items: center; gap: 24px; position: relative; }
.hero-text { flex: 1 1 460px; min-width: 0; }
.hero h1 { font-size: 2.6rem; line-height: 1.12; margin-bottom: 12px; }
.hero p { font-size: 1.17rem; max-width: 28em; margin: 0; }
.hero-art { width: 360px; max-width: 100%; height: auto; flex: none; }
.balloon { animation: float 5s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 100%; }
.balloon.b2 { animation-delay: -1.6s; } .balloon.b3 { animation-delay: -3.1s; }
.sun-rays { animation: turn 40s linear infinite; transform-box: fill-box; transform-origin: center; }
.balloon-text { font-family: var(--display); font-weight: 700; }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-14px) rotate(2deg); } }
@keyframes turn { to { transform: rotate(360deg); } }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes ring-fill { from { stroke-dashoffset: var(--ring-full); } }

/* Today: job cards */
.job-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; list-style: none; margin: 0 0 28px; padding: 0; }
.job-card { display: flex; flex-direction: column; gap: 12px; height: 100%; background: var(--surface); border-radius: var(--radius); padding: 24px; text-decoration: none; color: var(--text); box-shadow: var(--shadow); animation: rise .6s ease-out both; transition: transform .2s ease, box-shadow .2s ease; }
.job-cards li:nth-child(2) .job-card { animation-delay: .08s; } .job-cards li:nth-child(3) .job-card { animation-delay: .16s; }
.job-cards li:nth-child(4) .job-card { animation-delay: .24s; } .job-cards li:nth-child(5) .job-card { animation-delay: .32s; }
a.job-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.job-icon { width: 56px; height: 56px; border-radius: var(--radius-sm); display: inline-flex; align-items: center; justify-content: center; background: var(--sky); color: var(--primary); }
.job-icon svg { width: 28px; height: 28px; }
.job-icon.pink { background: #FDE3EF; color: #A30F5E; } .job-icon.sun { background: #FFF1C9; color: #8A5A00; }
.job-icon.leaf { background: #EAF6E6; color: #1E4D17; } .job-icon.red { background: var(--release-bg); color: var(--release); }
.job-count { font-family: var(--display); font-weight: 700; font-size: 2.4rem; line-height: 1; color: var(--primary); }
.job-text { font-size: 1.12rem; font-weight: 700; }
.job-go { margin-top: auto; font-weight: 700; color: var(--primary); }
.quick-jobs { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 28px; }
.today-row { display: flex; flex-wrap: wrap; gap: 18px; }
.draw-panel { flex: 2 1 420px; background: var(--primary); color: #fff; border-radius: var(--radius); padding: 28px; display: flex; flex-wrap: wrap; align-items: center; gap: 22px; }
.draw-panel h2 { color: #fff; margin-bottom: 6px; }
.draw-panel p { font-size: 1.1rem; margin: 0 0 16px; }
.draw-panel .button { background: #fff; color: var(--primary); border-color: #fff; }
.draw-facts { display: flex; gap: 10px; }
.draw-fact { min-width: 84px; height: 88px; padding: 0 10px; border-radius: 16px; background: rgba(255, 255, 255, .16); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.draw-fact strong { font-family: var(--display); font-size: 1.9rem; line-height: 1; }
.numbers-panel { flex: 1 1 300px; background: var(--surface); border-radius: var(--radius); padding: 24px; display: flex; align-items: center; gap: 20px; box-shadow: var(--shadow); }
.numbers-panel h2 { margin-bottom: 4px; }
.numbers-panel p { margin: 0; }
.ring-track { stroke: var(--sky); } .ring-value { stroke: var(--accent); animation: ring-fill 1.6s ease-out both; }
.ring-number { font-family: var(--display); font-weight: 700; fill: var(--primary); }

/* Cards and tables */
.card { background: var(--surface); border: none; border-radius: var(--radius); padding: 24px 28px; margin-bottom: 20px; box-shadow: var(--shadow); }
.card h2 { margin-bottom: .4em; }
.card.highlight { box-shadow: var(--shadow), inset 0 0 0 3px var(--primary); }
.card.warning { background: var(--due-bg); box-shadow: inset 0 0 0 2px var(--due); }
.card.danger { background: var(--release-bg); box-shadow: inset 0 0 0 2px var(--release); }
dl.details { display: grid; grid-template-columns: minmax(140px, 220px) 1fr; gap: 6px 16px; margin: 0; }
dl.details dt { color: var(--muted); }
dl.details dd { margin: 0; font-weight: 700; }
table.list { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border-radius: var(--radius-sm); overflow: hidden; box-shadow: var(--shadow); }
table.list th, table.list td { padding: 14px 14px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
table.list tr:last-child td { border-bottom: none; }
table.list th { color: var(--muted); font-weight: 700; font-size: .95rem; background: var(--soft); }
table.list tr.ended td { color: var(--muted); }
.table-wrap { overflow-x: auto; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
details > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; }

/* Status badges: colour plus a word, never colour alone */
.badge { display: inline-block; padding: 3px 14px; border-radius: 999px; font-weight: 700; font-size: .92rem; border: 2px solid currentColor; white-space: nowrap; vertical-align: middle; }
.badge-paid { color: var(--paid); background: var(--paid-bg); }
.badge-due_soon { color: var(--due); background: var(--due-bg); }
.badge-in_grace { color: var(--grace); background: var(--grace-bg); }
.badge-to_be_released { color: var(--release); background: var(--release-bg); }
.badge-ended, .badge-free { color: var(--free); background: var(--free-bg); }
.badge-paid::before { content: "✓ "; }
.badge-to_be_released::before { content: "! "; }

/* Forms */
.field { margin-bottom: 22px; }
.field > label, .field legend { display: block; font-weight: 700; margin-bottom: 8px; font-size: 1.05rem; }
.field .help { color: var(--muted); margin: -2px 0 8px; font-size: .95rem; }
fieldset { border: none; padding: 0; margin: 0; min-width: 0; }
input[type=text], input[type=email], input[type=number], input[type=password], input[type=date], input[type=search], input[type=tel], select, textarea {
  width: 100%; max-width: 32em; font: inherit; padding: 12px 16px; min-height: 54px; border: 2px solid #8794aa; border-radius: 16px; background: #fff; color: var(--text);
}
input:hover, select:hover, textarea:hover { border-color: var(--primary); }
textarea { min-height: 100px; }
input[type=color] { width: 80px; height: 54px; border: 2px solid var(--muted); border-radius: 14px; padding: 2px; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--release); border-width: 3px; }
.error-text { color: var(--release); font-weight: 700; margin: 0 0 8px; }
.error-text::before { content: "⚠ "; }
.radio-list, .check { display: grid; gap: 10px; }
.radio-list label, .check label { display: flex; gap: 12px; align-items: center; padding: 12px 18px; min-height: 58px; border: 2px solid var(--border); border-radius: var(--radius-sm); background: #fff; font-weight: 400; cursor: pointer; max-width: 32em; transition: border-color .15s ease, background .15s ease; }
.radio-list label:hover, .check label:hover { border-color: var(--primary); }
.radio-list input, .check input { width: 26px; height: 26px; flex: none; accent-color: var(--primary); }
.radio-list label:has(input:checked), .check label:has(input:checked) { border: 3px solid var(--primary); background: var(--sky); font-weight: 700; }
.error-summary { background: #fff; padding: 18px 22px; border-radius: var(--radius-sm); margin-bottom: 24px; box-shadow: inset 0 0 0 4px var(--release); }
.error-summary h2 { color: var(--release); }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Messages */
.messages { list-style: none; padding: 0; margin: 0 0 20px; }
.messages li { padding: 14px 20px; border-radius: var(--radius-sm); margin-bottom: 8px; font-weight: 700; border: 2px solid; background: #fff; }
.messages .success { background: var(--paid-bg); border-color: var(--paid); color: #0f3d1d; }
.messages .error { background: var(--release-bg); border-color: var(--release); color: #5c0f0f; }
.messages .info, .messages .warning { background: var(--sky); border-color: var(--primary); }

/* Wizard progress */
.progress { font-weight: 700; color: var(--primary); margin-bottom: 6px; display: inline-block; background: #fff; border-radius: 999px; padding: 4px 16px; }
.progress-bar { height: 12px; background: #fff; border-radius: 999px; margin-bottom: 22px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--border); }
.progress-bar span { display: block; height: 100%; background: var(--primary); border-radius: 999px; transition: width .4s ease; }
.choice-buttons { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.choice-buttons button { min-height: 130px; font-family: var(--display); font-size: 1.4rem; flex-direction: column; background: #fff; color: var(--primary); border: 2px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.choice-buttons button:hover { border-color: var(--primary); filter: none; transform: translateY(-3px); box-shadow: var(--shadow-lift); }
.choice-buttons button span { font-family: "Atkinson Hyperlegible", Arial, sans-serif; font-weight: 400; font-size: 1rem; color: var(--muted); }
.live-total { font-family: var(--display); font-size: 1.2rem; font-weight: 600; background: #EAF6E6; color: #1E4D17; padding: 14px 18px; border-radius: var(--radius-sm); max-width: 32em; }
.confirm-box { background: #fff; border-radius: var(--radius); padding: 24px 28px; font-size: 1.3rem; font-weight: 700; margin: 20px 0; box-shadow: var(--shadow), inset 0 0 0 3px var(--primary); }

/* Joining form: how many numbers, as big buttons with a balloon each */
.count-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; max-width: 32em; }
.count-picker label { position: relative; display: flex; align-items: center; justify-content: center; min-height: 60px; border-radius: var(--radius-sm); background: var(--soft); border: 2px solid var(--border); font-family: var(--display); font-weight: 700; font-size: 1.4rem; color: var(--primary); cursor: pointer; }
.count-picker input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.count-picker label:has(input:checked) { background: var(--primary); border-color: var(--primary); color: #fff; }
.count-picker label:has(input:focus-visible) { outline: 4px solid var(--focus); outline-offset: 2px; }
.balloon-row { display: flex; align-items: flex-end; justify-content: flex-start; gap: 8px; min-height: 76px; margin: 4px 0 12px; }
.balloon-row > span { display: block; animation: pop-in .4s ease-out both, float 4s ease-in-out .4s infinite; }
.balloon-row > span:nth-child(2n) { animation-delay: 0s, -1.3s; }
.balloon-row svg { display: block; }
[hidden] { display: none !important; }
@keyframes pop-in { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* Numbers grid */
.legend { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; list-style: none; padding: 0; }
.number-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; list-style: none; padding: 0; }
.tile { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 78px; border-radius: var(--radius-sm); text-decoration: none; border: 2px solid currentColor; font-weight: 700; transition: transform .15s ease; }
a.tile:hover { transform: translateY(-3px); }
.tile .n { font-family: var(--display); font-size: 1.35rem; line-height: 1.1; }
.tile .w { font-size: .82rem; }
.tile.paid { color: var(--paid); background: var(--paid-bg); }
.tile.due_soon { color: var(--due); background: var(--due-bg); }
.tile.in_grace { color: var(--grace); background: var(--grace-bg); }
.tile.to_be_released { color: var(--release); background: var(--release-bg); }
.tile.free { color: var(--free); background: #fff; border-style: dashed; }
label.tile { cursor: pointer; position: relative; }
label.tile input { position: absolute; opacity: 0; }
label.tile:has(input:checked) { background: var(--primary); color: #fff; border-style: solid; }
label.tile .w-on { display: none; }
label.tile:has(input:checked) .w-on { display: inline; }
label.tile:has(input:checked) .w-off { display: none; }
label.tile:has(input:focus-visible) { outline: 4px solid var(--focus); outline-offset: 2px; }

.search-form { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; align-items: flex-end; }
.search-form input { flex: 1 1 260px; }
.letters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; padding: 0; list-style: none; }
.letters a { display: inline-flex; min-width: 44px; min-height: 44px; align-items: center; justify-content: center; border-radius: 14px; text-decoration: none; font-weight: 700; background: var(--soft); border: 2px solid transparent; }
.letters a:hover { border-color: var(--primary); }
.letters a[aria-current="true"] { background: var(--primary); color: #fff; }

/* Lists of things to choose (search results, applications) */
.todo-list { list-style: none; padding: 0; margin: 0 0 32px; display: grid; gap: 12px; }
.todo-list a, .todo-list .todo { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 18px 24px; min-height: 72px; background: var(--surface); border-radius: var(--radius-sm); font-size: 1.1rem; font-weight: 700; text-decoration: none; color: var(--text); box-shadow: var(--shadow); transition: transform .2s ease, box-shadow .2s ease; }
.todo-list a:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.todo-list .todo-go { margin-left: auto; color: var(--primary); white-space: nowrap; }
.todo-list .calm { background: #EAF6E6; color: #1E4D17; box-shadow: none; }

.timeout-warning { position: fixed; left: 16px; right: 16px; bottom: 16px; max-width: 640px; margin: 0 auto; background: #fff; border-radius: var(--radius); padding: 20px 24px; box-shadow: 0 10px 40px rgba(0, 0, 0, .25), inset 0 0 0 4px var(--accent); z-index: 20; font-weight: 700; font-size: 1.1rem; }
.site-footer { text-align: center; color: var(--muted); padding: 24px 16px 40px; font-size: .95rem; }

@media (max-width: 640px) {
  h1 { font-size: 1.7rem; }
  .hero h1 { font-size: 2rem; }
  .hero-art { width: 170px; margin: -8px 0 0 auto; }
  .hero { padding-top: 20px; gap: 0; }
  .sky.tall { padding-bottom: 110px; }
  .main-nav { margin-left: 0; width: 100%; }
  .main-nav ul { border-radius: 24px; justify-content: center; }
  .main-nav a { padding: 0 14px; font-size: 1rem; }
  dl.details { grid-template-columns: 1fr; }
  dl.details dd { margin-bottom: 8px; }
  .button-row .button, .button-row button { flex: 1 1 100%; }
  .page-panel, .card { padding: 20px; }
  main { padding: 0 16px 48px; }
  .topbar, .hero, .account-bar { padding-left: 16px; padding-right: 16px; }
  table.list.stack thead { display: none; }
  table.list.stack tr { display: block; border-bottom: 2px solid var(--border); padding: 8px 0; }
  table.list.stack td { display: block; border: none; padding: 4px 14px; }
}

/* Less motion for anyone who asks for it in their device settings */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .button:hover, button:hover, a.job-card:hover, a.tile:hover, .todo-list a:hover, .choice-buttons button:hover { transform: none; }
}

@media print {
  .sky, .main-nav, .account-bar, .button-row, .no-print, .site-footer, .timeout-warning { display: none !important; }
  body { background: #fff; }
  main { padding: 0; margin: 0; max-width: none; }
  .card, .page-panel, table.list { box-shadow: none; border: 1px solid #999; break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
}
