:root {
  --navy: #14284b;
  --navy-dark: #0c1a33;
  --accent: #0b7a5b;
  --accent-dark: #075c44;
  --line: #b1b4b6;
  --yellow: #f2cf5b;
  --yellow-tint: #fffaf0;
  --yellow-soft: #fff4cc;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body,
button,
input,
textarea,
select,
summary,
details {
  font-family: var(--font);
}

html.govuk-template {
  background-color: #fff;
}

body {
  background: #fff;
  color: #14213a;
}

/* pages with a footer: keep it at the bottom of the window when the content is short */
.page-with-footer {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.page-with-footer .page-content {
  flex: 1 0 auto;
}

.site-header {
  background: var(--navy);
  color: #fff;
  /* optical centring: the lowercase body of the text sits below the capitals, and the yellow line takes 4px */
  padding: 13px 0 19px;
  border-bottom: 4px solid var(--yellow);
}
.site-header .govuk-width-container {
  display: flex;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
}
.site-header__name {
  font-weight: 700;
  font-size: 1.5rem;
}
.site-header__section {
  opacity: 0.8;
}

.govuk-heading-l,
.govuk-heading-m,
.govuk-fieldset__legend--m {
  color: var(--navy);
}

.govuk-link,
.govuk-link:visited {
  color: var(--navy);
}

/* single accent colour for the primary action */
.govuk-button:not(.govuk-button--secondary):not(.parent-toggle) {
  background-color: var(--accent);
  box-shadow: 0 2px 0 var(--accent-dark);
}
.govuk-button:not(.govuk-button--secondary):not(.parent-toggle):hover {
  background-color: var(--accent-dark);
}
.govuk-button--secondary {
  background-color: #eef1f6;
  color: var(--navy);
  box-shadow: 0 2px 0 #9aa6bd;
}
.govuk-button--secondary:hover {
  background-color: var(--yellow-soft);
  color: var(--navy);
}

/* the same gap before the first card as between two cards */
#intro {
  margin-bottom: 40px;
}

/* regular zones: same card, same spacing, same control heights */
.step:not(#step-parents) {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 40px;
  background: var(--yellow-tint);
}
#step-parents {
  margin-bottom: 40px;
}
/* a bordered fieldset draws its legend over the border: float the legend inside the card instead */
fieldset.step {
  min-width: 0;
}
fieldset.step > legend {
  float: left;
  width: 100%;
  padding: 0;
  margin-bottom: 20px;
}
fieldset.step > legend + * {
  clear: both;
}
.step .govuk-form-group:last-child {
  margin-bottom: 0;
}
.govuk-button {
  min-height: 48px;
}
.govuk-radios__item {
  min-height: 48px;
  margin-bottom: 24px;
}
.govuk-radios__item:last-child {
  margin-bottom: 0;
}

.choice-buttons {
  display: flex;
  gap: 10px;
}
.choice-button {
  flex: 1 1 0;
  min-width: 0;
  margin-bottom: 0;
  height: 72px;
  padding: 0;
  font-size: 1.75rem;
  font-weight: 700;
}
.choice-button[aria-pressed="true"] {
  background-color: var(--navy);
  color: #fff;
  box-shadow: 0 2px 0 var(--navy-dark);
}

/* parent blocks */
.parent-block {
  margin-bottom: 32px;
}
.parent-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: 0;
  height: 72px;
  padding: 0 24px;
  background-color: var(--navy);
  color: #fff;
  box-shadow: 0 2px 0 var(--navy-dark);
  font-size: 1.25rem;
}
.parent-toggle:hover {
  background-color: #1d3865;
}
.parent-state {
  font-size: 1rem;
  font-weight: 400;
}
.parent-body {
  border: 1px solid var(--line);
  border-top: 0;
  padding: 24px;
  background: var(--yellow-tint);
}

.tab-list {
  display: flex;
  gap: 6px;
  border-bottom: 2px solid var(--navy);
  margin-bottom: 24px;
}
.tab-button {
  flex: 1 1 0;
  min-width: 0;
  font: inherit;
  font-size: 1.25rem;
  font-weight: 600;
  min-height: 56px;
  padding: 6px 10px;
  text-align: center;
  line-height: 1.2;
  border: 1px solid var(--line);
  border-bottom: 0;
  background: #eef1f6;
  color: var(--navy);
  cursor: pointer;
}
.tab-button[aria-selected="true"] {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}
.tab-button:focus-visible,
.link-button:focus-visible,
.copy-button:focus-visible {
  outline: 3px solid #ffdd00;
  outline-offset: 0;
}

/* each tab is its own place: own title, own tint, own line colour */
.parent-body {
  background: #fff;
}
.tab-panel {
  --tab-tint: var(--yellow-tint);
  --tab-line: var(--yellow);
  padding: 20px 24px 24px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--tab-line);
  border-radius: var(--radius);
  background: var(--tab-tint);
}
.tab-panel[data-tab="eu_worker"] {
  --tab-tint: #f3f6fb;
  --tab-line: #6f8fc4;
}
.tab-panel[data-tab="other"] {
  --tab-tint: #f6f6f3;
  --tab-line: #9c9a8e;
}
.tab-panel[data-tab="eu_worker"] .file-row {
  background: #e3ebf7;
}
.tab-panel[data-tab="other"] .file-row {
  background: #ebebe6;
}

.instruction-note {
  font-size: 0.9375rem;
  color: #626a78;
}
.help-callout {
  margin-bottom: 30px;
  padding: 16px 20px 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}
.help-callout .govuk-form-group {
  margin-bottom: 12px;
}

/* a tab that does not apply: still visible, still focusable, with the reason written below the tabs */
.tab-button[aria-disabled="true"] {
  background: #f6f7f9;
  color: #5b6475;
  border-style: dashed;
  font-weight: 400;
  cursor: not-allowed;
}
.tab-note {
  margin: -12px 0 24px;
  padding: 12px 16px;
  border-left: 5px solid var(--yellow);
  background: var(--yellow-soft);
  font-size: 0.9375rem;
  line-height: 1.4;
}

/* labels and copy buttons */
.label-line {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 5px;
}
.label-line .govuk-label {
  margin-bottom: 0;
}
.copy-button,
.link-button {
  font: inherit;
  font-size: 0.875rem;
  background: none;
  border: 0;
  padding: 0;
  color: var(--navy);
  text-decoration: underline;
  cursor: pointer;
}

/* file field */
.file-slot,
.file-row {
  margin: 8px 0;
}
.file-row {
  display: flex;
  gap: 14px;
  align-items: baseline;
  flex-wrap: wrap;
  padding: 8px 12px;
  background: var(--yellow-soft);
}
.file-name {
  font-weight: 600;
  overflow-wrap: anywhere;
}
.file-row--error {
  background: #fdecea;
  border-left: 4px solid #d4351c;
}

/* functional icons: they help to spot things, they do not decorate */
.icon {
  flex: none;
  margin-right: 8px;
  vertical-align: -5px;
  color: var(--navy);
}
.file-row {
  align-items: center;
}

/* report form */
.report {
  margin-top: 60px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
}
.report summary {
  cursor: pointer;
  display: inline-block;
  margin-bottom: 15px;
}

/* decision aids and field hints: smaller and lighter than the labels they explain */
.govuk-hint,
.govuk-radios__hint {
  font-size: 0.9375rem;
  line-height: 1.4;
  color: #626a78;
}

/* rounded corners */
:root {
  --radius: 6px;
}
.govuk-button,
.govuk-input,
.govuk-textarea,
.govuk-file-upload,
.govuk-error-summary,
.govuk-notification-banner,
.parent-body,
.file-row,
.tab-button {
  border-radius: var(--radius);
}
.parent-toggle {
  border-radius: var(--radius);
}
.parent-toggle[aria-expanded="true"] {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}
.parent-body {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}
.tab-button {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}
.file-row--error {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}
.govuk-input__prefix {
  border-radius: var(--radius) 0 0 var(--radius);
}
.govuk-input__suffix {
  border-radius: 0 var(--radius) var(--radius) 0;
}
.govuk-input__wrapper .govuk-input:has(+ .govuk-input__suffix),
.govuk-input__prefix + .govuk-input {
  border-radius: 0;
}

/* warnings: flagged but not errors */
.field-warning {
  margin: 0 0 15px;
  padding-left: 15px;
  border-left: 5px solid #f2a900;
  color: #5c4300;
  font-weight: 700;
}
.govuk-input--warning {
  border-color: #b8860b;
}
.review-panel {
  margin-bottom: 30px;
  padding: 24px;
  border: 2px solid #f2a900;
  border-radius: var(--radius);
  background: var(--yellow-soft);
  text-align: left;
}
.review-panel:focus {
  outline: 3px solid #ffdd00;
}
.review-actions {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}
.review-actions .govuk-button {
  margin-bottom: 0;
}

/* submit */
#submit-area {
  text-align: center;
}
#submit-button {
  min-width: min(100%, 360px);
  height: 72px;
  padding: 0 32px;
  margin-bottom: 15px;
  font-size: 1.25rem;
  font-weight: 700;
}
#submit-button[aria-disabled="true"] {
  background-color: #c9ced8;
  color: #4b5568;
  box-shadow: none;
  cursor: not-allowed;
}
#submit-button[aria-disabled="true"]:hover {
  background-color: #c9ced8;
}
#submit-hint {
  max-width: 36em;
  margin-left: auto;
  margin-right: auto;
}

[hidden] {
  display: none !important;
}

/* GOV.UK paints a focused button yellow. After a mouse click the button keeps the focus, which looks like a bug:
   keep the yellow for keyboard focus only, and give a mouse-focused button its normal colours. */
.govuk-button {
  --btn-bg: var(--accent);
  --btn-fg: #fff;
  --btn-shadow: var(--accent-dark);
}
.govuk-button--secondary {
  --btn-bg: #eef1f6;
  --btn-fg: var(--navy);
  --btn-shadow: #9aa6bd;
}
.parent-toggle,
.choice-button[aria-pressed="true"] {
  --btn-bg: var(--navy);
  --btn-fg: #fff;
  --btn-shadow: var(--navy-dark);
}
#submit-button[aria-disabled="true"] {
  --btn-bg: #c9ced8;
  --btn-fg: #4b5568;
  --btn-shadow: transparent;
}
.govuk-button:focus:not(:focus-visible):not(:hover) {
  background-color: var(--btn-bg);
  color: var(--btn-fg);
  border-color: transparent;
  box-shadow: 0 2px 0 var(--btn-shadow);
  outline-color: transparent;
}
