/* Apply module — public forms + homepage section.
 * Theme .form-control is transparent; restore visible fields under .apply-page only.
 */

/* Homepage section wrapper — cards reuse .apply-hub__* (accepted hub pattern) */
.theme-apply-work .apply-hub__grid {
  --bs-gutter-x: 1.5rem;
}

/* Hub + homepage editorial cards — Studiova upcoming-events family, Apply-scoped */
.apply-page.apply-page--hub {
  max-width: 1140px;
  padding-top: 2rem;
  padding-bottom: 3.5rem;
}

.apply-hub__header {
  max-width: 40rem;
  margin: 0 0 2rem;
}

.apply-page--hub .apply-page__title {
  margin-bottom: 0.85rem;
}

.apply-page--hub .apply-page__lead {
  font-size: 1.05rem;
}

.apply-hub__grid {
  --bs-gutter-y: 1.5rem;
}

.apply-hub__col {
  display: flex;
}

.apply-hub__card {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: var(--bs-light-gray, #f4f5f6);
  border: 0;
  border-radius: 1rem;
}

.apply-hub__media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: rgba(var(--bs-secondary-rgb, 31, 42, 46), 0.06);
}

.apply-hub__media-link {
  display: block;
  width: 100%;
  height: 100%;
}

.apply-hub__img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.apply-hub__body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: 0.85rem;
  min-width: 0;
  padding: 1.35rem 1.35rem 1.5rem;
}

.apply-hub__title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ap-ink, #1f2a2e);
}

.apply-hub__text {
  margin: 0;
  color: rgba(var(--bs-secondary-rgb, 31, 42, 46), 0.72);
  font-size: 0.98rem;
  line-height: 1.55;
}

.apply-hub__cta-wrap {
  margin-top: auto;
  padding-top: 0.65rem;
}

.apply-hub__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--ap-ink, #1f2a2e);
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
  border-radius: 0.2rem;
}

.apply-hub__cta:hover,
.apply-hub__cta:focus {
  color: var(--ap-ink, #1f2a2e);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.apply-hub__cta:focus-visible {
  outline: 2px solid var(--ap-accent, #d4b46a);
  outline-offset: 3px;
}

.apply-hub__cta-icon {
  font-size: 1.05em;
  line-height: 1;
}

@media (max-width: 767.98px) {
  .apply-page.apply-page--hub {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }

  .apply-hub__header {
    margin-bottom: 1.5rem;
  }
}

.apply-page {
  --ap-ink: var(--bs-secondary, #1f2a2e);
  --ap-muted: rgba(var(--bs-secondary-rgb, 31, 42, 46), 0.65);
  --ap-line: rgba(var(--bs-secondary-rgb, 31, 42, 46), 0.22);
  --ap-surface: #ffffff;
  --ap-accent: var(--bs-primary, #d4b46a);
  --ap-accent-soft: rgba(var(--bs-primary-rgb, 212, 180, 106), 0.22);
  --ap-ok: #1b6b3a;
  --ap-ok-line: rgba(27, 107, 58, 0.55);
  --ap-bad: #6f1d25;
  --ap-bad-line: rgba(176, 42, 55, 0.7);
  --ap-radius: 0.45rem;
  --ap-control-h: 2.75rem;
  box-sizing: border-box;
  max-width: 920px;
  margin: 0 auto;
  padding: 1.35rem 1rem 2.75rem;
  color: var(--ap-ink);
}

.apply-page *,
.apply-page *::before,
.apply-page *::after {
  box-sizing: border-box;
}

.apply-page__title {
  margin: 0 0 0.75rem;
  font-size: clamp(1.65rem, 2.4vw, 2.15rem);
  font-weight: 700;
}

/* Intro: contextual copy + static thumbnail (presentation only) */
.apply-intro {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.9rem;
  margin: 0 0 1.15rem;
  min-width: 0;
}

.apply-intro__content {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 40rem;
}

.apply-intro__media {
  flex: 0 0 auto;
  min-width: 0;
}

.apply-intro__thumb {
  display: block;
  width: 10rem;
  max-width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border: 1px solid var(--ap-line);
  border-radius: var(--ap-radius);
  background: rgba(var(--bs-secondary-rgb, 31, 42, 46), 0.04);
}

.apply-page__lead {
  margin: 0;
  color: var(--ap-muted);
  font-size: 1.02rem;
  line-height: 1.55;
}

.apply-page__lead--follow {
  margin-top: 0.55rem;
}

.apply-page__note {
  margin: 0.55rem 0 0;
  color: var(--ap-ink);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.4;
}

@media (min-width: 720px) {
  .apply-intro {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.35rem;
  }

  .apply-intro__content {
    flex: 1 1 auto;
    max-width: none;
  }

  .apply-intro__thumb {
    width: 11rem; /* ~176px */
  }
}

@media (min-width: 900px) {
  .apply-intro__thumb {
    width: 11.75rem; /* ~188px */
  }
}

@media (max-width: 419.98px) {
  /* Avoid a large image dominating very narrow phones */
  .apply-intro__thumb {
    width: 7.5rem;
  }
}

.apply-info-block {
  margin: 0 0 0.95rem;
  max-width: 40rem;
}

.apply-info-block__title {
  margin: 0 0 0.55rem;
  font-size: 1.05rem;
  font-weight: 650;
  color: var(--ap-ink);
  line-height: 1.3;
}

.apply-info-block__text {
  margin: 0 0 0.65rem;
  color: var(--ap-muted);
  font-size: 0.94rem;
  line-height: 1.5;
}

.apply-info-block__text:last-child {
  margin-bottom: 0;
}

.apply-section--consent .apply-section__title {
  margin-top: 0.35rem;
}

.apply-back {
  margin: 0 0 0.85rem;
}

.apply-back a {
  text-decoration: none;
}

.apply-section {
  margin: 0 0 1.35rem;
  padding-top: 0.15rem;
  border-top: 1px solid var(--ap-line);
}

.apply-section:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.apply-section__title {
  margin: 0.7rem 0 0.7rem;
  font-size: 1.1rem;
  font-weight: 650;
}

/* Shared responsive field grid — all three apply forms */
.apply-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem 1.25rem;
  margin: 0;
  min-width: 0;
}

.apply-grid__cell {
  min-width: 0;
}

.apply-grid__cell--full {
  grid-column: 1 / -1;
}

.apply-grid .apply-field {
  margin-bottom: 0;
}

@media (min-width: 720px) {
  .apply-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

.apply-field {
  margin: 0 0 0.9rem;
  min-width: 0;
}

.apply-field label,
.apply-field-label {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ap-ink);
}

.apply-req {
  color: var(--bs-danger, #b02a37);
}

.apply-opt {
  font-weight: 400;
  color: var(--ap-muted);
  font-size: 0.92em;
}

.apply-hint {
  margin: 0 0 1rem;
  color: var(--ap-muted);
  font-size: 0.95rem;
}

/*
 * Standard controls — white surface, 1px border, modest radius.
 * !important counters theme transparent .form-control / .form-select layers.
 */
.apply-page .apply-control.form-control,
.apply-page .apply-control.form-select,
.apply-page input.apply-control,
.apply-page select.apply-control,
.apply-page textarea.apply-control {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  min-height: var(--ap-control-h) !important;
  margin: 0 !important;
  padding: 0.65rem 0.85rem !important;
  color: var(--ap-ink) !important;
  font-size: 1rem !important;
  font-weight: 400 !important;
  line-height: 1.4 !important;
  appearance: auto !important;
  background-color: var(--ap-surface) !important;
  background-image: none !important;
  border: 1px solid var(--ap-line) !important;
  border-radius: var(--ap-radius) !important;
  box-shadow: none !important;
}

.apply-page .apply-control::placeholder {
  color: rgba(var(--bs-secondary-rgb, 31, 42, 46), 0.45) !important;
  opacity: 1 !important;
}

.apply-page select.apply-control.form-select {
  padding-right: 2.35rem !important;
  background-image: var(--bs-form-select-bg-img, none) !important;
  background-repeat: no-repeat !important;
  background-position: right 0.8rem center !important;
  background-size: 14px 10px !important;
  appearance: none !important;
}

.apply-page textarea.apply-control {
  min-height: 5.25rem !important;
  resize: vertical;
}

.apply-page .apply-control:focus,
.apply-page .apply-control:focus-visible {
  color: var(--ap-ink) !important;
  background-color: var(--ap-surface) !important;
  border-color: var(--ap-accent) !important;
  outline: 0 !important;
  box-shadow: 0 0 0 0.18rem var(--ap-accent-soft) !important;
}

.apply-page .apply-control.is-invalid,
.apply-page .apply-control.is-invalid:focus,
.apply-page .apply-control.is-invalid:focus-visible {
  border-color: var(--ap-bad-line) !important;
  box-shadow: 0 0 0 0.18rem rgba(176, 42, 55, 0.15) !important;
}

.apply-page .apply-control.is-valid,
.apply-page .apply-control.is-valid:focus,
.apply-page .apply-control.is-valid:focus-visible {
  border-color: var(--ap-ok-line) !important;
  box-shadow: 0 0 0 0.18rem rgba(27, 107, 58, 0.12) !important;
}

/* Live validation feedback (email host + phone fx_geo hint) */
.apply-page .apply-field__feedback,
.apply-page #apply-fb-phone.mapls-entry__hint {
  min-height: 1.15rem;
  margin: 0.3rem 0 0;
  padding: 0;
  font-size: 0.85rem;
  line-height: 1.35;
  color: transparent;
}

.apply-page .apply-field__feedback.is-bad,
.apply-page #apply-fb-phone.mapls-entry__hint.is-bad {
  color: var(--ap-bad);
}

.apply-page .apply-field__feedback.is-ok,
.apply-page #apply-fb-phone.mapls-entry__hint.is-ok {
  color: var(--ap-ok);
}

.apply-page .apply-field__feedback.is-ok:empty::before,
.apply-page #apply-fb-phone.mapls-entry__hint.is-ok:empty::before {
  content: "✓";
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.apply-page .fx-phone-control:has(.fx-phone-national-input.is-invalid) {
  border-color: var(--ap-bad-line) !important;
  box-shadow: 0 0 0 0.18rem rgba(176, 42, 55, 0.15) !important;
}

.apply-page .fx-phone-control:has(.fx-phone-national-input.is-valid) {
  border-color: var(--ap-ok-line) !important;
  box-shadow: 0 0 0 0.18rem rgba(27, 107, 58, 0.12) !important;
}

.apply-page .fx-phone-national-input.is-invalid,
.apply-page .fx-phone-national-input.is-valid {
  border: 0 !important;
  box-shadow: none !important;
}

/* ---- File uploads (native ::file-selector-button) ---- */
.apply-page input.apply-control[type="file"] {
  display: block !important;
  width: 100% !important;
  min-height: var(--ap-control-h) !important;
  padding: 0.4rem 0.5rem !important;
  color: var(--ap-muted) !important;
  font-size: 0.92rem !important;
  line-height: 1.35 !important;
  background-color: var(--ap-surface) !important;
  border: 1px solid var(--ap-line) !important;
  border-radius: var(--ap-radius) !important;
  cursor: pointer;
}

.apply-page input.apply-control[type="file"]::file-selector-button {
  margin-right: 0.75rem;
  padding: 0.4rem 0.85rem;
  color: var(--ap-ink);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.25;
  background-color: rgba(var(--bs-secondary-rgb, 31, 42, 46), 0.06);
  border: 1px solid var(--ap-line);
  border-radius: calc(var(--ap-radius) - 0.1rem);
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.apply-page input.apply-control[type="file"]::-webkit-file-upload-button {
  margin-right: 0.75rem;
  padding: 0.4rem 0.85rem;
  color: var(--ap-ink);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.25;
  background-color: rgba(var(--bs-secondary-rgb, 31, 42, 46), 0.06);
  border: 1px solid var(--ap-line);
  border-radius: calc(var(--ap-radius) - 0.1rem);
  cursor: pointer;
}

.apply-page input.apply-control[type="file"]:hover::file-selector-button,
.apply-page input.apply-control[type="file"]:hover::-webkit-file-upload-button {
  background-color: rgba(var(--bs-primary-rgb, 212, 180, 106), 0.18);
  border-color: rgba(var(--bs-primary-rgb, 212, 180, 106), 0.45);
}

.apply-page input.apply-control[type="file"]:focus,
.apply-page input.apply-control[type="file"]:focus-visible {
  border-color: var(--ap-accent) !important;
  outline: 0 !important;
  box-shadow: 0 0 0 0.18rem var(--ap-accent-soft) !important;
}

/*
 * Phone / WhatsApp — scope fx_geo overrides to .apply-page only.
 * Theme .btn is a gold pill; reset country selector to a compact white chip.
 */
.apply-page .fx-phone-field,
.apply-page .apply-field--phone .fx-phone-field {
  width: 100%;
  position: relative;
}

.apply-page .fx-phone-control.input-group,
.apply-page .fx-phone-control {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: stretch !important;
  width: 100% !important;
  position: relative;
  border: 1px solid var(--ap-line) !important;
  border-radius: var(--ap-radius) !important;
  background: var(--ap-surface) !important;
  background-color: var(--ap-surface) !important;
  overflow: visible !important;
  gap: 0 !important;
  box-shadow: none !important;
}

.apply-page .fx-phone-control:focus-within {
  border-color: var(--ap-accent) !important;
  box-shadow: 0 0 0 0.18rem var(--ap-accent-soft) !important;
}

.apply-page .fx-phone-country-btn.btn,
.apply-page .fx-phone-country-btn {
  flex: 0 0 auto !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.3rem !important;
  width: auto !important;
  max-width: 6.75rem !important;
  min-width: 0 !important;
  min-height: var(--ap-control-h) !important;
  height: auto !important;
  padding: 0.35rem 0.55rem !important;
  margin: 0 !important;
  border: 0 !important;
  border-right: 1px solid var(--ap-line) !important;
  border-radius: var(--ap-radius) 0 0 var(--ap-radius) !important;
  background: rgba(var(--bs-secondary-rgb, 31, 42, 46), 0.04) !important;
  background-color: rgba(var(--bs-secondary-rgb, 31, 42, 46), 0.04) !important;
  color: var(--ap-ink) !important;
  font-size: 0.88rem !important;
  font-weight: 600 !important;
  font-variant-numeric: tabular-nums;
  line-height: 1 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-decoration: none !important;
  box-shadow: none !important;
}

.apply-page .fx-phone-country-btn.btn:hover,
.apply-page .fx-phone-country-btn.btn:focus,
.apply-page .fx-phone-country-btn.btn:active,
.apply-page .fx-phone-country-btn.btn.show {
  background: rgba(var(--bs-primary-rgb, 212, 180, 106), 0.14) !important;
  background-color: rgba(var(--bs-primary-rgb, 212, 180, 106), 0.14) !important;
  color: var(--ap-ink) !important;
  box-shadow: none !important;
}

.apply-page .fx-phone-country-btn.btn::after {
  margin-left: 0.15rem;
  opacity: 0.55;
  border-top-width: 0.3em;
  border-right-width: 0.28em;
  border-left-width: 0.28em;
}

.apply-page .fx-phone-flag {
  width: 16px;
  height: 11px;
  object-fit: cover;
  flex: 0 0 auto;
}

.apply-page .fx-phone-dial-prefix {
  font-weight: 600;
  font-size: 0.88rem;
}

.apply-page .fx-phone-control > .fx-phone-national-input,
.apply-page .fx-phone-national-input.apply-control,
.apply-page .fx-phone-national-input.form-control {
  flex: 1 1 auto !important;
  width: 1% !important;
  max-width: none !important;
  min-width: 4rem !important;
  min-height: var(--ap-control-h) !important;
  padding: 0.65rem 0.85rem !important;
  border: 0 !important;
  border-radius: 0 var(--ap-radius) var(--ap-radius) 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  background-color: transparent !important;
  color: var(--ap-ink) !important;
}

.apply-page .fx-phone-control > .fx-phone-national-input:focus,
.apply-page .fx-phone-national-input.apply-control:focus,
.apply-page .fx-phone-national-input.apply-control:focus-visible {
  border: 0 !important;
  box-shadow: none !important;
  outline: 0 !important;
}

.apply-page .fx-phone-control > .dropdown-menu,
.apply-page .fx-phone-country-menu {
  position: absolute !important;
  inset: auto auto auto 0 !important;
  top: 100% !important;
  left: 0 !important;
  float: none !important;
  max-height: 250px;
  max-width: min(100vw - 2rem, 22rem);
  overflow: auto;
  min-width: 16rem;
  z-index: 1055;
  background: var(--ap-surface) !important;
  border: 1px solid var(--ap-line) !important;
  border-radius: var(--ap-radius) !important;
  box-shadow: 0 0.5rem 1.25rem rgba(31, 42, 46, 0.12) !important;
}

/* ---- Consent checkboxes ---- */
.apply-page .apply-check.form-check {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin: 0 0 0.95rem;
  min-height: 1.35rem;
  padding-left: 0;
}

.apply-page .apply-check .form-check-input {
  flex: 0 0 auto;
  width: 1.15rem;
  height: 1.15rem;
  margin: 0.15rem 0 0;
  float: none;
  background-color: var(--ap-surface);
  border: 1px solid var(--ap-line);
  border-radius: 0.2rem;
  cursor: pointer;
}

.apply-page .apply-check .form-check-input:focus {
  border-color: var(--ap-accent);
  outline: 0;
  box-shadow: 0 0 0 0.18rem var(--ap-accent-soft);
}

.apply-page .apply-check .form-check-input:checked {
  background-color: var(--ap-accent);
  border-color: var(--ap-accent);
}

.apply-page .apply-check .form-check-label {
  flex: 1 1 auto;
  margin: 0;
  padding: 0;
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1.45;
  color: var(--ap-ink);
  cursor: pointer;
}

.apply-form__alerts {
  margin: 0 0 1.25rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(176, 42, 55, 0.35);
  border-radius: var(--ap-radius);
  background: rgba(176, 42, 55, 0.06);
  color: #6f1d25;
}

.apply-form__alerts > div + div {
  margin-top: 0.35rem;
}

.apply-security__img {
  display: block;
  margin: 0;
  border: 1px solid var(--ap-line);
  border-radius: calc(var(--ap-radius) - 0.05rem);
  background: var(--ap-surface);
  width: 180px;
  max-width: 100%;
  height: auto;
}

/* Compact captcha + code row (presentation only) */
.apply-page .apply-verification__row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
  min-width: 0;
}

.apply-page .apply-verification__captcha {
  flex: 0 0 auto;
  min-width: 0;
}

.apply-page .apply-verification__field {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
}

.apply-page .apply-verification__label {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ap-ink);
}

.apply-page .apply-verification__field .apply-security__status {
  min-height: 1.15rem;
  margin-top: 0.3rem;
}

@media (min-width: 576px) {
  .apply-page .apply-verification__row {
    flex-direction: row;
    align-items: center;
    gap: 1rem;
  }

  .apply-page .apply-verification__captcha {
    flex: 0 0 auto;
  }

  .apply-page .apply-verification__field {
    flex: 1 1 auto;
  }
}

.apply-security__status.is-ok {
  color: #1b6b3a;
}

.apply-security__status.is-bad {
  color: #6f1d25;
}

.apply-form__actions {
  margin-top: 1.5rem;
}

.apply-form__actions.is-captcha-locked .apply-form__submit {
  display: none;
}

.apply-thanks__meta {
  margin-bottom: 1.25rem;
}

@media (max-width: 575.98px) {
  .apply-page {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }

  .apply-page .fx-phone-country-btn.btn,
  .apply-page .fx-phone-country-btn {
    max-width: 5.75rem !important;
    padding: 0.35rem 0.4rem !important;
    gap: 0.2rem !important;
    font-size: 0.82rem !important;
  }

  .apply-page .fx-phone-flag {
    width: 14px;
    height: 10px;
  }

  .apply-page input.apply-control[type="file"] {
    font-size: 0.85rem !important;
  }

  .apply-page input.apply-control[type="file"]::file-selector-button,
  .apply-page input.apply-control[type="file"]::-webkit-file-upload-button {
    margin-right: 0.55rem;
    padding: 0.35rem 0.65rem;
    font-size: 0.8rem;
  }
}
