/* ============================================
   APPLICATION FORMS — /pages/apply/*, /he/apply/*
   Hero comes from article.css (ip-hero). Logical properties (inline-start/end)
   so the same rules work right-to-left on the Hebrew pages.
   ============================================ */

.apply-hero { min-height: 40vh; }

.apply-main {
  background: #F5F3EE;
  padding: 3.5rem 1rem 6rem;
}

.apply-wrap {
  max-width: 760px;
  margin: 0 auto;
}

.apply__lang {
  text-align: end;
  margin: 0 0 1rem;
  font-family: 'Poppins', 'Assistant', sans-serif;
  font-size: 0.85rem;
}
.apply__lang a { color: #7B6118; text-decoration: none; border-bottom: 1px solid rgba(123, 97, 24, 0.35); }
.apply__lang a:hover { color: #10151D; border-color: #10151D; }

.apply {
  background: #FFFFFF;
  border: 1px solid #E8E4DA;
  border-radius: 3px;
  padding: 2.5rem 1.25rem 2rem;
  box-shadow: 0 30px 60px -40px rgba(16, 21, 29, 0.25);
}
@media (min-width: 700px) { .apply { padding: 3.25rem 3.5rem 2.75rem; } }

/* --- Progress --- */
.apply__progress {
  display: flex;
  gap: 0.4rem;
  list-style: none;
  margin: 0 0 2.5rem;
  padding: 0;
  counter-reset: step;
}
.apply__progress-step {
  flex: 1;
  min-width: 0;
  counter-increment: step;
}
.apply__progress-step[hidden] { display: none; }
.apply__progress-dot {
  display: block;
  height: 3px;
  border-radius: 2px;
  background: #E8E4DA;
  margin-bottom: 0.65rem;
  transition: background 0.4s ease;
}
.apply__progress-step.is-done .apply__progress-dot,
.apply__progress-step.is-current .apply__progress-dot { background: #A4832A; }
.apply__progress-label {
  display: block;
  font-family: 'Poppins', sans-serif;
  font-size: 0.62rem;
  font-weight: 300;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: #83807C;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.apply__progress-label::before { content: counter(step, decimal-leading-zero) '  '; color: #A4832A; }
.apply__progress-step.is-current .apply__progress-label { color: #10151D; }
@media (max-width: 600px) {
  .apply__progress-step:not(.is-current) .apply__progress-label { visibility: hidden; }
  .apply__progress-step.is-current .apply__progress-label { overflow: visible; }
}

/* --- Steps --- */
.apply__step[hidden] { display: none; }
.apply__step { animation: apply-in 0.45s ease both; }
@keyframes apply-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .apply__step { animation: none; } }

.apply__step-title {
  font-family: 'Cormorant', Georgia, serif;
  font-weight: 300;
  font-size: clamp(2rem, 4.5vw, 2.6rem);
  line-height: 1.15;
  color: #10151D;
  margin: 0 0 1.75rem;
  outline: none;
}
.apply__step-title::after {
  content: '';
  display: block;
  width: 48px;
  height: 1px;
  background: #A4832A;
  margin-top: 1rem;
}

.apply__intro {
  background: #F5F3EE;
  border-inline-start: 3px solid #A4832A;
  padding: 1.25rem 1.5rem;
  margin: 0 0 2.25rem;
  font-family: 'Quicksand', 'Assistant', sans-serif;
  color: #333231;
  line-height: 1.75;
}
.apply__intro p { margin: 0 0 0.5rem; }
.apply__intro ol { margin: 0 0 0.9rem; padding-inline-start: 1.3rem; }
.apply__note { font-size: 0.9rem; color: #53504C; margin: 0 0 1.5rem; line-height: 1.7; }
.apply__intro .apply__note { margin: 0; }

/* --- Fields --- */
.apply__field {
  margin: 0 0 1.9rem;
  padding: 0;
  border: 0;
  min-width: 0;
}
.apply__label {
  display: block;
  font-family: 'Quicksand', 'Assistant', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.5;
  color: #10151D;
  margin: 0 0 0.55rem;
  padding: 0;
}
.apply__optional {
  font-weight: 400;
  font-size: 0.8rem;
  color: #83807C;
  margin-inline-start: 0.35rem;
}
.apply__hint {
  margin: -0.2rem 0 0.6rem;
  font-size: 0.85rem;
  color: #83807C;
  font-family: 'Quicksand', 'Assistant', sans-serif;
}
.apply input[type="text"],
.apply input[type="email"],
.apply input[type="tel"],
.apply textarea {
  display: block;
  width: 100%;
  box-sizing: border-box;
  font: 400 1rem/1.6 'Quicksand', 'Assistant', sans-serif;
  color: #10151D;
  background: #FFFFFF;
  border: 1px solid #D9D3C4;
  border-radius: 3px;
  padding: 0.8rem 0.95rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.apply textarea { resize: vertical; min-height: 7.5rem; }
.apply input:focus,
.apply textarea:focus {
  outline: none;
  border-color: #A4832A;
  box-shadow: 0 0 0 3px rgba(164, 131, 42, 0.18);
}
@media (min-width: 700px) { .apply__field--short input { max-width: 26rem; } }
html[dir="rtl"] .apply input[dir="ltr"] { text-align: right; }

/* Radio cards */
.apply__choices { display: grid; gap: 0.6rem; grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr)); }
.apply__choice { position: relative; display: block; cursor: pointer; }
.apply__choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.apply__choice span {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 3.1rem;
  padding: 0.7rem 1rem;
  border: 1px solid #D9D3C4;
  border-radius: 3px;
  font-family: 'Quicksand', 'Assistant', sans-serif;
  font-size: 0.97rem;
  color: #333231;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.apply__choice span::before {
  content: '';
  flex: none;
  width: 1rem;
  height: 1rem;
  border: 1px solid #B9B1A0;
  border-radius: 50%;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}
.apply__choice:hover span { border-color: #A4832A; }
.apply__choice input:checked + span { border-color: #A4832A; background: #FBF8F0; color: #10151D; }
.apply__choice input:checked + span::before { border: 5px solid #A4832A; }
.apply__choice input:focus-visible + span { box-shadow: 0 0 0 3px rgba(164, 131, 42, 0.25); }

/* Affirmation checkbox */
.apply__affirm {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  padding: 1rem 1.15rem;
  border: 1px solid #D9D3C4;
  border-radius: 3px;
  background: #FBFAF6;
  cursor: pointer;
  font-family: 'Quicksand', 'Assistant', sans-serif;
  font-size: 0.97rem;
  line-height: 1.6;
  color: #333231;
}
.apply__affirm input { flex: none; width: 1.15rem; height: 1.15rem; margin-top: 0.2rem; accent-color: #A4832A; }
.apply__affirm:hover { border-color: #A4832A; }

/* Errors */
.apply__error { margin: 0.45rem 0 0; font-size: 0.85rem; color: #A23B2A; min-height: 0; }
.apply__error:empty { display: none; }
.apply__field--invalid input,
.apply__field--invalid textarea,
.apply__field--invalid .apply__choice span,
.apply__field--invalid .apply__affirm { border-color: #C9604D; }
.apply__status { margin: 0 0 1.25rem; color: #A23B2A; font-size: 0.92rem; }
.apply__status:empty { display: none; }

/* Honeypot */
.apply__hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* --- Navigation --- */
.apply__nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid #E8E4DA;
  padding-top: 1.75rem;
  margin-top: 0.5rem;
}
.apply__nav [data-action="next"],
.apply__nav [data-action="submit"] { margin-inline-start: auto; }
.apply__btn {
  font-family: 'Poppins', 'Assistant', sans-serif;
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #FFFFFF;
  background: #A4832A;
  border: 1px solid #A4832A;
  border-radius: 3px;
  padding: 0.95rem 2rem;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease;
}
.apply__btn:hover { background: transparent; color: #7B6118; }
.apply__btn:disabled { opacity: 0.6; cursor: progress; }
.apply__btn--ghost { background: transparent; color: #53504C; border-color: #D9D3C4; }
.apply__btn--ghost:hover { color: #10151D; border-color: #10151D; }
.apply__btn[hidden] { display: none; }
html[dir="rtl"] .apply__btn { font-size: 0.95rem; font-weight: 600; }

/* --- Review --- */
.apply__summary-section { border: 1px solid #E8E4DA; border-radius: 3px; margin: 0 0 1.25rem; }
.apply__summary-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #F5F3EE;
  padding: 0.8rem 1.1rem;
}
.apply__summary-head h3 { margin: 0; font-family: 'Cormorant', Georgia, serif; font-size: 1.35rem; font-weight: 500; color: #10151D; }
.apply__edit {
  background: none;
  border: 0;
  color: #7B6118;
  font-family: 'Poppins', 'Assistant', sans-serif;
  font-size: 0.8rem;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.apply__summary dl { margin: 0; padding: 0.4rem 1.1rem 0.9rem; }
.apply__summary dt { font-size: 0.8rem; color: #7B6118; margin: 0.8rem 0 0.15rem; font-family: 'Quicksand', 'Assistant', sans-serif; font-weight: 600; }
.apply__summary dd { margin: 0; color: #333231; white-space: pre-wrap; font-family: 'Quicksand', 'Assistant', sans-serif; line-height: 1.6; text-align: start; }

/* --- Done --- */
.apply__done {
  background: #FFFFFF;
  border: 1px solid #E8E4DA;
  border-radius: 3px;
  padding: 3.5rem 1.5rem;
  text-align: center;
  outline: none;
}
.apply__done[hidden] { display: none; }
.apply__done h2 { font-family: 'Cormorant', Georgia, serif; font-weight: 300; font-size: 2.6rem; color: #10151D; margin: 1rem 0 0.75rem; }
.apply__done p { font-family: 'Quicksand', 'Assistant', sans-serif; color: #333231; line-height: 1.7; margin: 0 0 0.5rem; }
.apply__done-mark {
  width: 56px; height: 56px; margin: 0 auto; border-radius: 50%;
  border: 1px solid #A4832A; position: relative;
}
.apply__done-mark::after {
  content: ''; position: absolute; left: 19px; top: 15px; width: 16px; height: 9px;
  border-left: 2px solid #A4832A; border-bottom: 2px solid #A4832A; transform: rotate(-45deg);
}
.apply__done-number { color: #83807C !important; font-size: 0.9rem; }

/* Hebrew: Latin display faces have no Hebrew glyphs */
html[dir="rtl"] .apply__step-title,
html[dir="rtl"] .apply__summary-head h3,
html[dir="rtl"] .apply__done h2 { font-family: 'Frank Ruhl Libre', serif; }
html[dir="rtl"] .apply__label,
html[dir="rtl"] .apply input,
html[dir="rtl"] .apply textarea,
html[dir="rtl"] .apply__choice span,
html[dir="rtl"] .apply__affirm,
html[dir="rtl"] .apply__intro,
html[dir="rtl"] .apply__summary dt,
html[dir="rtl"] .apply__summary dd,
html[dir="rtl"] .apply__done p { font-family: 'Assistant', sans-serif; }
html[dir="rtl"] .apply__progress-label { font-family: 'Assistant', sans-serif; font-size: 0.8rem; text-transform: none; }
