/* GMG Portal styles. Plain CSS, no build step. */
:root {
  --brand: #276955;
  --brand-dark: #1c4d3e;
  --brand-tint: #e8f2ee;
  --ink: #1d2523;
  --muted: #5b6763;
  --line: #d9e0dd;
  --bg: #f5f7f6;
  --card: #ffffff;
  --warn-bg: #fff5d6; --warn-ink: #7a5600;
  --ok-bg: #dff3e7;   --ok-ink: #1d6b3d;
  --bad-bg: #fbe4e2;  --bad-ink: #9b2c22;
  --grey-bg: #eceff0; --grey-ink: #4c5659;
  --radius: 10px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
a { color: var(--brand); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .6rem; }
h1 { font-size: 1.7rem; }
h2 { font-size: 1.25rem; margin-top: 1.6rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1rem; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }

/* Header */
.site-header { background: var(--brand); color: #fff; }
.site-header.staff { background: #213a33; }
.header-inner { max-width: 1100px; margin: 0 auto; padding: .7rem 16px; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: .6rem; white-space: nowrap; color: #fff; text-decoration: none; font-weight: 600; }
.brand img { height: 40px; width: auto; }
.brand .tag { font-size: .75rem; background: rgba(255,255,255,.18); padding: .1rem .5rem; border-radius: 99px; }
.nav { display: flex; gap: .2rem; flex-wrap: wrap; margin-left: auto; align-items: center; }
.nav a, .nav button { color: #fff; text-decoration: none; padding: .4rem .55rem; border-radius: 6px; font: inherit; font-size: .92rem; background: none; border: 0; cursor: pointer; }
.nav a:hover, .nav button:hover, .nav a.active { background: rgba(255,255,255,.15); }
.nav form { margin: 0; }
.count { display: inline-block; min-width: 1.4em; padding: 0 .4em; margin-left: .25em; border-radius: 99px; background: #f2c94c; color: #3a2d00; font-size: .78rem; font-weight: 700; text-align: center; }

/* Layout */
main { max-width: 1100px; margin: 0 auto; padding: 1.5rem 16px 3rem; }
.narrow { max-width: 560px; margin: 0 auto; }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.two-col { display: grid; gap: 1.5rem; grid-template-columns: 2fr 1fr; align-items: start; }
@media (max-width: 800px) { .two-col { grid-template-columns: 1fr; } }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.page-head h1 { margin: 0; }
.crumbs { font-size: .9rem; margin-bottom: .4rem; }
.crumbs a { text-decoration: none; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; }
.card + .card { margin-top: 1rem; }
.card h2:first-child, .card h3:first-child { margin-top: 0; }
.course-card { display: flex; flex-direction: column; }
.course-card .meta { margin-top: auto; padding-top: .8rem; display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; }
.hero { background: var(--brand-tint); border-radius: var(--radius); padding: 2rem 1.5rem; margin-bottom: 1.5rem; }
.hero h1 { font-size: 2rem; }
.locked { background: var(--grey-bg); border-radius: var(--radius); padding: 1rem 1.2rem; color: var(--grey-ink); }

/* Buttons */
.btn { display: inline-block; white-space: nowrap; background: var(--brand); color: #fff; border: 1px solid var(--brand); padding: .55rem 1rem; border-radius: 8px; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; line-height: 1.3; }
.btn:hover { background: var(--brand-dark); }
.btn.secondary { background: #fff; color: var(--brand); }
.btn.secondary:hover { background: var(--brand-tint); }
.btn.danger { background: #fff; color: var(--bad-ink); border-color: #e3b3ae; }
.btn.danger:hover { background: var(--bad-bg); }
.btn.small { padding: .3rem .65rem; font-size: .875rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }

/* Badges */
.badge { display: inline-block; padding: .1rem .6rem; border-radius: 99px; font-size: .8rem; font-weight: 600; white-space: nowrap; }
.badge.pending { background: var(--warn-bg); color: var(--warn-ink); }
.badge.approved, .badge.open { background: var(--ok-bg); color: var(--ok-ink); }
.badge.declined, .badge.cancelled, .badge.full { background: var(--bad-bg); color: var(--bad-ink); }
.badge.grey { background: var(--grey-bg); color: var(--grey-ink); }

/* Tables */
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .65rem .8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); background: #fafbfb; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; }
.empty { padding: 1.5rem; text-align: center; color: var(--muted); }

dl.details { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1.2rem; margin: 0; }
dl.details dt { color: var(--muted); }
dl.details dd { margin: 0; }

/* Tabs */
.tabs { display: flex; gap: .3rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tabs a { padding: .4rem .8rem; border-radius: 99px; text-decoration: none; color: var(--ink); background: #fff; border: 1px solid var(--line); font-size: .9rem; }
.tabs a.active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* Forms */
form .field { margin-bottom: 1rem; }
label { display: block; font-weight: 600; margin-bottom: .3rem; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=tel], input[type=search],
input[type=datetime-local], input[type=file], select, textarea {
  width: 100%; padding: .55rem .7rem; border: 1px solid #b9c4c0; border-radius: 8px; font: inherit; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }
.field.checkbox { display: flex; gap: .6rem; align-items: flex-start; }
.field.checkbox label { font-weight: 400; order: 2; margin: 0; }
.field.checkbox input { margin-top: .3rem; }
.helptext, .field .help { display: block; font-size: .85rem; color: var(--muted); margin-top: .25rem; }
.errorlist { list-style: none; padding: 0; margin: .3rem 0 0; color: var(--bad-ink); font-size: .9rem; }
.searchbar { display: flex; gap: .5rem; margin-bottom: 1rem; }
.searchbar input { max-width: 360px; }

/* Messages */
.messages { list-style: none; padding: 0; margin: 0 0 1rem; }
.messages li { padding: .75rem 1rem; border-radius: 8px; margin-bottom: .5rem; background: var(--brand-tint); }
.messages li.success { background: var(--ok-bg); color: var(--ok-ink); }
.messages li.error { background: var(--bad-bg); color: var(--bad-ink); }
.messages li.warning { background: var(--warn-bg); color: var(--warn-ink); }

.site-footer { text-align: center; color: var(--muted); font-size: .85rem; padding: 2rem 16px; }
.pre { white-space: pre-line; }

/* Trainer area */
.site-header.trainer { background: #2f4f6b; }

/* Stat tiles on dashboards */
.stats { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 1.5rem; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem; text-decoration: none; color: var(--ink); display: grid; gap: .1rem; }
.stat:hover { border-color: var(--brand); }
.stat .n { font-size: 1.7rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat .l { font-size: .85rem; color: var(--muted); }
.stat.attention .n { color: var(--warn-ink); }

/* People rows on the booking form */
.person { border: 1px solid var(--line); border-radius: 8px; padding: .9rem; margin-bottom: .8rem; background: #fafbfb; }
.person-grid { display: grid; gap: 0 .8rem; grid-template-columns: 1fr 1fr; }
@media (max-width: 560px) { .person-grid { grid-template-columns: 1fr; } }
.person-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .4rem; }
.linklike { background: none; border: 0; color: var(--bad-ink); cursor: pointer; font: inherit; font-size: .875rem; padding: 0; }

/* Register */
.register select, .register input[type=text] { padding: .35rem .5rem; font-size: .9rem; }
.register td { vertical-align: middle; }

/* Radio ratings */
.field ul { list-style: none; padding: 0; margin: 0; display: flex; gap: .4rem; flex-wrap: wrap; }
.field ul li label { font-weight: 400; display: inline-flex; gap: .35rem; align-items: center; padding: .35rem .7rem; border: 1px solid var(--line); border-radius: 99px; background: #fff; cursor: pointer; margin: 0; }
.badge.paid { background: var(--ok-bg); color: var(--ok-ink); }
.badge.invoice_sent { background: var(--warn-bg); color: var(--warn-ink); }
.badge.not_invoiced, .badge.no_charge { background: var(--grey-bg); color: var(--grey-ink); }
.badge.pass { background: var(--ok-bg); color: var(--ok-ink); }
.badge.fail { background: var(--bad-bg); color: var(--bad-ink); }

@media print {
  .site-header, .site-footer, .no-print, .messages { display: none !important; }
  body { background: #fff; }
  main { padding: 0; max-width: none; }
  .card, .table-wrap { border: 0; }
}

/* Grouped forms */
.medium { max-width: 760px; margin: 0 auto; }
fieldset.section { border: 0; padding: 0; margin: 0 0 1.4rem; }
fieldset.section legend { font-weight: 700; font-size: 1.05rem; margin-bottom: .6rem; padding: 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.form-grid .field.wide { grid-column: 1 / -1; }
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } }
.req { color: var(--bad-ink); }
.steps-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: .4rem; margin: .6rem 0 1rem; }
.steps-row div { border-top: 4px solid var(--line); padding-top: .4rem; font-size: .82rem; color: var(--muted); }
.steps-row div.done { border-color: var(--brand); color: var(--ink); }
@media (max-width: 600px) { .steps-row { grid-template-columns: 1fr 1fr; } }
.money { font-variant-numeric: tabular-nums; }
.section-title { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.badge.pay-awaiting, .badge.pay-no_charge { background: var(--grey-bg); color: var(--grey-ink); }
.badge.pay-deposit_sent, .badge.pay-balance_sent { background: var(--warn-bg); color: var(--warn-ink); }
.badge.pay-deposit_paid { background: #e3eefb; color: #23507e; }
.badge.pay-paid { background: var(--ok-bg); color: var(--ok-ink); }
[hidden] { display: none !important; }

/* Invoice */
.doc { max-width: 820px; margin: 0 auto; padding: 2rem; }
.doc-head { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: flex-start; }
.doc-logo { height: 56px; width: auto; }
.doc-from { text-align: right; }
.doc-meta { display: flex; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; }
.doc-meta .label { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
tfoot td, tfoot th { background: #fafbfb; }

/* Certificate */
.certificate { max-width: 860px; margin: 0 auto; background: #fff; border: 10px double var(--brand); padding: 3rem 2rem; text-align: center; }
.certificate p { margin: 0 0 .6rem; }
.cert-logo { height: 70px; width: auto; margin-bottom: 1rem; }
.cert-kicker { text-transform: uppercase; letter-spacing: .18em; color: var(--brand); font-weight: 700; }
.cert-small { color: var(--muted); }
.cert-name { font-size: 2.2rem; font-family: Georgia, "Times New Roman", serif; margin: .4rem 0 .8rem !important; }
.cert-course { font-size: 1.5rem; font-weight: 700; }
.cert-meta { display: flex; justify-content: center; gap: 2rem; flex-wrap: wrap; margin: 2rem 0 1.5rem; }
.cert-meta dt { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.cert-meta dd { margin: 0; font-weight: 600; }
@media print { .certificate { border-width: 8px; } }

/* Second row of staff links for the section you're in */
.subnav { background: #2c4a41; }
.subnav .header-inner { padding-top: .25rem; padding-bottom: .25rem; gap: .2rem; }
.subnav a { color: #e6efeb; text-decoration: none; padding: .3rem .6rem; border-radius: 6px; font-size: .88rem; }
.subnav a:hover { background: rgba(255,255,255,.12); color: #fff; }

/* Event statuses */
.badge.submitted { background: var(--warn-bg); color: var(--warn-ink); }
.badge.quoted { background: #e3eefb; color: #23507e; }
.badge.accepted { background: var(--ok-bg); color: var(--ok-ink); }
.badge.quote_declined, .badge.refused { background: var(--bad-bg); color: var(--bad-ink); }

/* Tick-box groups on the event form */
.field .ticks ul, .field ul.ticks { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .4rem .8rem; }
.field ul li label { border-radius: 8px; }
.field.ticks ul li label { width: 100%; height: 100%; align-items: flex-start; }
.field.ticks ul li label input { margin-top: .25rem; }
.rows-table { width: 100%; }
.rows-table td, .rows-table th { padding: .35rem .4rem; }
.rows-table input, .rows-table select { padding: .35rem .45rem; font-size: .9rem; }
.form-section { border-top: 1px solid var(--line); padding-top: 1.2rem; margin-top: .4rem; }
.form-section:first-of-type { border-top: 0; padding-top: 0; }
.form-section h2 { margin: 0 0 .8rem; font-size: 1.1rem; display: flex; align-items: center; gap: .5rem; }
.form-section h2 .num { display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--brand-tint); color: var(--brand); font-size: .85rem; }
.intro { background: var(--brand-tint); border-radius: var(--radius); padding: 1rem 1.2rem; margin-bottom: 1.2rem; }
.intro p:last-child { margin-bottom: 0; }
.month { margin-top: 1.4rem; }
.cal-row { display: grid; grid-template-columns: 5.5rem 1fr auto; gap: 1rem; align-items: start; }
.cal-date { text-align: center; border: 1px solid var(--line); border-radius: 8px; padding: .3rem; background: #fafbfb; }
.cal-date .d { font-size: 1.5rem; font-weight: 700; line-height: 1.1; }
.cal-date .m { font-size: .75rem; text-transform: uppercase; color: var(--muted); }
@media (max-width: 600px) { .cal-row { grid-template-columns: 4rem 1fr; } .cal-row > :last-child { grid-column: 2; } }
.chips { display: flex; flex-wrap: wrap; gap: .3rem; }
.chip { font-size: .8rem; padding: .1rem .55rem; border-radius: 99px; background: var(--grey-bg); color: var(--grey-ink); }
.field.ticks > div[id] { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .35rem 1rem; }
.field.ticks > div[id] label { font-weight: 400; display: flex; gap: .45rem; align-items: flex-start; margin: 0; }
.field.ticks > div[id] label input { margin-top: .3rem; }
.rows-table { min-width: 640px; }
.grid > .card + .card { margin-top: 0; }

/* Home page service cards */
.services-head { margin-bottom: 1rem; }
.services-head h2 { margin-bottom: .2rem; }
.services-head p { margin: 0; }
.service-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1000px) { .service-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .service-grid { grid-template-columns: 1fr; } }
.service-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .15s, transform .15s; }
.service-card:hover { box-shadow: 0 8px 24px rgba(23, 60, 48, .12); transform: translateY(-2px); }
.service-card img { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; background: var(--brand-tint); }
.service-card .body { padding: 1rem 1.1rem 1.2rem; display: flex; flex-direction: column; flex: 1; }
.service-card h3 { margin: 0 0 .3rem; font-size: 1.1rem; }
.service-card p { margin: 0 0 .6rem; }
.service-card .meta { margin-top: auto; padding-top: .6rem; }
.service-card.soon img { filter: saturate(.55); opacity: .85; }
.ticks-list { list-style: none; padding: 0; margin: 0 0 .4rem; display: grid; gap: .3rem; font-size: .9rem; }
.ticks-list li { padding-left: 1.5rem; position: relative; }
.ticks-list li::before { content: ""; position: absolute; left: .2rem; top: .45em; width: .7rem; height: .38rem; border-left: 2px solid var(--brand); border-bottom: 2px solid var(--brand); transform: rotate(-45deg); }
@media (prefers-reduced-motion: reduce) { .service-card, .service-card:hover { transition: none; transform: none; } }

/* Back button, shown at the top of every page except the start pages */
.back-bar { margin: -.4rem 0 1rem; display: flex; gap: .5rem; flex-wrap: wrap; }
.back-link { display: inline-flex; align-items: center; gap: .35rem; padding: .35rem .8rem; border: 1px solid var(--line); border-radius: 99px; background: var(--card); color: var(--brand); font-size: .9rem; font-weight: 600; text-decoration: none; }
.back-link:hover { border-color: var(--brand); background: var(--brand-tint); }

/* Upcoming course dates list */
.filter-chips { margin: 0 0 1rem; }
.filter-chips .chip { text-decoration: none; color: var(--ink); }
.filter-chips .chip.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.date-list { display: grid; gap: .6rem; }
.date-row { display: grid; grid-template-columns: 4.2rem minmax(0, 1fr) 12rem auto; gap: 1rem; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem; }
.date-row.is-full { opacity: .7; }
.date-tile { display: grid; justify-items: center; background: var(--brand); color: #fff; border-radius: 8px; padding: .35rem 0; line-height: 1.1; }
.date-tile .dow, .date-tile .mon { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; }
.date-tile .day { font-size: 1.5rem; font-weight: 700; }
.date-info h3 { margin: 0 0 .15rem; font-size: 1.05rem; }
.date-info h3 a { text-decoration: none; color: var(--ink); }
.date-info p { margin: 0; }
.date-places { display: grid; gap: .3rem; font-variant-numeric: tabular-nums; }
.places { font-size: .9rem; }
.places.low { color: var(--warn-ink); }
.places-bar { display: block; height: 6px; border-radius: 99px; background: var(--brand-tint); overflow: hidden; }
.places-bar span { display: block; height: 100%; background: var(--brand); }
.places.low + .places-bar span { background: #e0a800; }
@media (max-width: 760px) {
  .date-row { grid-template-columns: 3.6rem minmax(0, 1fr); }
  .date-places, .date-action { grid-column: 2; }
}

/* Terms and privacy pages */
.legal h2 { font-size: 1.1rem; }
.legal h3 { font-size: 1rem; margin: 1.2rem 0 .3rem; }
.legal li { margin-bottom: .3rem; }
.legal address { font-style: normal; margin: .5rem 0 1rem; }
.site-footer a { color: inherit; }

/* Falls response waiting list */
.meta-row { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.falls-intro { display: grid; grid-template-columns: 14rem 1fr; gap: 1.5rem; align-items: center; max-width: 760px; margin: 0 auto 1.5rem; }
.falls-intro img { width: 100%; max-width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: var(--radius); }
.falls-intro h1 { margin: .4rem 0 .3rem; }
.falls-intro p { margin: 0 0 .5rem; }
@media (max-width: 600px) { .falls-intro { grid-template-columns: 1fr; } .falls-intro img { max-width: 14rem; } }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
#id_for_whom { display: grid; gap: .35rem; margin-top: .2rem; }
#id_for_whom label { font-weight: 400; display: flex; gap: .5rem; align-items: center; margin: 0; }
#id_for_whom input { width: auto; }
