/* Support Application Portal */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.apply-page {
  background: var(--grey-warm);
}

.apply-main {
  position: relative;
  padding: 3rem 0 5rem;
  overflow: hidden;
}

.apply-main::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      165deg,
      rgba(255, 255, 255, 0.88) 0%,
      rgba(139, 168, 136, 0.28) 38%,
      rgba(168, 197, 214, 0.32) 62%,
      rgba(232, 228, 222, 0.9) 100%
    ),
    url("../images/hero.png") center 22% / cover no-repeat;
  z-index: 0;
  pointer-events: none;
}

.apply-main::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cpath d='M0 60 Q30 40 60 60 T120 60' fill='none' stroke='%231B4B4A' stroke-width='0.5' opacity='0.06'/%3E%3C/svg%3E");
  background-size: 120px 120px;
  opacity: 0.5;
  z-index: 0;
  pointer-events: none;
}

.apply-container {
  max-width: 820px;
  position: relative;
  z-index: 1;
}

/* Intro */
.apply-intro-block {
  display: grid;
  grid-template-columns: minmax(0, 1fr) min(220px, 32%);
  gap: 2rem;
  align-items: start;
  margin-bottom: 2.5rem;
}

.apply-intro-copy h1 {
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 4vw, 2.5rem);
  font-weight: 400;
  line-height: 1.2;
  color: var(--teal-deep);
  margin: 0 0 1.25rem;
  text-wrap: balance;
}

.apply-intro-sub {
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--text);
  margin: 0;
}

.apply-intro-photo {
  margin: 0;
}

.apply-intro-photo img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.apply-intro-block.is-collapsed {
  display: none;
}

/* Form shell */
.apply-form {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(27, 75, 74, 0.1);
  border-radius: 12px;
  padding: 2.25rem 2.5rem 2rem;
  box-shadow: 0 8px 32px rgba(27, 75, 74, 0.06);
}

.apply-form-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(27, 75, 74, 0.08);
}

.apply-progress-wrap {
  flex: 1;
  min-width: 0;
}

.apply-progress {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.apply-progress-segment {
  flex: 1;
  height: 3px;
  border-radius: 999px;
  background: rgba(27, 75, 74, 0.12);
  transition: background 0.25s ease;
}

.apply-progress-segment.is-active,
.apply-progress-segment.is-complete {
  background: var(--sage);
}

.apply-progress-segment.is-complete {
  background: rgba(139, 168, 136, 0.55);
}

.apply-saved-note {
  margin: 0.65rem 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
}

.apply-save-exit {
  flex-shrink: 0;
  background: none;
  border: none;
  padding: 0.25rem 0;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.apply-save-exit:hover {
  color: var(--teal-deep);
}

.apply-save-exit:focus-visible {
  outline: 2px solid var(--teal-deep);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Steps */
.apply-step {
  border: none;
  margin: 0;
  padding: 0;
  min-width: 0;
}

.apply-step-heading {
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 3vw, 1.85rem);
  font-weight: 400;
  color: var(--teal-deep);
  margin: 0 0 0.85rem;
  line-height: 1.25;
}

.apply-step-helper {
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--text);
  margin: 0 0 2rem;
}

.apply-form-message {
  font-size: 1rem;
  line-height: 1.55;
  color: var(--text);
  margin: 0 0 1.5rem;
  padding: 0.85rem 1rem;
  background: rgba(139, 168, 136, 0.12);
  border-radius: 8px;
}

.apply-form-message[hidden] {
  display: none;
}

/* Fields */
.apply-field {
  margin-bottom: 1.75rem;
}

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

.apply-field label,
.apply-consent-checkbox span {
  display: block;
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.apply-optional {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.apply-field-hint {
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--text-muted);
  margin: -0.25rem 0 0.65rem;
}

.apply-field input[type="text"],
.apply-field input[type="email"],
.apply-field input[type="tel"],
.apply-field textarea {
  display: block;
  width: 100%;
  padding: 0.95rem 1.1rem;
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.5;
  color: var(--text);
  background: #faf8f4;
  border: 1px solid rgba(27, 75, 74, 0.18);
  border-radius: 11px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.apply-field textarea {
  min-height: 7rem;
  resize: vertical;
}

.apply-field input:focus-visible,
.apply-field textarea:focus-visible {
  outline: none;
  border-color: var(--sage);
  box-shadow: 0 0 0 3px rgba(139, 168, 136, 0.25);
}

.apply-field input.is-noted,
.apply-field textarea.is-noted {
  border-color: rgba(27, 75, 74, 0.35);
}

/* Checkboxes */
.apply-checkbox-group {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem 1.25rem;
}

.apply-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.1rem;
  background: #faf8f4;
  border: 1px solid rgba(27, 75, 74, 0.12);
  border-radius: 11px;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.apply-checkbox:hover {
  border-color: rgba(27, 75, 74, 0.22);
  background: #f7f4ef;
}

.apply-checkbox input {
  flex-shrink: 0;
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.15rem;
  accent-color: var(--teal-deep);
  cursor: pointer;
}

.apply-checkbox input:focus-visible {
  outline: 2px solid var(--teal-deep);
  outline-offset: 2px;
}

.apply-checkbox span {
  font-size: 1.02rem;
  line-height: 1.45;
  color: var(--text);
}

.apply-checkbox:has(input:checked) {
  border-color: rgba(139, 168, 136, 0.65);
  background: rgba(139, 168, 136, 0.1);
}

/* Consent step */
.apply-consent-list {
  margin: 0 0 2rem;
  padding-left: 1.35rem;
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1.65;
}

.apply-consent-list li {
  margin-bottom: 0.65rem;
}

.apply-consent-list li:last-child {
  margin-bottom: 0;
}

.apply-consent-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1.25rem 1.35rem;
  background: #faf8f4;
  border: 1px solid rgba(27, 75, 74, 0.14);
  border-radius: 11px;
  cursor: pointer;
}

.apply-consent-checkbox input {
  flex-shrink: 0;
  width: 1.2rem;
  height: 1.2rem;
  margin-top: 0.2rem;
  accent-color: var(--teal-deep);
}

.apply-consent-checkbox span {
  font-weight: 400;
  font-size: 1.02rem;
  line-height: 1.55;
  margin-bottom: 0;
}

.apply-consent-checkbox a {
  color: var(--teal-deep);
  font-weight: 600;
  text-underline-offset: 3px;
}

.apply-consent-checkbox:has(input:focus-visible) {
  outline: 2px solid var(--teal-deep);
  outline-offset: 2px;
}

/* Navigation */
.apply-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(27, 75, 74, 0.08);
}

.apply-nav button[hidden] {
  display: none !important;
}

.apply-form:not(.apply-form--final-step) .apply-submit {
  display: none !important;
}

.apply-form.apply-form--final-step .apply-next {
  display: none !important;
}

.apply-needs-other {
  margin-top: 1.25rem;
}

.apply-nav .apply-next,
.apply-nav .apply-submit {
  margin-left: auto;
}

.apply-submit[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Confirmation */
.apply-confirmation {
  text-align: center;
  max-width: 640px;
  margin: 0 auto;
  padding: 3rem 0 2rem;
}

.apply-confirmation[hidden] {
  display: none;
}

.apply-confirmation h1 {
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 4vw, 2.45rem);
  font-weight: 400;
  line-height: 1.2;
  color: var(--teal-deep);
  margin: 0 0 1.5rem;
  text-wrap: balance;
}

.apply-confirmation p {
  font-size: 1.08rem;
  line-height: 1.7;
  color: var(--text);
  margin: 0 0 2rem;
}

/* Quick exit - more visible on apply page */
.quick-exit-apply {
  max-width: 260px;
  padding: 0.9rem 1.15rem;
  font-size: 0.9rem;
  border-color: rgba(27, 75, 74, 0.18);
  box-shadow: 0 6px 24px rgba(27, 75, 74, 0.14);
}

@media (max-width: 768px) {
  .apply-main {
    padding: 2rem 0 4.5rem;
  }

  .apply-intro-block {
    grid-template-columns: 1fr;
  }

  .apply-intro-photo {
    max-width: 280px;
  }

  .apply-form {
    padding: 1.75rem 1.35rem 1.5rem;
  }

  .apply-form-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .apply-save-exit {
    align-self: flex-end;
  }

  .apply-checkbox-group {
    grid-template-columns: 1fr;
  }

  .apply-nav {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .apply-nav .btn {
    width: 100%;
    text-align: center;
    margin-left: 0 !important;
  }

  .quick-exit-apply {
    bottom: 0.75rem;
    right: 0.75rem;
    left: 0.75rem;
    max-width: none;
  }

}
