/* Sport Wellbeing portal - "Six-Colour System" design.
   The six wellbeing categories are the visual language; everything else is ink on soft grey. */
:root {
  --ink: #1b2430; --ink-2: #3a4553; --muted: #4f5b69;
  --line: #c5ced9; --line-2: #dfe5ec; --line-3: #eceff3; --track: #e2e7ee;
  --bg: #f5f7fa; --card: #ffffff; --focus: #005aa3;
  --danger: #b00d30; --danger-bg: #ffe8ec; --danger-ink: #7a0a22; --ok: #1d6b36; --switch-on: #1f7a3d; --switch-off: #8a94a1;
  --mood: #8bc343; --res: #ff1344; --eng: #007cdc; --com: #f7bc09; --rel: #cc7bdc; --pos: #FD8344;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; } /* component display rules must never override the hidden attribute */
body.p { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 'Rubik', system-ui, -apple-system, 'Segoe UI', sans-serif; -webkit-text-size-adjust: 100%; }
a { color: var(--focus); }
a:hover { color: #003f73; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
h1, h2, h3 { margin: 0; line-height: 1.15; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.mono { font-family: 'Roboto Mono', ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 15px; }

/* Six-colour stripe and logo */
.stripe { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); height: 6px; }
.stripe.thin { height: 4px; }
.stripe i:nth-child(1), .dots6 i:nth-child(1) { background: var(--mood); }
.stripe i:nth-child(2), .dots6 i:nth-child(2) { background: var(--res); }
.stripe i:nth-child(3), .dots6 i:nth-child(3) { background: var(--eng); }
.stripe i:nth-child(4), .dots6 i:nth-child(4) { background: var(--com); }
.stripe i:nth-child(5), .dots6 i:nth-child(5) { background: var(--rel); }
.stripe i:nth-child(6), .dots6 i:nth-child(6) { background: var(--pos); }
.logo { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 19px; }
.logo:hover { color: var(--ink); }
.dots6 { display: grid; grid-template-columns: repeat(3, 10px); gap: 3px; }
.dots6 i { width: 10px; height: 10px; border-radius: 50%; display: block; }

/* Header, navigation, footer */
.p-header { background: var(--card); }
.p-header .inner, .p-footer .inner, .p-main { max-width: 1240px; margin: 0 auto; }
.p-header .inner { padding: 14px 24px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; }
.p-nav { display: flex; flex-wrap: wrap; gap: 6px; flex: 1 1 auto; }
.p-account { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.pill-link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 99px; color: var(--ink-2); font-weight: 600; text-decoration: none; }
.pill-link:hover { background: var(--bg); color: var(--ink); }
.pill-link[aria-current="page"] { background: var(--ink); color: #fff; }
.p-main { padding: 36px 24px 72px; display: flex; flex-direction: column; gap: 32px; }
.p-footer { background: var(--card); }
.p-footer .inner { padding: 20px 24px; display: flex; flex-wrap: wrap; gap: 8px 22px; color: var(--muted); font-size: 15px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; border-radius: 99px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn:hover { border-color: var(--ink-2); color: var(--ink); }
.btn-primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-primary:hover { background: #2d3a4a; border-color: #2d3a4a; color: #fff; }
.btn-primary[disabled] { background: #d5dce5; border-color: #d5dce5; color: var(--ink-2); cursor: not-allowed; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #8f0a27; border-color: #8f0a27; color: #fff; }
.btn-sm { min-height: 44px; padding: 0 14px; font-size: 14px; }
.btn-lg { min-height: 56px; font-size: 17px; font-weight: 700; }
.btn-block { width: 100%; }
.btn-icon { width: 44px; height: 44px; min-height: 44px; padding: 0; border-radius: 50%; color: var(--danger); }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--focus); text-decoration: underline; cursor: pointer; }

/* Cards, headings, chips, alerts */
.card { background: var(--card); border-radius: 28px; padding: 26px; }
.card-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 16px; margin-bottom: 18px; }
.p-title { font-size: 38px; font-weight: 700; }
.p-h2 { font-size: 26px; font-weight: 700; }
.intro { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; justify-content: space-between; }
.stat-chips { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.stat-chip { padding: 6px 14px; border-radius: 99px; background: var(--card); border: 1px solid var(--line-2); font-weight: 600; }
.alert { padding: 12px 16px; border-radius: 16px; background: var(--danger-bg); color: var(--danger-ink); font-weight: 600; margin: 0; }
.alert.info { background: #e3f0fc; color: #003f73; }
.alert ul { margin: 6px 0 0; padding-left: 20px; font-weight: 500; }
.empty { color: var(--muted); margin: 0; }

/* Category rings ("How your athletes are tracking") */
.segmented { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px; border-radius: 99px; background: #eef1f5; }
.segmented button { min-height: 40px; padding: 0 16px; border-radius: 99px; border: 0; background: transparent; color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; }
.segmented button[aria-pressed="true"] { background: var(--card); box-shadow: 0 1px 3px rgba(27, 36, 48, .18); }
.rings { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; }
.ring-item { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 18px 10px; border-radius: 22px; background: var(--tint); }
.ring { width: 112px; height: 112px; border-radius: 50%; background: conic-gradient(var(--c) calc(var(--pct) * 1%), #fff 0); display: flex; align-items: center; justify-content: center; }
.ring b { width: 84px; height: 84px; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 700; }
.ring-label { font-weight: 700; font-size: 18px; color: var(--t); }
.band { padding: 2px 12px; border-radius: 99px; background: #fff; font-size: 14px; font-weight: 600; }
.legend-note { margin: 18px 0 0; color: var(--muted); font-size: 14px; }

/* Survey group cards */
.groups { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 16px; }
.group-card { background: var(--card); border-radius: 24px; padding: 22px; display: flex; flex-direction: column; gap: 16px; }
.group-card.is-closed { opacity: .86; }
.group-top { display: flex; align-items: center; gap: 14px; }
.group-top .who { flex: 1 1 auto; min-width: 0; }
.group-name { font-weight: 700; font-size: 18px; overflow-wrap: anywhere; }
.avatar { flex: none; display: inline-flex; width: 52px; height: 52px; border-radius: 50%; align-items: center; justify-content: center; font-weight: 700; font-size: 17px; background: var(--tint); color: var(--t); }
.switch { flex: none; width: 56px; height: 32px; border-radius: 99px; border: 0; padding: 3px; background: var(--switch-off); cursor: pointer; display: flex; justify-content: flex-start; }
.switch[aria-checked="true"] { background: var(--switch-on); justify-content: flex-end; }
.switch span { width: 26px; height: 26px; border-radius: 50%; background: #fff; display: block; }
.creds { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; padding: 14px 16px; border-radius: 16px; background: var(--bg); }
.creds small { display: block; font-size: 13px; color: var(--muted); font-weight: 600; }
.creds .code { min-width: 130px; }
.creds .actions { display: flex; gap: 6px; }
.status { font-size: 14px; font-weight: 600; color: var(--muted); }
.status.open { color: var(--ok); }

/* Reports list */
.split { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.split > .wide { flex: 999 1 560px; min-width: 0; }
.split > .narrow { flex: 1 1 340px; min-width: 0; }
.reports { list-style: none; margin: 0; padding: 0; }
.report { padding: 16px 0; border-top: 1px solid var(--line-3); }
.report-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.report-row .what { flex: 1 1 240px; min-width: 0; }
.report-name { font-weight: 700; font-size: 17px; overflow-wrap: anywhere; }
.meta { color: var(--muted); font-size: 14px; }
.bars { flex: none; display: flex; align-items: flex-end; gap: 4px; height: 44px; padding: 0 2px; }
.bars i { width: 9px; border-radius: 4px 4px 0 0; display: block; background: var(--c); height: var(--h); }
.bars.unknown i { background: var(--track); height: 22px; border-radius: 4px; }
.report-actions { display: flex; gap: 8px; align-items: center; }
details.confirm > summary { list-style: none; }
details.confirm > summary::-webkit-details-marker { display: none; }
details.confirm[open] > summary { background: var(--danger-bg); }
.confirm-panel { margin-top: 12px; padding: 14px 16px; border-radius: 18px; background: var(--danger-bg); display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.confirm-panel strong { flex: 1 1 240px; color: var(--danger-ink); }

/* Forms: report builder and simple forms */
.form-stack { display: flex; flex-direction: column; gap: 18px; }
.step { display: flex; gap: 14px; }
.step-num { flex: none; display: inline-flex; width: 30px; height: 30px; border-radius: 50%; align-items: center; justify-content: center; font-weight: 700; background: var(--tint); color: var(--t); }
.step-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 8px; border: 0; margin: 0; padding: 0; }
.step-body > legend, .field-label { font-weight: 600; padding: 0; margin: 0 0 4px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.hint { margin: 0; color: var(--muted); font-size: 14px; }
.input { width: 100%; min-height: 46px; padding: 0 16px; border-radius: 99px; border: 1.5px solid var(--line); background: #fff; color: var(--ink); font: inherit; }
select.input { padding-right: 36px; }
.input.short { width: 76px; padding: 0 12px; }
.inline-fields { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { position: relative; display: inline-flex; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip span { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0 16px; border-radius: 99px; border: 1.5px solid var(--line); background: #fff; color: var(--ink); font-weight: 600; cursor: pointer; }
.chip.round span { width: 44px; padding: 0; border-radius: 50%; }
.chip input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.check-row { display: flex; align-items: center; gap: 10px; min-height: 40px; }
.check-row input { width: 20px; height: 20px; accent-color: var(--ink); flex: none; }

/* Narrow pages: sign-in, passwords, survey */
.narrow-main { max-width: 600px; margin: 0 auto; padding: 32px 20px 64px; display: flex; flex-direction: column; gap: 20px; }
.narrow-main .card { display: flex; flex-direction: column; gap: 18px; }
.center-head { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.big-tick { width: 72px; height: 72px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: #eef7e2; color: #3d6512; }

/* Athlete survey */
.survey-top { max-width: 600px; margin: 0 auto; padding: 14px 20px 6px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.survey-top .logo { font-size: 17px; }
.survey-top .dots6 { grid-template-columns: repeat(3, 8px); }
.survey-top .dots6 i { width: 8px; height: 8px; }
.progress { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.progress span { height: 10px; border-radius: 99px; background: var(--track); overflow: hidden; display: block; }
.progress span i { display: block; height: 100%; width: var(--w, 0%); background: var(--ink); border-radius: 99px; }
.progress-text { margin: 8px 0 0; font-size: 14px; color: var(--muted); font-weight: 500; }
.q-card { border: 0; margin: 0; padding: 22px 18px; border-radius: 28px; background: var(--card); display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.q-card legend { padding: 0; float: left; width: 100%; }
.q-lead { display: block; color: var(--muted); font-size: 15px; font-weight: 400; }
.q-text { display: block; margin: 4px 0 10px; font-size: 30px; line-height: 1.15; font-weight: 700; }
.answers { display: flex; flex-direction: column; gap: 10px; clear: both; }
.answer { position: relative; display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 0 16px; border-radius: 99px; background: var(--bg); border: 1.5px solid var(--track); cursor: pointer; font-size: 16px; font-weight: 600; }
.answer input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.answer .scale { display: flex; gap: 4px; flex: none; }
.answer .scale i { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--ink); display: block; }
.answer .scale i.on { background: var(--ink); }
.answer .tick { margin-left: auto; visibility: hidden; flex: none; }
.answer:has(input:checked) { background: var(--ink); border-color: var(--ink); color: #fff; }
.answer:has(input:checked) .scale i { border-color: #fff; }
.answer:has(input:checked) .scale i.on { background: #fff; }
.answer:has(input:checked) .tick { visibility: visible; }
.answer:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.survey-form { display: flex; flex-direction: column; gap: 16px; }
.survey-nav { display: flex; align-items: center; gap: 12px; }
.survey-nav .btn-primary { flex: 1 1 auto; }
.js .survey-form .q-card:not(.is-current) { display: none; }
.no-js .js-only, .js .no-js-only { display: none !important; }

@media (max-width: 640px) {
  .p-title { font-size: 30px; }
  .p-main { padding: 24px 16px 56px; gap: 24px; }
  .p-header .inner { padding: 12px 16px; }
  .card { padding: 20px; border-radius: 22px; }
  .q-text { font-size: 26px; }
}
@media (prefers-reduced-motion: no-preference) {
  .btn, .chip span, .answer, .switch { transition: background-color .15s, border-color .15s, color .15s; }
}

/* Report progress */
.working .dots6 { grid-template-columns: repeat(3, 14px); gap: 5px; }
.working .dots6 i { width: 14px; height: 14px; }
@media (prefers-reduced-motion: no-preference) {
  .working .dots6 i { animation: swb-pulse 1.2s ease-in-out infinite; }
  .working .dots6 i:nth-child(2) { animation-delay: .1s; } .working .dots6 i:nth-child(3) { animation-delay: .2s; }
  .working .dots6 i:nth-child(4) { animation-delay: .3s; } .working .dots6 i:nth-child(5) { animation-delay: .4s; }
  .working .dots6 i:nth-child(6) { animation-delay: .5s; }
}
@keyframes swb-pulse { 0%, 100% { transform: scale(.55); opacity: .45; } 50% { transform: scale(1); opacity: 1; } }
