/* ==========================================================================
   MoneyHelper theme for GOV.UK Frontend
   ==========================================================================
   GENERATED by packages/tokens/theme.mjs — do not edit by hand.

   Apply AFTER govuk-frontend.css. It only overrides; it adds no components and
   changes no markup, so the GOV.UK Design System structure and accessibility
   behaviour are preserved.

   Every value is tagged with the Penpot token it came from. Contrast for every
   text pair was verified — see packages/tokens/PENPOT-TOKENS.md.

   Brand values, component tokens and derived values are all sourced from the
   Zeroheight design system. To regenerate: npm run build
   ========================================================================== */

/* --------------------------------------------------------------------------
   Fonts
   --------------------------------------------------------------------------
   @font-face is declared for BOTH families.

   Manrope is self-hosted (see public/fonts/). Roobert points at a file we do
   not ship, because it is licensed and has to come from MaPS. Until that file
   exists the browser fails to load it and falls through to Manrope — so this
   is correct before and after the brand font is added, with no code change.

   To activate Roobert: drop Roobert-Regular.woff2 (plus Bold, if licensed) into
   public/fonts/. Nothing else needs editing.
   -------------------------------------------------------------------------- */

@font-face {
  font-family: "Roobert";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("https://moneyhelper-prototype-builder.pages.dev/fonts/Roobert-Regular.woff2") format("woff2");
}

@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("https://moneyhelper-prototype-builder.pages.dev/fonts/manrope-latin-variable.woff2") format("woff2-variations");
}

/* --------------------------------------------------------------------------
   1. Tokens as custom properties
   -------------------------------------------------------------------------- */

:root {
  /* Brand and surfaces */
  --mh-colour-brand: #C82A87;
  --mh-colour-brand-hover: #951F65;
  --mh-colour-brand-dark: #631543;
  --mh-colour-text: #030625;
  --mh-colour-text-secondary: #4B5089;
  --mh-colour-border: #CECFE4;
  --mh-colour-surface: #F1F2FE;
  --mh-colour-template: #F5F5FA;
  --mh-colour-error: #CC0000;
  --mh-colour-success: #006637;

  /* Focus */
  --mh-colour-focus: #F0F05A;
  --mh-colour-focus-text: #0F19A0;

  /* Typography. Base is 18px, not the usual 16px. */
  --mh-font-family: "Roobert", "Manrope", "Helvetica Neue", Helvetica, Arial, sans-serif;

  /* Spacing. 8px base unit. */
  --mh-space-unit: 8px;
  --mh-space-16: 16px;
  --mh-space-24: 24px;
  --mh-space-32: 32px;
  --mh-space-48: 48px;

  --mh-radius-button: 4px;

  /* Re-point GOV.UK's own custom properties. Because GOV.UK Frontend v6 emits
     --govuk-*-colour and references them with a fallback, overriding them here
     re-themes the whole stylesheet without recompiling Sass. */
  --govuk-brand-colour: var(--mh-colour-brand);
  --govuk-text-colour: var(--mh-colour-text);
  --govuk-secondary-text-colour: var(--mh-colour-text-secondary);
  --govuk-border-colour: var(--mh-colour-border);
  --govuk-input-border-colour: #60637E;
  --govuk-hover-colour: var(--mh-colour-border);
  --govuk-error-colour: var(--mh-colour-error);
  --govuk-success-colour: var(--mh-colour-success);
  --govuk-focus-colour: var(--mh-colour-focus);
  --govuk-focus-text-colour: var(--mh-colour-focus-text);
  --govuk-link-colour: var(--mh-colour-brand);
  --govuk-link-hover-colour: var(--mh-colour-brand-hover);
  --govuk-link-visited-colour: #7E00CC;
  --govuk-link-active-colour: #300A21;
  --govuk-template-background-colour: var(--mh-colour-template);
  --govuk-body-background-colour: #FFFFFF;
  --govuk-surface-background-colour: var(--mh-colour-surface);
  --govuk-surface-border-colour: #B9BDF8;
}

/* --------------------------------------------------------------------------
   2. Typography
   -------------------------------------------------------------------------- */

body,
.govuk-template__body {
  font-family: var(--mh-font-family);
  /* The design system sets a larger base size than the browser default. */
  font-size: 18px;
  line-height: 1.55556;
}

/* CRITICAL: GOV.UK Frontend sets font-family explicitly on every typography
   class rather than letting it inherit. The rule for .govuk-heading-xl reads
   font-family:"GDS Transport",arial,sans-serif. Setting the family on <body>
   alone therefore leaves every heading still rendering in GDS Transport.

   GOV.UK also emits a second, bare rule declaring sans-serif for print, so the
   family has to be named on each class rather than inherited. Hence this list. */
.govuk-heading-xl,
.govuk-heading-l,
.govuk-heading-m,
.govuk-heading-s,
.govuk-caption-xl,
.govuk-caption-l,
.govuk-caption-m,
.govuk-body,
.govuk-body-l,
.govuk-body-m,
.govuk-body-s,
.govuk-list,
.govuk-label,
.govuk-hint,
.govuk-error-message,
.govuk-fieldset__legend,
.govuk-inset-text,
.govuk-warning-text__text,
.govuk-summary-list,
.govuk-summary-list__key,
.govuk-summary-list__value,
.govuk-table,
.govuk-table__header,
.govuk-table__cell,
.govuk-details__summary-text,
.govuk-details__text,
.govuk-tag,
.govuk-panel__title,
.govuk-panel__body,
.govuk-button,
.govuk-input,
.govuk-textarea,
.govuk-select,
.govuk-checkboxes__label,
.govuk-checkboxes__hint,
.govuk-radios__label,
.govuk-radios__hint,
.govuk-error-summary__title,
.govuk-error-summary__body,
.govuk-notification-banner__title,
.govuk-notification-banner__heading,
.govuk-task-list__name-and-hint,
.govuk-task-list__status,
.govuk-accordion__section-heading,
.govuk-accordion__section-content,
.govuk-footer,
.govuk-header,
.govuk-service-navigation {
  font-family: var(--mh-font-family);
}

/* Headings are larger than GOV.UK's scale. */
.govuk-heading-xl { font-size: 34px; line-height: 1.5; font-weight: 700; }
.govuk-heading-l  { font-size: 28px; line-height: 1.5; font-weight: 700; }
.govuk-heading-m  { font-size: 24px; line-height: 1.5; font-weight: 700; }
.govuk-heading-s  { font-size: 22px; line-height: 1.5; font-weight: 700; }

@media (min-width: 40.0625em) {
  .govuk-heading-xl { font-size: 56px; line-height: 1.19643; }
  .govuk-heading-l  { font-size: 44px; }
  .govuk-heading-m  { font-size: 34px; }
  .govuk-heading-s  { font-size: 24px; }
}

.govuk-body,
.govuk-body-m { font-size: 18px; line-height: 1.55556; }
.govuk-body-l { font-size: 20px; line-height: 1.5; }
.govuk-body-s { font-size: 16px; line-height: 1.625; }
.govuk-list    { font-size: 18px; line-height: 1.55556; }

@media (min-width: 40.0625em) {
  .govuk-body-l { font-size: 24px; }
}

/* Links: weight 500 and a thicker underline than GOV.UK uses. */
.govuk-link,
.govuk-link:link,
.govuk-link:visited,
a:not([class]) {
  font-weight: 500;
  text-underline-offset: 0.15em;
  text-decoration-thickness: 1px;
}

/* --------------------------------------------------------------------------
   3. Generic header — the header for services NOT on GOV.UK
   --------------------------------------------------------------------------
   govuk.generic-header.background is #0B0C0C: a solid near-black bar, not the
   magenta in the older Penpot template and not GOV.UK blue. It carries no crown
   and no GOV.UK logotype, which is what the Service Manual requires of a
   service that is not part of GOV.UK.
   -------------------------------------------------------------------------- */

.govuk-generic-header {
  background-color: #0B0C0C;
  color: #FFFFFF;
  border-bottom: 0;
}

.govuk-generic-header__homepage-link,
.govuk-generic-header__homepage-link:link,
.govuk-generic-header__homepage-link:visited {
  color: #FFFFFF;
  font-size: 30px;
  line-height: 1;
  font-weight: 400;
  text-decoration: none;
}

/* The logo. The design system's header logotype is 30px tall, so the mark is
   constrained to that band and left to size itself by aspect ratio. */
.govuk-generic-header__logo-image {
  display: block;
  width: auto;
  max-width: 100%;
  /* 30px is the logotype height from the design system. */
  height: 30px;
}

@media (min-width: 40.0625em) {
  .govuk-generic-header__logo-image {
    height: 36px;
  }
}

.govuk-generic-header__homepage-link:focus {
  background-color: var(--mh-colour-focus);
  color: var(--mh-colour-focus-text);
  box-shadow: none;
  outline: 3px solid transparent;
}

/* Service navigation sits directly under the header. */
.govuk-service-navigation {
  border-bottom-color: var(--mh-colour-border);
}

/* --------------------------------------------------------------------------
   4. Buttons
   --------------------------------------------------------------------------
   The defining MoneyHelper difference: a 4px radius and a 2px solid bottom
   shadow instead of GOV.UK's hard 2px border. At rest the button is raised by
   2px; on :active it drops onto the shadow.
   -------------------------------------------------------------------------- */

.govuk-button {
  border: 0;
  border-radius: var(--mh-radius-button);
  box-shadow: 0 2px 0 #631543;
  background-color: #C82A87;
  color: #FFFFFF;
  font-family: var(--mh-font-family);
  font-size: 19px;
  line-height: 1;
  font-weight: 400;
}

.govuk-button:hover {
  background-color: #951F65;
}

.govuk-button:active {
  /* Drop onto the shadow rather than shifting the layout. */
  top: 2px;
  box-shadow: none;
}

.govuk-button--secondary {
  background-color: #FFFFFF;
  color: #C82A87;
  box-shadow: 0 2px 0 #5D63A6;
}

.govuk-button--secondary:hover {
  background-color: #FCF2F8;
}

.govuk-button--warning {
  background-color: #CC0000;
  color: #FFFFFF;
  box-shadow: 0 2px 0 #520000;
}

.govuk-button--warning:hover {
  background-color: #8F0000;
}

/* Inverse buttons appear on dark surfaces. */
.govuk-button--inverse {
  background-color: #FFFFFF;
  color: #1D70B8;
  box-shadow: 0 2px 0 #951F65;
}

.govuk-button--inverse:hover {
  background-color: #F4F8FB;
}

/* Start buttons are larger and bold. */
.govuk-button--start {
  font-size: 21px;
  font-weight: 700;
}

/* Focus: dark navy text on soft yellow, with the shadow kept so the button
   still reads as raised. */
.govuk-button:focus,
.govuk-button:focus:not(:active):not(:hover) {
  background-color: #F0F05A;
  color: #0F19A0;
  border-color: #F0F05A;
  box-shadow: 0 2px 0 #030625;
  outline: 3px solid transparent;
}

.govuk-button:disabled {
  opacity: 0.5;
  box-shadow: none;
}

.govuk-button-group .govuk-link {
  font-weight: 500;
}

/* --------------------------------------------------------------------------
   5. Focus treatments
   --------------------------------------------------------------------------
   Taken from the design system's shadow tokens rather than approximated, so the
   layered halo matches. The outer dark ring is what keeps the yellow visible
   against light backgrounds.
   -------------------------------------------------------------------------- */

.govuk-link:focus,
.govuk-link:focus:not(:active):not(:hover),
a:not([class]):focus {
  background-color: var(--mh-colour-focus);
  box-shadow: none;
  color: var(--mh-colour-focus-text);
  outline: 3px solid transparent;
  text-decoration: none;
}

.govuk-input:focus,
.govuk-textarea:focus,
.govuk-select:focus {
  outline: 3px solid transparent;
  box-shadow: 0 0 0 4px #F0F05A, inset 0 0 0 2px #0F19A0;
  border-color: var(--mh-colour-focus);
}

.govuk-checkboxes__input:focus + .govuk-checkboxes__label::before {
  box-shadow: 0 0 0 3px #F0F05A;
}

.govuk-radios__input:focus + .govuk-radios__label::before {
  box-shadow: 0 0 0 4px #F0F05A;
}

.govuk-details__summary:focus,
.govuk-accordion__section-button:focus,
.govuk-tabs__tab:focus {
  background-color: var(--mh-colour-focus);
  box-shadow: 0 0 0 8px #030625;
  color: var(--mh-colour-focus-text);
  outline: 3px solid transparent;
}

/* --------------------------------------------------------------------------
   6. Form controls
   -------------------------------------------------------------------------- */

.govuk-label,
.govuk-hint,
.govuk-fieldset__legend,
.govuk-error-message,
.govuk-form-group {
  font-family: var(--mh-font-family);
}

.govuk-input,
.govuk-textarea,
.govuk-select {
  border-color: #60637E;
  font-family: var(--mh-font-family);
  font-size: 18px;
}

.govuk-input--error,
.govuk-textarea--error,
.govuk-select--error {
  border-color: var(--mh-colour-error);
}

.govuk-label { font-size: 18px; font-weight: 500; }
.govuk-hint  { font-size: 16px; color: var(--mh-colour-text-secondary); }
.govuk-error-message { font-size: 16px; }

/* --------------------------------------------------------------------------
   7. Content, tables, tags and panels
   -------------------------------------------------------------------------- */

.govuk-table { font-size: 18px; }
.govuk-table__header { font-weight: 700; }

.govuk-summary-list__key { font-weight: 700; }
.govuk-summary-list,
.govuk-summary-list__value { font-size: 18px; }

.govuk-inset-text {
  border-left-color: var(--mh-colour-border);
  font-size: 18px;
}

.govuk-warning-text__icon {
  background-color: var(--mh-colour-text);
  border-color: var(--mh-colour-text);
  color: #FFFFFF;
}

.govuk-details__summary-text { font-weight: 500; }

.govuk-panel--confirmation {
  background-color: var(--mh-colour-success);
}

/* Tags, using the MoneyHelper ramps. */
.govuk-tag { border-radius: 2px; font-weight: 600; }
.govuk-tag--grey   { color: #2A2C4C; background-color: #E5E6F1; }
.govuk-tag--purple { color: #460071; background-color: #EFD6FF; }
.govuk-tag--blue   { color: #0B1272; background-color: #DADCFC; }
.govuk-tag--green  { color: #003D21; background-color: #D6FFEC; }
.govuk-tag--teal   { color: #103B3B; background-color: #DFF6F6; }
.govuk-tag--yellow { color: #463500; background-color: #FCFCDA; }
.govuk-tag--orange { color: #7A3C1C; background-color: #FDE4D7; }
.govuk-tag--red    { color: #520000; background-color: #FFD6D6; }
.govuk-tag--pink,
.govuk-tag--magenta { color: #631543; background-color: #F8DDED; }

/* --------------------------------------------------------------------------
   8. Footer
   -------------------------------------------------------------------------- */

.govuk-footer {
  border-top-color: var(--mh-colour-brand);
  background-color: var(--mh-colour-template);
  font-family: var(--mh-font-family);
}

.govuk-footer__link:link,
.govuk-footer__link:visited {
  color: var(--mh-colour-text);
}

/* The crest slot is intentionally left unstyled. A service not on GOV.UK must
   not use the crown; supply your own mark in its place. */
