/* The /trial pages in Public Digital's own style, replacing GOV.UK Frontend.
   Tokens are PD's design system (Downloads/Public Digital Design System, tokens/*.css):
   warm paper and ink, teal as the one accent, Lexend Deca at four weights, square corners,
   no shadows, flat colour instead of drawn borders. Form fields keep a visible edge, which
   PD's deck never needed and a form does (WCAG 1.4.11).

   Class names keep the shape the markup had under GOV.UK Frontend (pd-body, pd-heading-l,
   pd-details...), so trial.js and the page changed by name only. Layout and charts are in
   trial.css. No inline styles anywhere: the site CSP forbids them. */

@font-face { font-family: "Lexend Deca"; font-weight: 400; font-display: swap; src: url("/trial/fonts/LexendDeca-400.woff2") format("woff2"); }
@font-face { font-family: "Lexend Deca"; font-weight: 500; font-display: swap; src: url("/trial/fonts/LexendDeca-500.woff2") format("woff2"); }
@font-face { font-family: "Lexend Deca"; font-weight: 600; font-display: swap; src: url("/trial/fonts/LexendDeca-600.woff2") format("woff2"); }
@font-face { font-family: "Lexend Deca"; font-weight: 700; font-display: swap; src: url("/trial/fonts/LexendDeca-700.woff2") format("woff2"); }

:root {
  --pd-ink: #323131;
  --pd-paper: #f7f3f3;
  --pd-paper-2: #ece6e4;     /* one step darker, for code blocks and table stripes */
  --pd-white: #ffffff;
  --pd-teal: #7cc7d5;        /* the signature accent: shapes, and text on ink only */
  --pd-deep-teal: #0f7d75;   /* teal that passes contrast on paper (4.9:1) */
  --pd-gold: #e9ae21;        /* focus */
  --pd-coral: #e95342;
  --pd-near-black: #2c2c2c;
  --pd-link: #325b92;
  --pd-ink-2: #5e5b5b;       /* secondary text, 6.1:1 on paper */
  --pd-hairline: #d9d2d0;
  --pd-font: "Lexend Deca", Arial, sans-serif;
  color-scheme: light;
}

/* ---- base ---------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--pd-paper); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--pd-paper); color: var(--pd-ink); font-family: var(--pd-font); font-size: 18px; line-height: 1.55; }
img, video { max-width: 100%; }
b, strong { font-weight: 600; }
:focus-visible { outline: 3px solid var(--pd-gold); outline-offset: 0; }

.pd-skip-link { position: absolute; left: -9999px; top: 0; padding: 10px 15px; background: var(--pd-gold); color: var(--pd-ink); font-weight: 600; z-index: 10; }
.pd-skip-link:focus { left: 0; }
.pd-visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: 0; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }

.pd-width-container { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 641px) { .pd-width-container { padding: 0 32px; } }
.pd-main-wrapper { display: block; padding: 32px 0 64px; }

.pd-grid-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 40px; }
@media (min-width: 900px) {
  .pd-grid-row:has(> .pd-grid-column-one-half) { grid-template-columns: 1fr 1fr; }
  .pd-grid-column-two-thirds { max-width: 720px; }
}

/* ---- type: big and bold first, small and regular second ------------------------------- */
.pd-heading-xl, .pd-heading-l, .pd-heading-m { font-family: var(--pd-font); color: var(--pd-ink); margin: 0 0 20px; }
.pd-heading-xl { font-size: 36px; line-height: 1.1; font-weight: 700; letter-spacing: -0.01em; }
.pd-heading-l { font-size: 28px; line-height: 1.15; font-weight: 700; letter-spacing: -0.01em; }
.pd-heading-m { font-size: 21px; line-height: 1.25; font-weight: 600; margin-top: 32px; }
@media (min-width: 641px) {
  .pd-heading-xl { font-size: 52px; }
  .pd-heading-l { font-size: 36px; }
  .pd-heading-m { font-size: 24px; }
}
.pd-caption-l, .pd-caption-m { display: block; color: var(--pd-deep-teal); font-weight: 600; margin-bottom: 8px; }
.pd-caption-l { font-size: 18px; }
.pd-caption-m { font-size: 16px; }
/* PD's one ornament, the solid teal right triangle, marks each numbered section */
.pd-caption-m::before { content: ""; display: inline-block; width: 0; height: 0; border-style: solid; border-width: 0 0 12px 12px; border-color: transparent transparent var(--pd-teal) transparent; margin-right: 8px; }
.pd-body, .pd-body-l, .pd-body-s { margin: 0 0 20px; }
.pd-body-l { font-size: 21px; line-height: 1.45; }
@media (min-width: 641px) { .pd-body-l { font-size: 24px; } }
.pd-body-s { font-size: 16px; line-height: 1.5; }

.pd-link { color: var(--pd-link); text-decoration-thickness: 1px; text-underline-offset: 0.15em; }
.pd-link:hover { text-decoration-thickness: 3px; }
.pd-link:focus-visible { outline: none; background: var(--pd-gold); color: var(--pd-ink); text-decoration: none; box-shadow: 0 4px var(--pd-ink); }

.pd-list { margin: 0 0 20px; padding: 0; list-style: none; }
.pd-list > li { margin-bottom: 8px; }
.pd-list--bullet, .pd-list--number { padding-left: 22px; }
.pd-list--bullet { list-style: square; }
.pd-list--bullet > li::marker { color: var(--pd-deep-teal); }
.pd-list--number { list-style: decimal; }
.pd-list--number > li::marker { font-weight: 600; }

.pd-u-margin-bottom-0 { margin-bottom: 0 !important; }
.pd-u-margin-bottom-1 { margin-bottom: 5px !important; }
.pd-u-margin-bottom-2 { margin-bottom: 10px !important; }
.pd-u-font-weight-bold { font-weight: 600 !important; }
.pd-u-width-two-thirds { width: 100%; }
@media (min-width: 641px) { .pd-u-width-two-thirds { width: 66%; } }

/* ---- header and footer: flat ink, full bleed ------------------------------------------- */
.pd-header { background: var(--pd-ink); color: var(--pd-paper); }
.pd-header__container { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; padding-top: 16px; padding-bottom: 16px; }
.pd-header__title { color: var(--pd-paper); font-weight: 700; font-size: 20px; text-decoration: none; }
.pd-header__maker { display: inline-flex; align-items: center; gap: 10px; color: var(--pd-paper); font-size: 14px; text-decoration: none; }
.pd-header__maker img { display: block; height: 22px; width: auto; }
.pd-header a:hover { text-decoration: underline; }
.pd-header a:focus-visible { outline: 3px solid var(--pd-gold); outline-offset: 4px; }

.pd-footer { background: var(--pd-ink); color: var(--pd-paper); padding: 32px 0 40px; }
.pd-footer__container { display: grid; gap: 16px; }
.pd-footer__container img { height: 22px; width: auto; }
.pd-footer__text { margin: 0; font-size: 15px; max-width: 720px; }

/* the "Trial" strip under the header: PD's title tag, a small dark square label */
.pd-phase-banner { padding: 12px 0; border-bottom: 1px solid var(--pd-hairline); }
.pd-phase-banner__content { margin: 0; font-size: 16px; display: flex; gap: 12px; align-items: baseline; }
.pd-phase-banner__content__tag { flex: none; }
.pd-tag { display: inline-block; background: var(--pd-near-black); color: var(--pd-paper); font-size: 14px; font-weight: 500; line-height: 1; padding: 6px 10px 7px; }
.pd-tag--red { background: #b5372a; color: var(--pd-paper); font-weight: 600; } /* PD coral, darkened to 5.6:1 for small text */

/* ---- buttons ----------------------------------------------------------------------------- */
.pd-button { display: inline-block; font: 600 18px/1.2 var(--pd-font); color: var(--pd-paper); background: var(--pd-ink); border: 0; border-radius: 0; padding: 13px 20px; margin: 0 0 24px; cursor: pointer; text-decoration: none; -webkit-appearance: none; }
.pd-button:hover { background: var(--pd-near-black); text-decoration: underline; }
.pd-button:focus-visible { outline: 3px solid var(--pd-gold); outline-offset: 0; }
.pd-button--secondary { background: var(--pd-teal); color: var(--pd-ink); }
.pd-button--secondary:hover { background: #6bb7c6; }

/* ---- the dark panel: ink block, teal heading, for the things that matter most ------------ */
.pd-inset-text { background: var(--pd-ink); color: var(--pd-paper); padding: 24px; margin: 24px 0; }
.pd-inset-text .pd-tag { background: transparent; color: var(--pd-teal); padding: 0 0 10px; font-size: 16px; font-weight: 600; display: block; border-bottom: 1px solid var(--pd-paper); margin-bottom: 14px !important; }
.pd-inset-text .pd-body { color: var(--pd-paper); margin-bottom: 0; }

.pd-warning-text { display: flex; gap: 14px; align-items: center; margin: 0 0 24px; }
.pd-warning-text__icon { flex: none; display: grid; place-items: center; width: 34px; height: 34px; background: var(--pd-ink); color: var(--pd-paper); font-weight: 700; font-size: 22px; line-height: 1; }
.pd-warning-text__text { font-weight: 600; }

/* ---- details (the per-client setup steps, the source table) ------------------------------ */
.pd-details { margin: 0 0 12px; background: var(--pd-white); }
.pd-details__summary { cursor: pointer; padding: 14px 16px; font-weight: 600; color: var(--pd-ink); list-style: none; display: flex; gap: 12px; align-items: baseline; }
.pd-details__summary::-webkit-details-marker { display: none; }
.pd-details__summary::before { content: ""; flex: none; width: 0; height: 0; border-style: solid; border-width: 6px 0 6px 10px; border-color: transparent transparent transparent var(--pd-deep-teal); transform: translateY(1px); }
.pd-details[open] > .pd-details__summary::before { border-width: 10px 6px 0 6px; border-color: var(--pd-deep-teal) transparent transparent transparent; transform: translateY(-1px); }
.pd-details__summary:hover .pd-details__summary-text { text-decoration: underline; }
.pd-details__summary:focus-visible { outline: 3px solid var(--pd-gold); outline-offset: -3px; }
.pd-details__text { padding: 4px 16px 4px 38px; }

/* ---- table -------------------------------------------------------------------------------- */
.pd-table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 0 0 24px; }
.pd-table__header, .pd-table__cell { text-align: left; vertical-align: top; padding: 10px 16px 10px 0; border-bottom: 1px solid var(--pd-hairline); }
.pd-table__header { font-weight: 600; }
.pd-table__header--numeric, .pd-table__cell--numeric { text-align: right; font-variant-numeric: tabular-nums; }

/* ---- the video ---------------------------------------------------------------------------- */
.pd-video { margin: 8px 0 28px; }
.pd-video video { display: block; width: 100%; height: auto; background: var(--pd-paper-2); }
.pd-video figcaption { margin: 12px 0 0; color: var(--pd-ink-2); }
.pd-video figcaption b { color: var(--pd-ink); }

/* ---- forms ------------------------------------------------------------------------------- */
.pd-form-group { margin-bottom: 28px; }
.pd-fieldset { margin: 0; padding: 0; border: 0; }
.pd-label, .pd-fieldset__legend { display: block; font-size: 18px; margin-bottom: 6px; }
.pd-label--s, .pd-fieldset__legend--s { font-weight: 600; }
.pd-hint { color: var(--pd-ink-2); font-size: 16px; margin-bottom: 8px; }
.pd-input, .pd-textarea { display: block; width: 100%; font: 400 18px/1.4 var(--pd-font); color: var(--pd-ink); background: var(--pd-white); border: 2px solid var(--pd-ink); border-radius: 0; padding: 8px 10px; -webkit-appearance: none; }
.pd-textarea { resize: vertical; min-height: 96px; }
.pd-input:focus, .pd-textarea:focus { outline: 3px solid var(--pd-gold); outline-offset: 0; box-shadow: inset 0 0 0 2px var(--pd-ink); }
.pd-radios { display: flex; flex-wrap: wrap; gap: 8px 28px; }
.pd-radios__item { display: flex; align-items: center; gap: 10px; }
.pd-radios__input { width: 24px; height: 24px; margin: 0; accent-color: var(--pd-ink); }
.pd-radios__label { margin: 0; font-size: 18px; cursor: pointer; }

/* ---- the "feedback sent" confirmation (trial/thanks) -------------------------------------- */
.pd-panel { background: var(--pd-ink); color: var(--pd-paper); padding: 32px; margin: 0 0 32px; }
.pd-panel__title { margin: 0 0 8px; font-size: 36px; line-height: 1.1; font-weight: 700; }
.pd-panel__title::before { content: ""; display: block; width: 0; height: 0; border-style: solid; border-width: 0 0 28px 28px; border-color: transparent transparent var(--pd-teal) transparent; margin-bottom: 16px; }
.pd-panel__body { font-size: 21px; }
