/* TAXR additive layer — accessibility (WCAG) helpers + form styling.
   Loaded LAST so it refines the ported design without changing its look. */

/* Sticky footer — keep the footer pinned to the bottom on short pages */
#site-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
#body-content {
  flex: 1 0 auto;
}
#footer {
  flex-shrink: 0;
  margin-top: auto;
}

/* Skip-to-content link: visible only on keyboard focus */
.skip-link {
  position: absolute;
  right: 0;
  top: -60px;
  z-index: 2000;
  background: #4F51FF;
  color: #fff;
  padding: 10px 18px;
  border-radius: 0 0 8px 0;
  transition: top 0.2s ease;
}
.skip-link:focus {
  top: 0;
  outline: 3px solid #0b1420;
  outline-offset: 2px;
}

/* Always-visible keyboard focus indicator (WCAG 2.4.7) */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #4F51FF;
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---- Lead form (/apply) ---- */
.apply-wrap {
  max-width: 560px;
  margin: 0 auto;
  padding: 24px 16px 64px;
}
.apply-progress {
  font-size: 14px;
  color: #4F51FF;
  font-weight: 500;
  margin-bottom: 8px;
}
.apply-progress__bar {
  height: 6px;
  background: #e9e9f7;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 24px;
}
.apply-progress__fill {
  height: 100%;
  background: #00D0B0;
  transition: width 0.3s ease;
}
.field {
  margin-bottom: 20px;
}
.field > label {
  display: block;
  font-weight: 500;
  margin-bottom: 6px;
  color: #0b1420;
}
/* One consistent control style for every text input, select and choice box */
.field .form-control,
.field .form-select,
.choice span {
  min-height: 52px;
  font-size: 16px;       /* avoids iOS zoom-on-focus */
  border: 1.5px solid #d7d7e6;
  border-radius: 10px;
  background-color: #fff;
}
/* Comfortable, balanced padding inside text inputs
   (overrides site.css's `padding-top: 1.5rem !important`) */
.field .form-control {
  height: auto;
  padding: 14px 18px !important;
  line-height: 1.4;
}
.field .form-control:focus,
.field .form-select:focus {
  border-color: #4F51FF;
  box-shadow: 0 0 0 3px rgba(79, 81, 255, 0.15);
}
.dob-row {
  display: flex;
  flex-direction: row-reverse; /* day on the left, year on the right */
  gap: 10px;
}
.dob-row > div {
  flex: 1;
}
.field-error {
  display: block;
  color: #c81e1e;
  font-size: 14px;
  font-weight: 500;
  margin-top: 6px;
}
.form-control[aria-invalid='true'],
.form-select[aria-invalid='true'] {
  border-color: #c81e1e;
  box-shadow: 0 0 0 1px #c81e1e;
}
fieldset.field {
  border: 0;
  padding: 0;
  margin: 0 0 20px;
}
fieldset.field > legend {
  font-weight: 500;
  margin-bottom: 8px;
  color: #0b1420;
  font-size: 1rem;
}
.choice-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.choice {
  flex: 1;
  min-width: 120px;
  position: relative;
}
.choice input {
  position: absolute;
  opacity: 0;
  inset: 0;
  cursor: pointer;
}
.choice span {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px;
  font-weight: 500;
  transition: all 0.15s ease;
}
.choice input:checked + span {
  border-color: #4F51FF;
  background: #eef0ff;
  color: #0b1420;
}
.choice input:focus-visible + span {
  outline: 3px solid #4F51FF;
  outline-offset: 2px;
}
.apply-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}
/* Every action button shares the exact same look */
.apply-actions .btn {
  flex: 1;
  min-height: 52px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.form-alert {
  padding: 14px 16px;
  border-radius: 10px;
  margin-bottom: 20px;
  font-weight: 500;
}
.form-alert--error {
  background: #fdecec;
  color: #9b1c1c;
  border: 1px solid #f3b4b4;
}
.apply-success {
  text-align: center;
  padding: 32px 16px;
}
.apply-success img {
  max-width: 220px;
  margin-bottom: 24px;
}

/* Dropdown arrow on the LEFT for every select box (RTL) + matching padding */
.form-select {
  background-position: left 0.75rem center;
  padding: 12px 18px 12px 2.25rem;
}

/* Footer — even spacing, no "|" separator */
.site-footer__bar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px 28px;
}
.site-footer__copy {
  margin: 0;
}
.footer__links {
  display: flex;
  gap: 28px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.footer__links li {
  border-right: 0; /* removes the white "|" from site.css */
  padding: 0;
}

/* ---- Eligibility questionnaire (step 1) ---- */
.q-section {
  border: 0;
  padding: 0;
  margin: 0 0 28px;
}
.q-section > legend {
  float: none;
  width: 100%;
  font-size: 1rem;
  font-weight: 500;
  color: #0b1420;
  margin-bottom: 16px;
}
/* Uses the original repo's round teal checkbox styling from site.css
   (.form-check / .form-check-label / .form-check-input). */
.q-section .form-check-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.q-section .form-check:focus-within .form-check-label::before {
  outline: 3px solid #4f51ff;
  outline-offset: 2px;
}

/* Partnership / redirect notes */
.partner-note {
  margin: 18px 0 24px;
  text-align: center;
  color: #858585;
  font-size: 0.95rem;
}
.redirect-note {
  margin-top: 14px;
  text-align: center;
  color: #858585;
  font-size: 0.95rem;
}

/* ---- Sending animation (submitting step) ---- */
.apply-sending {
  text-align: center;
  padding: 48px 16px 64px;
}
.apply-loader {
  position: relative;
  width: 88px;
  height: 88px;
  margin: 0 auto;
}
.apply-loader__ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 5px solid #e9fbf7;
  border-top-color: #00D0B0;
  border-right-color: #00D0B0;
  animation: apply-spin 0.85s linear infinite;
}
.apply-loader__plane {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: apply-pulse 1.4s ease-in-out infinite;
}
.apply-sending__dots span {
  opacity: 0;
  animation: apply-dot 1.4s infinite;
}
.apply-sending__dots span:nth-child(1) { animation-delay: 0s; }
.apply-sending__dots span:nth-child(2) { animation-delay: 0.2s; }
.apply-sending__dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes apply-spin {
  to { transform: rotate(360deg); }
}
@keyframes apply-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}
@keyframes apply-dot {
  0%, 80%, 100% { opacity: 0; }
  40% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
  /* keep the spinner gently rotating but slow, so it still reads as "loading" */
  .apply-loader__ring {
    animation: apply-spin 2.4s linear infinite !important;
  }
  .apply-sending__dots span { opacity: 1; }
}

/* Visible tax guidance uses the existing RTL section and grid layout. */
.tax-guide p {
  max-width: none;
}
.tax-guide a {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.tax-guide__source {
  font-size: 0.95rem;
}
.tax-guide__list {
  padding-inline-start: 24px;
  margin-bottom: 20px;
}
.tax-guide__list li + li {
  margin-top: 8px;
}
.tax-guide__steps {
  list-style: none;
  padding: 0;
}
.site-footer__contact {
  margin: 24px 0 0;
  font-style: normal;
  text-align: center;
}
.site-footer__contact p {
  max-width: none;
  margin-bottom: 12px;
}
.site-footer__contact-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px 24px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-footer__contact-links a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Keep mobile navigation and the persistent CTA clear of readable content. */
@media (max-width: 767.98px) {
  .site-header .logo {
    flex-shrink: 0;
    margin-inline-start: 12px;
  }
  #main-navigation .nav-menu {
    gap: 12px;
  }
  #main-navigation .nav-menu__item {
    margin-right: 0;
  }
  .btn--floating {
    top: auto;
    bottom: 16px;
    right: 16px;
    min-width: 0;
    font-size: 1.2rem;
    padding: 12px 24px;
  }
  .site-footer__contact {
    padding-bottom: 80px;
  }
}
