/* ==========================================================================
   Oxford Mindfulness – registration form styles  (css/new.css)
   --------------------------------------------------------------------------
   Loaded from sections/sect-headerjs.php. Mobile-first: base rules are for
   phones, wider layouts are added with min-width media queries.

   IMPORTANT – why the selectors below are "scoped":
   sections/sect-header.php (the WordPress header) is output AFTER this file
   and contains global rules such as
       input:not([type=submit]) { padding…; border…; }
       label { white-space: nowrap !important; display: block; }
   Those break radios/checkboxes and make long labels run off the screen on
   phones. Every form rule here is therefore prefixed with $scope
   (:is(.main-content, .content-wrapper)) so it is more specific and wins.

   All of the old class names are still defined (see "Legacy components"
   at the bottom) so templates that have not been tidied yet keep working.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design tokens (taken from the brand values in omf.css)
   -------------------------------------------------------------------------- */
:root {
  --omf-ink: #062732;            /* midnight */
  --omf-ink-soft: #60757c;       /* midnight tint 1 */
  --omf-border: #87979d;         /* ui-border */
  --omf-divider: #d0d3d3;        /* ui-divider */
  --omf-accent: #097c78;         /* verdigris shade 2 */
  --omf-accent-tint: #effefb;    /* verdigris tint 5 */
  --omf-accent-tint-2: #c9fef5;  /* verdigris tint 4 */
  --omf-accent-border: #93fcec;  /* verdigris tint 3 */
  --omf-sun-tint: #fefae8;       /* sunshine tint 3 */
  --omf-sun-tint-2: #fff3c2;     /* sunshine tint 2 */
  --omf-sun-border: #ffe489;     /* sunshine tint 1 */
  --omf-error: #b50000;          /* ui-error */
  --omf-white: #ffffff;

  --omf-font-body: nunito, "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --omf-font-head: urbane-rounded, "Urbane Rounded", nunito, system-ui, sans-serif;

  --omf-radius: 16px;
  --omf-radius-sm: 8px;
  --omf-page-max: 832px;              /* width of the form column */
  --omf-control-max: 36rem;           /* max width of text inputs/selects */
  --omf-page-pad: clamp(16px, 4.8vw, 96px);
  --omf-card-pad: clamp(20px, 4vw, 40px);
  --omf-gap: clamp(16px, 2.4vw, 24px);
  --omf-field-gap: 20px;
  --omf-control-size: 24px;           /* radio / checkbox size */
}

/* --------------------------------------------------------------------------
   2. Page layout
   -------------------------------------------------------------------------- */
.main-content {
  display: block;
  width: 100%;
  padding: var(--omf-gap) var(--omf-page-pad) 0;
  color: var(--omf-ink);
  font-family: var(--omf-font-body);
  overflow-wrap: break-word;
}

/* Everything in the form column shares one width and is centred */
.page-intro,
.content-wrapper,
.form-actions,
.form-notice,
#overlay {
  width: 100%;
  max-width: var(--omf-page-max);
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}

.page-intro {
  margin-bottom: var(--omf-gap);
  text-align: center;
}

.page-title {
  margin: 0 0 var(--omf-gap);
  font-family: var(--omf-font-head);
  font-size: clamp(28px, 4.2vw, 51px);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--omf-ink);
}

/* Course summary shown under the page title */
.course-intro { text-align: left; }

.course-intro__title {
  margin: 0 0 12px;
  font-family: var(--omf-font-head);
  font-size: clamp(20px, 2.4vw, 28px);
  font-weight: 500;
  line-height: 1.25;
  text-align: center;
}

.course-intro__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 24px;
  margin: 0 0 var(--omf-gap);
  font-size: 18px;
}
.course-intro__meta div { display: flex; gap: 6px; }
.course-intro__meta dt { font-weight: 700; }
.course-intro__meta dt::after { content: ":"; }
.course-intro__meta dd { margin: 0; }

.course-intro__body {
  padding: var(--omf-card-pad);
  border: 1px solid var(--omf-accent-border);
  border-radius: var(--omf-radius);
  background-color: var(--omf-accent-tint-2);
  background-image: url('https://oxfordmindfulness.org/wp-content/uploads/2024/07/pattern.svg');
  background-position: 0% 50%;
  background-repeat: no-repeat;
  background-size: 75%;
  font-size: 18px;
  line-height: 1.55;
}

/* Guidance text (assessment / certificate types) */
.form-guidance {
  max-width: var(--omf-page-max);
  margin: 0 auto var(--omf-gap);
  font-size: 18px;
  line-height: 1.55;
}
.form-guidance h2 {
  margin: 0 0 12px;
  font-family: var(--omf-font-head);
  font-size: clamp(20px, 2.4vw, 28px);
  font-weight: 500;
  line-height: 1.25;
}
.form-guidance p { margin: 0 0 12px; }

/* --------------------------------------------------------------------------
   3. Section cards
   Works for both the tidied markup
     <section class="content-wrapper"><div class="form-section">…
   and the older markup
     <div class="content-wrapper"><header class="section-header"><form class="form-section">…
   -------------------------------------------------------------------------- */
.content-wrapper {
  display: block;
  margin-bottom: var(--omf-gap);
}

.section-header { display: block; width: 100%; }

.form-section {
  display: block;
  width: 100%;
  margin: 0;
  padding: var(--omf-card-pad);
  box-sizing: border-box;
  border: 1px solid var(--omf-divider);
  border-radius: var(--omf-radius);
  background: var(--omf-white);
}

.section-title {
  margin: 0 0 var(--omf-gap);
  padding: 0;
  max-width: none;
  font-family: var(--omf-font-head);
  font-size: clamp(22px, 2.8vw, 32px);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--omf-ink);
}
/* Old templates wrap titles in <font size="6"> – neutralise it */
.section-title font,
.form-guidance h2 font { font-size: inherit; }

.subsection-title {
  margin: var(--omf-gap) 0 8px;
  font-family: var(--omf-font-head);
  font-size: clamp(18px, 2.2vw, 22px);
  font-weight: 500;
}

/* <fieldset> defaults to min-width:min-content, which makes it overflow on
   phones when it contains a wide element. min-width:0 fixes that. */
.fieldset {
  display: block;
  min-width: 0;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  font-family: var(--omf-font-body);
  font-size: 18px;
}

.fieldset-label {
  display: block;
  width: 100%;
  margin: 0 0 12px;
  padding: 0;
  font-family: var(--omf-font-head);
  font-size: 20px;
  font-weight: 600;
  color: var(--omf-ink);
}

/* --------------------------------------------------------------------------
   4. Fields
   -------------------------------------------------------------------------- */
:is(.main-content, .content-wrapper) {
  font-size: 18px;
  line-height: 1.5;
}

:is(.main-content, .content-wrapper) p { margin: 0 0 12px; max-width: none; }

/* One "field" = label + control. Old templates use <div id="divSomething">;
   the tidied ones also add class="field".

   Spacing model: every field has the SAME gap above it and nothing below it,
   so the space between questions is always identical – even in older
   templates where field <div>s are never closed and each question ends up
   nested inside the one before. Padding + negative margin give the yellow
   validation highlight some breathing room. */
:is(.main-content, .content-wrapper) :is(.field, .fieldset div[id^="div"]) {
  /* The -6px bottom margin cancels the 6px bottom padding, so a field adds no
     space below its content – whatever it is wrapped in. */
  margin: var(--omf-field-gap) -10px -6px !important;   /* beats inline margin-bottom:10px */
  padding: 6px 10px !important;
  border-radius: var(--omf-radius-sm);
  max-width: none !important;
  width: auto !important;
  clear: both;
}
/* No gap above the first field of a section */
:is(.main-content, .content-wrapper) .fieldset > :is(.field, div[id^="div"]):first-child,
:is(.main-content, .content-wrapper) .fieldset > legend + :is(.field, div[id^="div"]),
:is(.main-content, .content-wrapper) .field-row > .field {
  margin-top: 0 !important;
}
/* A field nested inside another (unclosed <div>s, or "please give details"
   boxes): same gap above, but no extra indent or padding that would build up
   at the end of the section. */
:is(.main-content, .content-wrapper) :is(.field, .fieldset div[id^="div"]) :is(.field, div[id^="div"]),
:is(.main-content, .content-wrapper) :is(.field, .fieldset div[id^="div"]):has(:is(.field, div[id^="div"])) {
  padding-bottom: 0 !important;
  margin-bottom: 0 !important;
}
:is(.main-content, .content-wrapper) :is(.field, .fieldset div[id^="div"]) :is(.field, div[id^="div"]) {
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}
/* Ordinary content that follows a field gets the same gap as a field would */
:is(.main-content, .content-wrapper) :is(.field, .fieldset div[id^="div"]) + :is(p, label, ul, ol, table, h3) {
  margin-top: var(--omf-field-gap) !important;
}

/* --- Tidy up after older markup ------------------------------------------ */
/* Unclosed <p> tags leave empty paragraphs with margins behind */
:is(.main-content, .content-wrapper) p:empty { display: none; }
/* Paragraph spacing inside a field */
:is(.main-content, .content-wrapper) :is(.field, .fieldset div[id^="div"]) > p:first-child { margin-top: 0; }
:is(.main-content, .content-wrapper) .fieldset p:last-child { margin-bottom: 0 !important; }
/* Line breaks that only add a blank line: after a label, after a hidden
   anti-spam input, after a text box/select, or at the very end of a block */
:is(.main-content, .content-wrapper) :is(label, input.hp-field, input[style*="width:0px"], input[style*="width: 0px"]) + br,
:is(.main-content, .content-wrapper) label + br + br,
:is(.main-content, .content-wrapper) :is(textarea, select, input[type="text"], input[type="email"], input[type="tel"], input[type="date"], input[type="number"], input:not([type])) + br,
:is(.main-content, .content-wrapper) :is(.field, .fieldset div[id^="div"]) + br,
:is(.main-content, .content-wrapper) .fieldset br:last-child {
  display: none;
}
/* Sections end at the same place: nothing after the last item */
:is(.main-content, .content-wrapper) .fieldset > :last-child { margin-bottom: 0 !important; }
:is(.main-content, .content-wrapper) :is(.field, .fieldset div[id^="div"]) > :last-child:not(div) { margin-bottom: 0 !important; }

/* Two fields side by side on wider screens (forename / family name) */
.field-row { display: block; }
:is(.main-content, .content-wrapper) .fieldset > .field-row { margin-top: var(--omf-field-gap); }
:is(.main-content, .content-wrapper) .fieldset > .field-row:first-child { margin-top: 0; }

:is(.main-content, .content-wrapper) label {
  display: block;
  margin: 0;
  white-space: normal !important;   /* WordPress sets nowrap !important */
  font-weight: 600;
  color: var(--omf-ink);
}
/* Old templates put a <br> after every label – the label is already a block */
:is(.main-content, .content-wrapper) label + br { display: none; }

.field-label {
  margin: 0 !important;
  font-weight: 600;
}
.field-intro { color: var(--omf-ink); }
.field-hint {
  margin: 6px 0 0;
  font-size: 16px;
  line-height: 1.45;
  color: var(--omf-ink-soft);
}

/* Text-type controls */
:is(.main-content, .content-wrapper) input:is([type="text"], [type="email"], [type="tel"], [type="date"],
  [type="number"], [type="url"], [type="search"], [type="password"], :not([type])),
:is(.main-content, .content-wrapper) select,
:is(.main-content, .content-wrapper) textarea {
  display: block !important;          /* old markup sets inline display:inline-block */
  box-sizing: border-box;
  width: 100% !important;               /* old markup has inline width:50% / 85% */
  max-width: var(--omf-control-max) !important;
  min-height: 48px;
  margin: 6px 0 0;                    /* same gap under every question, label or plain text */
  padding: 10px 14px;
  font-family: inherit;
  font-size: 18px;                      /* 16px+ stops iOS zooming on focus */
  line-height: 1.4;
  color: var(--omf-ink);
  background-color: var(--omf-white);
  border: 1px solid var(--omf-border);
  border-radius: var(--omf-radius-sm);
  float: none;
  clear: none;
}

:is(.main-content, .content-wrapper) textarea {
  max-width: 100% !important;
  min-height: 8rem;
  overflow: auto !important;            /* old inline overflow:hidden hid text */
  resize: vertical;
}

:is(.main-content, .content-wrapper) select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%23062732' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  cursor: pointer;
}

:is(.main-content, .content-wrapper) input::placeholder,
:is(.main-content, .content-wrapper) textarea::placeholder { color: var(--omf-ink-soft); opacity: 1; }

/* Focus states (WordPress removes the outline on inputs) */
:is(.main-content, .content-wrapper) :is(input, select, textarea, button, a):focus-visible {
  outline: 3px solid var(--omf-accent) !important;
  outline-offset: 2px;
}
:is(.main-content, .content-wrapper) :is(input, select, textarea):focus {
  border-color: var(--omf-accent);
}

/* --------------------------------------------------------------------------
   5. Radios and checkboxes
   -------------------------------------------------------------------------- */
:is(.main-content, .content-wrapper) input:is([type="radio"], [type="checkbox"]) {
  appearance: none;
  -webkit-appearance: none;
  display: inline-grid;
  place-content: center;
  flex: none;
  box-sizing: border-box;
  width: var(--omf-control-size);
  height: var(--omf-control-size);
  min-height: 0;
  margin: 4px 10px 4px 0;
  padding: 0;
  vertical-align: middle;
  border: 2px solid var(--omf-ink);
  background: var(--omf-white);
  color: var(--omf-ink);
  cursor: pointer;
  float: none;
}
:is(.main-content, .content-wrapper) input[type="radio"] { border-radius: 50%; }
:is(.main-content, .content-wrapper) input[type="checkbox"] { border-radius: 6px; }

:is(.main-content, .content-wrapper) input[type="radio"]::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--omf-ink);
  transform: scale(0);
  transition: transform .12s ease-in-out;
}
:is(.main-content, .content-wrapper) input[type="radio"]:checked::before { transform: scale(1); }

:is(.main-content, .content-wrapper) input[type="checkbox"]::before {
  content: "";
  width: 12px;
  height: 7px;
  margin-top: -3px;
  border-left: 3px solid var(--omf-white);
  border-bottom: 3px solid var(--omf-white);
  transform: rotate(-45deg) scale(0);
  transition: transform .12s ease-in-out;
}
:is(.main-content, .content-wrapper) input[type="checkbox"]:checked { background: var(--omf-ink); }
:is(.main-content, .content-wrapper) input[type="checkbox"]:checked::before { transform: rotate(-45deg) scale(1); }

:is(.main-content, .content-wrapper) input:is([type="radio"], [type="checkbox"]):disabled { cursor: default; opacity: .85; }

/* Confirmation tick boxes sit at the END of their sentence. The last word and
   the box are wrapped in <span class="cb-anchor"> (in the markup, or by
   js/form-checkboxes.js for older templates) so they always wrap together. */
.cb-anchor { white-space: nowrap; }
:is(.main-content, .content-wrapper) .cb-anchor input[type="checkbox"] {
  margin: -3px 0 0 10px;
  vertical-align: middle;
}
:is(.main-content, .content-wrapper) :is(label, p, div).cb-statement,
:is(.main-content, .content-wrapper) label:has(.cb-anchor) {
  font-weight: 400;
}

/* Tidied markup: <label class="choice"><input …><span>Text</span></label> */
:is(.main-content, .content-wrapper) .choice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0;
  padding: 6px 0;
  font-weight: 400;
  cursor: pointer;
}
:is(.main-content, .content-wrapper) .choice input { margin: 1px 0 0; }
.choice__text { flex: 1; min-width: 0; }

.choice-list { display: flex; flex-direction: column; gap: 4px; }
.choice-list--inline { flex-direction: row; flex-wrap: wrap; gap: 4px 28px; }

/* Fee options shown as selectable cards */
:is(.main-content, .content-wrapper) .choice--card {
  padding: 14px 16px;
  border: 1px solid var(--omf-divider);
  border-radius: var(--omf-radius-sm);
  background: var(--omf-white);
}
:is(.main-content, .content-wrapper) .choice--card:has(input:checked) {
  border-color: var(--omf-accent);
  background: var(--omf-accent-tint);
  box-shadow: 0 0 0 1px var(--omf-accent);
}
.choice--card .radio-text,
.choice--card .radio-description { display: block; }

/* Old markup: <input class="radio-button"><span class="radio-oneline">Yes</span><br> */
:is(.main-content, .content-wrapper) :is(.radio-oneline, .radio-text) {
  display: inline;
  float: none;
  min-width: 0;
  margin: 0;
  font: inherit;
  vertical-align: middle;
}
:is(.main-content, .content-wrapper) .radio-text { font-weight: 700; }
:is(.main-content, .content-wrapper) .radio-description {
  display: block;
  float: none;
  padding-left: calc(var(--omf-control-size) + 10px);
  font-size: 16px;
  line-height: 1.45;
  color: var(--omf-ink-soft);
}
:is(.main-content, .content-wrapper) .choice .radio-description { padding-left: 0; }

/* --------------------------------------------------------------------------
   6. Buttons
   -------------------------------------------------------------------------- */
:is(.main-content, .content-wrapper) input:is([type="button"], [type="submit"]),
.button-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  margin: 0;
  padding: 12px 24px;
  border: 1px solid var(--omf-sun-border);
  border-radius: 999px;
  background: var(--omf-sun-tint);
  color: var(--omf-ink);
  font-family: inherit;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}
:is(.main-content, .content-wrapper) input:is([type="button"], [type="submit"]):hover,
.button-secondary:hover { background: var(--omf-sun-tint-2); }

/* Gift code: text box + button on one row */
.inline-field__row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: stretch;
}
:is(.main-content, .content-wrapper) .inline-field__row input[type="button"] { margin-top: 6px; }
:is(.main-content, .content-wrapper) .inline-field__row input[type="text"] {
  flex: 1 1 12rem;
  width: auto !important;
  max-width: 20rem !important;
}

/* File uploads (older templates: <form id="file-catcher…"><input type=file> <button>Upload</button>) */
:is(.main-content, .content-wrapper) input[type="file"] {
  display: block;
  box-sizing: border-box;
  width: 100%;
  max-width: var(--omf-control-max);
  margin: 6px 0 0;
  padding: 8px;
  border: 1px dashed var(--omf-border);
  border-radius: var(--omf-radius-sm);
  background: var(--omf-white);
  font: inherit;
  font-size: 16px;
}
:is(.main-content, .content-wrapper) form[id^="file-catcher"] {
  display: block;
  margin: 6px 0 0;
}
:is(.main-content, .content-wrapper) form[id^="file-catcher"] button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-height: 44px;
  margin: 10px 0 0;
  padding: 10px 24px;
  border: 1px solid var(--omf-sun-border);
  border-radius: 999px;
  background: var(--omf-sun-tint);
  color: var(--omf-ink);
  font-family: inherit;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}
:is(.main-content, .content-wrapper) form[id^="file-catcher"] button::after { content: none; }
:is(.main-content, .content-wrapper) form[id^="file-catcher"] button:hover { background: var(--omf-sun-tint-2); }
:is(.main-content, .content-wrapper) [id^="file-list-display"]:not(:empty) { margin-top: 8px; font-size: 16px; }
:is(.main-content, .content-wrapper) [id^="file-list-display"] p { margin: 0; }
/* Whatever follows an upload widget starts a field-gap below it */
:is(.main-content, .content-wrapper) form[id^="file-catcher"] + * { margin-top: var(--omf-field-gap) !important; }

/* Main "Register and pay" button – always centred below the last section.
   Targets #register directly so it also applies to templates that haven't
   been converted yet and output the button without a .form-actions wrapper.
   (The JavaScript hides/shows it with inline display:none / "", which still
   works with these rules.) */
.form-actions {
  display: flex;
  justify-content: center;
  width: 100%;
  max-width: var(--omf-page-max);
  margin: var(--omf-gap) auto calc(var(--omf-gap) * 2);
}
#register.wp-block-button__link,
a#register,
button#register {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 100%;
  max-width: var(--omf-page-max);
  min-height: 52px;
  margin: var(--omf-gap) auto calc(var(--omf-gap) * 2);
  padding: 14px 40px;
  float: none;
  border: 0;
  border-radius: 999px;
  background: var(--omf-ink);
  color: var(--omf-white);
  font-family: var(--omf-font-body);
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.form-actions #register { margin: 0; }
#register.wp-block-button__link:hover,
a#register:hover,
button#register:hover { background: #0e3a49; color: var(--omf-white); }

/* --------------------------------------------------------------------------
   7. Notices
   -------------------------------------------------------------------------- */
.form-notice,
#overlay {
  margin-bottom: var(--omf-gap);
  padding: 20px clamp(20px, 3vw, 32px);
  border: 1px solid var(--omf-accent-border);
  border-radius: var(--omf-radius);
  background: var(--omf-accent-tint);
  color: var(--omf-ink);
  font-family: var(--omf-font-body);
  font-size: 18px;
  line-height: 1.5;
}
.form-notice--warning,
#overlay {
  border-color: var(--omf-sun-border);
  background: var(--omf-sun-tint);
}
.form-notice--error {
  border-color: var(--omf-error);
  background: rgba(181, 0, 0, .06);
}
.form-notice > :last-child { margin-bottom: 0; }
.form-notice a, #overlay a { color: var(--omf-accent); font-weight: 600; }

/* Shown by JavaScript after submission; hidden until then (prevents a flash) */
#overlay { display: none; height: auto !important; margin-top: var(--omf-gap); }

/* --------------------------------------------------------------------------
   8. Related events (course baskets)
   -------------------------------------------------------------------------- */
.related-events { margin-top: var(--omf-gap); padding-top: var(--omf-gap); border-top: 1px solid var(--omf-divider); }
.related-event { padding: 10px 0; border-bottom: 1px solid var(--omf-divider); }
.related-event:last-child { border-bottom: 0; }
:is(.main-content, .content-wrapper) .related-event select { margin: 6px 0 0 calc(var(--omf-control-size) + 12px); width: calc(100% - var(--omf-control-size) - 12px) !important; }
.related-event__fee { margin: 2px 0 0 calc(var(--omf-control-size) + 12px); color: var(--omf-ink-soft); font-size: 16px; }
.muted { color: var(--omf-ink-soft); }

/* --------------------------------------------------------------------------
   9. Hidden helpers
   -------------------------------------------------------------------------- */
/* Our display:block on inputs would otherwise override the hidden attribute */
:is(.main-content, .content-wrapper) [hidden][hidden],
:is(.main-content, .content-wrapper) :is(input, select, textarea)[hidden] { display: none !important; }

/* Invisible anti-spam fields (state3, state4, state95 …). Older templates
   mark these with an inline style, the tidied ones with class="hp-field". */
:is(.main-content, .content-wrapper) input.hp-field,
:is(.main-content, .content-wrapper) input[style*="width:0px"][style*="height:0px"],
:is(.main-content, .content-wrapper) input[style*="width: 0px"][style*="height: 0px"] {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  overflow: hidden;
  clip-path: inset(50%);
  pointer-events: none;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   10. Wider screens
   -------------------------------------------------------------------------- */
@media (min-width: 600px) {
  .field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 20px;
    max-width: calc(var(--omf-control-max) + 6rem);
  }
  #register.wp-block-button__link, a#register, button#register { width: fit-content; min-width: 280px; }
}

/* ==========================================================================
   Legacy components
   Class names from the original stylesheet. Fixed widths, broken font
   shorthands and float hacks have been removed so they are safe on phones.
   ========================================================================== */
.form-container { display: flex; flex-direction: column; width: 100%; overflow: hidden; background: var(--omf-sun-tint-2); font-family: var(--omf-font-head); }

.header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 40px; min-height: 104px; width: 100%; padding: 24px var(--omf-page-pad); color: var(--omf-ink); font: 600 20px/20px var(--omf-font-body); letter-spacing: -0.2px; }
.logo { width: 233px; max-width: 60vw; aspect-ratio: 4.17; object-fit: contain; }
.header-actions { display: flex; align-items: center; gap: 4px; }
.help-link { display: inline-flex; gap: 8px; padding: 8px 0; font-feature-settings: "liga" off; }
.help-icon, .info-icon, .delete-icon, .checkbox-icon { width: 24px; aspect-ratio: 1; object-fit: contain; }

.course-info { display: flex; flex-direction: column; width: 100%; margin-top: 24px; font-family: var(--omf-font-body); }
.course-type { color: var(--omf-ink); text-align: center; font-size: clamp(22px, 2.8vw, 29px); font-weight: 400; line-height: 1.4; }
.details-link { align-self: center; margin-top: 12px; color: var(--omf-accent); font-size: 20px; font-weight: 600; text-decoration: underline; }

.info-box { display: flex; flex-direction: column; gap: 16px; width: 100%; margin-top: 32px; padding: var(--omf-card-pad); border: 1px solid var(--omf-accent-border); border-radius: var(--omf-radius); background: var(--omf-accent-tint); }
.info-header { display: flex; align-items: center; gap: 8px; color: var(--omf-ink); font: 500 22px/28px var(--omf-font-head); letter-spacing: -0.45px; }
.info-title { flex: 1; }
.info-content { margin-top: 16px; color: var(--omf-ink); font: 400 18px/28px var(--omf-font-body); }

.error-section { display: flex; flex-direction: column; width: 100%; margin-top: 32px; padding: var(--omf-card-pad); border: 1px solid var(--omf-error); border-radius: var(--omf-radius); background-color: rgba(181, 0, 0, .06); }
.error-heading { width: 100%; padding-bottom: 24px; color: var(--omf-ink); font: 500 22px/28px var(--omf-font-head); }
.error-list { display: flex; flex-direction: column; width: 100%; color: var(--omf-error); font: 600 18px/1.4 var(--omf-font-body); }
.error-item { text-decoration: underline; }
.error-fieldset { display: flex; flex-direction: column; width: 100%; padding-left: 24px; border-left: 2px solid var(--omf-error); }
.error-message { margin-top: 12px; color: var(--omf-error); font-size: 18px; line-height: 1.3; }

.input-group, .date-input-group { display: flex; flex-direction: column; gap: 16px; width: 100%; margin-top: 20px; }
.radio-group, .checkbox-group, .input-text, .input-voucher, .upload-section, .date-input { display: flex; flex-direction: column; width: 100%; min-width: 0; }
.radio-option { display: flex; flex-direction: column; justify-content: center; width: 100%; padding: 6px 0; }
.radio-label, .checkbox-option { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; width: 100%; padding: 6px 0; }
.radio-indicator { display: flex; width: 12px; height: 12px; border-radius: 50%; background-color: var(--omf-ink); }
.input-label { color: var(--omf-ink); font: 400 18px/1.3 var(--omf-font-body); }
.text-input, .phone-input, .address-input, .select-input, .date-field { display: flex; align-items: center; gap: 8px; width: 100%; margin-top: 8px; padding: 10px 12px; border: 1px solid var(--omf-border); border-radius: var(--omf-radius-sm); background: var(--omf-white); }
.input-placeholder, .address-placeholder, .select-placeholder, .phone-prefix { flex: 1; min-width: 0; }
.voucher-input-group { display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; width: 100%; }
.voucher-input { width: 100%; max-width: 12rem; height: 48px; padding: 10px 12px; border: 1px solid var(--omf-border); border-radius: var(--omf-radius-sm); background: var(--omf-white); }
.apply-button, .upload-button, .secondary-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 24px 15px; border: 1px solid var(--omf-sun-border); border-radius: 24px; background: var(--omf-sun-tint); color: var(--omf-ink); font-weight: 700; }
.primary-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 24px 15px; border: 1px solid var(--omf-ink); border-radius: 24px; background: var(--omf-ink); color: var(--omf-white); font-weight: 700; }
.date-field-error { border: 2px solid var(--omf-error); }
.conditional-input { display: flex; flex-direction: column; width: 100%; margin-top: 10px; padding-left: 16px; color: var(--omf-ink); font: 400 18px/1.3 var(--omf-font-body); }
.conditional-field { display: flex; flex-direction: column; width: 100%; padding-left: 20px; border-left: 1px solid var(--omf-border); }
.conditional-textarea { width: 100%; min-height: 48px; margin-top: 8px; padding: 10px 12px; border: 1px solid var(--omf-border); border-radius: var(--omf-radius-sm); background: var(--omf-white); }
.flag-icon { width: 28px; aspect-ratio: 1.33; border-radius: 2px; object-fit: contain; }
.dropdown-icon { width: 8px; aspect-ratio: 1; object-fit: contain; }
.address-icon, .select-icon, .upload-icon { width: 20px; aspect-ratio: 1; object-fit: contain; }
.file-list { display: flex; flex-direction: column; width: 100%; margin-top: 12px; color: var(--omf-ink-soft); font-size: 18px; line-height: 1.5; }
.file-item { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; width: 100%; min-height: 48px; padding: 10px 0; border-bottom: 1px solid var(--omf-divider); }
.file-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.file-info { display: flex; align-items: center; gap: 8px; }
.checkbox { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 1px solid var(--omf-ink); border-radius: 4px; background: var(--omf-ink); }
.checkbox-unchecked { display: flex; width: 32px; height: 32px; border: 1px solid var(--omf-ink); border-radius: 4px; background: var(--omf-white); }
.checkbox-label { flex: 1; min-width: 0; color: var(--omf-ink); font: 400 18px/28px var(--omf-font-body); }
.action-buttons { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 16px; width: 100%; margin-top: 32px; font: 600 20px/20px var(--omf-font-body); }
.footer { display: flex; flex-direction: column; width: 100%; padding: 0 var(--omf-page-pad); background: var(--omf-white); color: var(--omf-ink-soft); font: 600 16px/16px var(--omf-font-body); }
.footer-content { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 24px; width: 100%; padding: 32px 24px; }
.footer-link { display: inline-flex; gap: 4px; padding: 4px 0; }

/* Specific fields from older templates */
#divSurname { margin-left: 0; }                 /* was a 260px float hack – see .field-row */
#divPhysicalSensoryYn { display: flex; flex-direction: column; width: 100%; max-width: 100%; box-sizing: border-box; }
#state31container { max-width: 100%; }

@media (min-width: 782px) {
  .input-group, .date-input-group { flex-direction: row; flex-wrap: wrap; }
  .input-text, .input-voucher, .upload-section, .date-input { flex: 1 1 0; min-width: 254px; }
}
