.amn-mf-form-wrap {
  max-width: 920px;
  margin: 28px auto;
  padding: 0 18px;
}

.amn-mf-form {
  --amn-mf-header-start: #071a2d;
  --amn-mf-header-end: #12385f;
  --amn-mf-button: #008c8c;
  --amn-mf-radius: 20px;
  background: #f7fbfb;
  border: 1px solid rgba(7, 26, 45, .1);
  border-radius: var(--amn-mf-radius);
  box-shadow: 0 18px 45px rgba(7, 26, 45, .08);
  overflow: hidden;
  color: #071a2d;
}

.amn-mf-form * {
  box-sizing: border-box;
}

/*
 * The browser's native [hidden] { display: none } rule is a low-priority
 * UA-stylesheet rule, so any of our own class-based display rules below
 * (e.g. .amn-mf-field { display: grid }) silently win against it and the
 * "hidden" element stays visible. This single rule forces [hidden] to
 * always win inside the form, regardless of what other classes an element
 * carries - needed for the applicant-two / dependent-children /
 * dependent-adults conditional fields, and the childcare outgoings block.
 */
.amn-mf-form [hidden] {
  display: none !important;
}

.amn-mf-form__header {
  background: linear-gradient(135deg, var(--amn-mf-header-start), var(--amn-mf-header-end));
  color: #fff;
  padding: 24px;
  text-align: center;
}

.amn-mf-form .amn-mf-form__header h2 {
  margin: 0 0 8px;
  font-size: clamp(1.45rem, 2.5vw, 2rem);
  line-height: 1.15;
  color: #fff !important;
}

.amn-mf-form__header p {
  margin: 8px auto 0;
  max-width: 720px;
  color: inherit;
}

.amn-mf-required-hint {
  margin: 14px 24px 0;
  font-size: .85rem;
  font-weight: 700;
  color: #c0392b;
}

.amn-mf-form__cta-text {
  font-weight: 600;
}

.amn-mf-form__form {
  display: grid;
  gap: 18px;
  padding: 24px;
}

.amn-mf-diagnostics {
  margin: 0 24px;
  padding: 8px 12px;
  background: #fff4e5;
  border: 1px dashed #d38f00;
  border-radius: 8px;
  font-size: 12px;
  color: #7a4b00;
}

.amn-mf-grid {
  display: grid;
  gap: 16px;
}

.amn-mf-grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.amn-mf-grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.amn-mf-field,
.amn-mf-fieldset {
  display: grid;
  gap: 7px;
}

.amn-mf-field label,
.amn-mf-label {
  font-weight: 800;
  color: #071a2d;
}

/* Automatically marks any field/fieldset whose input(s) are required,
   rather than relying on every field's markup to say so individually -
   covers every form/step without needing per-field changes, and stays
   correct automatically if a field's requiredness changes later. Covers
   both regular labelled fields (.amn-mf-field label) and fieldsets built
   from a radio/checkbox group (.amn-mf-fieldset .amn-mf-label, where the
   "required" attribute sits on the individual radio/checkbox inputs
   rather than a single labelled input). */
.amn-mf-field:has(:required) > label::after,
.amn-mf-fieldset:has(:required) > .amn-mf-label::after {
  content: " *";
  color: #c0392b;
  font-weight: 900;
}

.amn-mf-field input,
.amn-mf-field select,
.amn-mf-field textarea,
.amn-mf-address-select {
  width: 100%;
  min-height: 46px;
  line-height: 1.4;
  border: 1px solid rgba(7, 26, 45, .18);
  border-radius: 12px;
  background: #fff;
  padding: 10px 12px;
  font: inherit;
  color: #071a2d;
}

/* Selects render with native browser chrome unless this is overridden,
   which computes a slightly different effective height than a plain text
   input even with matching min-height/padding/border - a very common
   cause of "form fields look inconsistent height" across browsers/OS.
   Removing native appearance and drawing our own arrow keeps the box
   dimensions identical to text inputs everywhere. */
.amn-mf-field select,
.amn-mf-address-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23071a2d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M5 7l5 5 5-5'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px 16px;
  padding-right: 36px;
}

.amn-mf-field textarea {
  min-height: 110px;
  resize: vertical;
}

.amn-mf-field input:focus,
.amn-mf-field select:focus,
.amn-mf-field textarea:focus,
.amn-mf-address-select:focus {
  outline: 3px solid rgba(0, 140, 140, .16);
  border-color: var(--amn-mf-button);
}

.amn-mf-section {
  display: grid;
  gap: 14px;
  border-top: 1px solid rgba(7, 26, 45, .1);
  padding-top: 18px;
}

.amn-mf-section h3 {
  margin: 0;
  padding-bottom: 8px;
  border-bottom: 2px solid #012a43;
  font-size: 1.15rem;
  color: #071a2d;
}

.amn-mf-radio-row {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.amn-mf-radio-row label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.amn-mf-radio-row input {
  margin: 0;
}

.amn-mf-lookup-row {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(130px, 1fr);
  gap: 10px;
}

.amn-mf-lookup-button,
.amn-mf-button {
  border: 0;
  border-radius: 999px;
  background: var(--amn-mf-button);
  color: #fff;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  min-height: 46px;
  padding: 10px 18px;
}

.amn-mf-lookup-button:hover,
.amn-mf-button:hover {
  filter: brightness(.95);
  transform: translateY(-1px);
}

.amn-mf-declarations {
  display: grid;
  gap: 12px;
  font-size: .92rem;
}

.amn-mf-declarations label {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

/* Checkboxes/radios had no explicit size anywhere, so they rendered at
   the browser's tiny native default (~13px) - most noticeable on the
   declaration checkboxes, since those sit next to a full paragraph of
   text. Sized consistently here so every checkbox/radio across every
   form (declarations, Yes/No radio rows, "Whose is this?" checkboxes)
   matches. */
.amn-mf-form input[type="checkbox"],
.amn-mf-form input[type="radio"] {
  width: 20px;
  height: 20px;
  flex: none;
  accent-color: var(--amn-mf-button);
  cursor: pointer;
}

.amn-mf-declarations input {
  margin-top: 2px;
}

.amn-mf-submit-row {
  display: flex;
  justify-content: flex-end;
}

.amn-mf-message {
  min-height: 1.2em;
  font-weight: 700;
}

.amn-mf-message.is-error {
  color: #b3261e;
}

.amn-mf-form__form.is-submitted {
  display: none;
}

.amn-mf-success-panel {
  display: grid;
  gap: 10px;
  padding: 32px 24px;
  text-align: center;
}

.amn-mf-success-panel[hidden] {
  display: none !important;
}

.amn-mf-success-icon {
  font-size: 2.2rem;
  color: var(--amn-mf-button);
}

.amn-mf-subsection {
  display: grid;
  gap: 12px;
  padding-top: 10px;
}

.amn-mf-subsection h4 {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  color: #536471;
}

[data-amn-mf-btl-summary] {
  background: #eef6f6;
  border: 1px solid rgba(0, 140, 140, .2);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 16px;
}

[data-amn-mf-btl-summary] h4 {
  margin: 0 0 8px;
  font-size: .95rem;
  font-weight: 800;
  color: #071a2d;
}

.amn-mf-btl-summary-hint {
  margin: 0 0 12px;
  font-size: .85rem;
  color: #536471;
}

[data-amn-mf-btl-summary-list] {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

[data-amn-mf-btl-summary-list] li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: .92rem;
  color: #334e68;
}

.amn-mf-btl-summary-edit {
  flex: none;
  border: 0;
  border-radius: 999px;
  padding: 4px 14px;
  font: inherit;
  font-weight: 800;
  font-size: .82rem;
  color: #fff;
  background: var(--amn-mf-button);
  cursor: pointer;
}

.amn-mf-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #eefafa;
  border: 1px solid rgba(0, 140, 140, .2);
  border-radius: 12px;
}

.amn-mf-summary-label {
  font-weight: 800;
  color: #071a2d;
}

.amn-mf-summary-value {
  font-weight: 900;
  font-size: 1.1rem;
  color: var(--amn-mf-button);
}

.amn-mf-money-input {
  text-align: left;
}

.amn-mf-date-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.amn-mf-date-sub-label {
  font-size: 12px;
  font-weight: 700;
  color: #536471;
}

.amn-mf-progress--text {
  align-items: center;
}

.amn-mf-progress--text [data-amn-mf-progress-text] {
  font-weight: 800;
  font-size: .88rem;
  color: #071a2d;
  white-space: nowrap;
}

.amn-mf-oip-address-block {
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid rgba(7, 26, 45, .1);
  border-radius: 12px;
  background: #fff;
}

.amn-mf-oip-history-hint {
  margin: 0;
  font-size: .85rem;
  color: #536471;
}

.amn-mf-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 24px 0;
}

.amn-mf-progress__step {
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: .45;
  transition: opacity .2s;
}

.amn-mf-progress__step.is-active {
  opacity: 1;
}

.amn-mf-progress__dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--amn-mf-button);
  color: #fff;
  font-weight: 900;
  font-size: .85rem;
  flex: none;
}

.amn-mf-progress__label {
  font-weight: 800;
  font-size: .88rem;
  color: #071a2d;
  white-space: nowrap;
}

.amn-mf-progress__track {
  flex: 1;
  height: 4px;
  border-radius: 999px;
  background: rgba(7, 26, 45, .12);
  overflow: hidden;
}

.amn-mf-progress__fill {
  height: 100%;
  width: 0;
  background: var(--amn-mf-button);
  transition: width .25s ease;
}

.amn-mf-step-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 10px;
}

.amn-mf-step-nav .amn-mf-button {
  min-width: 140px;
  text-align: center;
}

.amn-mf-button--secondary {
  background: transparent;
  color: var(--amn-mf-button);
  box-shadow: inset 0 0 0 2px var(--amn-mf-button);
  margin-top: 15px;
}

@media (max-width: 640px) {
  .amn-mf-progress__label {
    display: none;
  }
}

@media (max-width: 640px) {
  .amn-mf-grid--2,
  .amn-mf-grid--3,
  .amn-mf-date-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 400px) {
  .amn-mf-step-nav .amn-mf-button {
    min-width: 0;
    flex: 1;
  }
}
