/* =========================================================
   APPLY PAGE
   Loaded after style.css, so it inherits the nav, buttons
   and body colors and only adds what the form needs.
   ========================================================= */

/* ---------- PAGE HEADER ----------
   nav is `position: fixed` at 70px tall, so every page needs
   top padding or the first content sits underneath it. */
.apply-header {
  position: relative;
  padding: 8rem 5rem 3.5rem;
  background-color: #0D0010;
  background-image: var(--page-bg);
  background-size: cover;
  background-position: center;
}

/* dark wash so the form intro stays readable over the photo */
.apply-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    rgba(5,0,15,0.92) 0%,
    rgba(11,0,20,0.82) 50%,
    rgba(13,0,22,0.55) 100%
  );
}

.apply-header-inner { position: relative; z-index: 1; }

.apply-header-inner {
  max-width: 820px;
  margin: 0 auto;
}

.apply-logo {
  height: 78px;
  width: auto;
  display: block;
  margin-bottom: 1.75rem;
}

.apply-title {
  font-size: clamp(2rem, 4.5vw, 3.3rem);
  font-weight: 900;
  line-height: 1.1;
  color: #FFFFFF;
  margin-bottom: 1rem;
}

.apply-lead {
  font-size: 0.98rem;
  line-height: 1.8;
  color: rgba(255,255,255,0.75);
  max-width: 660px;
}

.apply-notice {
  margin-top: 1.75rem;
  padding: 1.15rem 1.35rem;
  border-left: 3px solid #E8874A;
  background: rgba(232,135,74,0.08);
  font-size: 0.9rem;
  line-height: 1.75;
  color: rgba(255,255,255,0.85);
  max-width: 660px;
}

.apply-notice strong { color: #E8874A; }

.apply-notice a {
  color: #E8874A;
  text-decoration: none;
  font-weight: 700;
  white-space: nowrap;
}

.apply-notice a:hover { text-decoration: underline; }

.requirements-title {
  margin-top: 1.1rem;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #E8874A;
}

.requirements {
  margin: 0.5rem 0 0 1.1rem;
  padding: 0;
  font-size: 0.86rem;
  color: rgba(255,255,255,0.7);
}

.requirements li { margin-bottom: 0.3rem; }

/* =========================================================
   LAYOUT — side rail + form
   Two columns centered together. The rail fills what was
   dead space on the left and tracks progress through the form.
   ========================================================= */
.apply-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 820px);
  gap: 4.5rem;
  justify-content: center;
  padding: 3.5rem 3rem 6rem;
}

.apply-rail {
  position: sticky;
  top: 110px;               /* clears the 70px fixed nav */
  align-self: start;
  padding-left: 1.25rem;
  border-left: 1px solid rgba(123,47,190,0.25);
}

.rail-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: rgba(255,255,255,0.35);
  margin-bottom: 1.1rem;
}

.rail-list {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
}

.rail-list a {
  display: flex;
  gap: 0.6rem;
  align-items: baseline;
  padding: 0.42rem 0;
  font-size: 0.8rem;
  line-height: 1.45;
  color: rgba(255,255,255,0.42);
  text-decoration: none;
  transition: color 0.2s;
}

.rail-list a:hover { color: rgba(255,255,255,0.8); }

.rail-num {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.25);
  transition: color 0.2s;
}

.rail-list a.active { color: #FFFFFF; font-weight: 600; }
.rail-list a.active .rail-num { color: #E8874A; }

.rail-progress {
  width: 2px;
  height: 60px;
  background: rgba(123,47,190,0.2);
  border-radius: 2px;
  overflow: hidden;
}

.rail-progress-bar {
  width: 100%;
  height: 0%;
  background: linear-gradient(to bottom, #7B2FBE, #E8874A);
  transition: height 0.35s ease;
}

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

/* =========================================================
   SECTION PANELS
   ========================================================= */
.form-section {
  position: relative;
  margin-bottom: 2rem;
  padding: 2.5rem 2.5rem 2.5rem 2.75rem;
  background: rgba(255,255,255,0.025);
  border: 1px solid rgba(123,47,190,0.28);
  border-radius: 6px;
  overflow: hidden;
}

/* accent bar down the left edge */
.form-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 3px;
  background: #7B2FBE;
}

/* big faint section number in the corner — fills the panel's
   empty top-right and reads as letterhead rather than clutter.
   `attr(data-num)` pulls the value straight off the HTML element. */
.form-section::after {
  content: attr(data-num);
  position: absolute;
  top: 0.5rem;
  right: 1.5rem;
  font-size: 5rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.04em;
  color: rgba(123,47,190,0.10);
  pointer-events: none;
}

.section-heading {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
  font-size: 1.1rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #FFFFFF;
  padding-bottom: 1.25rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid rgba(123,47,190,0.2);
}

.section-num {
  font-size: 0.85rem;
  font-weight: 900;
  color: #E8874A;
  letter-spacing: 0.1em;
}

.section-intro {
  font-size: 0.88rem;
  color: rgba(255,255,255,0.55);
  line-height: 1.75;
  margin-top: -1.25rem;
  margin-bottom: 2rem;
}

/* =========================================================
   FIELDS
   ========================================================= */
.field { margin-bottom: 2.25rem; }
.form-section > .field:last-child { margin-bottom: 0; }

.field-row {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.field-row .field {
  flex: 1;
  min-width: 200px;
}

.field label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.65;
  color: #FFFFFF;
  margin-bottom: 0.5rem;
}

.req { color: #E8874A; }

.hint {
  font-size: 0.82rem;
  line-height: 1.65;
  color: rgba(255,255,255,0.5);
  margin-bottom: 0.7rem;
}

.hint code {
  background: rgba(123,47,190,0.25);
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  font-size: 0.78rem;
  color: #FFF5C8;
}

input[type="text"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 0.75rem 0.9rem;
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(123,47,190,0.3);
  border-radius: 4px;
  color: #FFFFFF;
  font-family: inherit;
  font-size: 0.92rem;
  line-height: 1.7;
  transition: border-color 0.2s, background 0.2s;
}

textarea { resize: vertical; min-height: 90px; }

input[type="text"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #7B2FBE;
  background: rgba(123,47,190,0.1);
}

select option {
  background: #14001E;
  color: #FFFFFF;
}

/* =========================================================
   RADIO / CHECKBOX LISTS
   Real circles and boxes, stacked. `accent-color` recolors the
   browser's native control without rebuilding it — one line,
   and it stays accessible and familiar.
   ========================================================= */
.radio-list {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin-top: 0.35rem;
}

/* Note the `.field .radio` prefix. These labels sit inside `.field`,
   and `.field label` above sets display:block + bold. Two classes
   outrank one class + one element, so this is what makes it stick. */
.field .radio {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  gap: 0.7rem;
  padding: 0.45rem 0.8rem 0.45rem 0.6rem;
  margin: 0;
  border-radius: 4px;
  font-size: 0.89rem;
  font-weight: 400;
  line-height: 1.5;
  color: rgba(255,255,255,0.78);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.field .radio:hover {
  background: rgba(123,47,190,0.12);
  color: #FFFFFF;
}

.field .radio input {
  accent-color: #7B2FBE;
  width: 16px;
  height: 16px;
  margin: 0;
  flex-shrink: 0;
  cursor: pointer;
}

.field .radio:has(input:checked) {
  color: #FFFFFF;
  font-weight: 600;
}

/* =========================================================
   CONSENT CHECKBOXES
   ========================================================= */
.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  font-size: 0.88rem;
  font-weight: 400;
  line-height: 1.75;
  color: rgba(255,255,255,0.8);
  cursor: pointer;
}

.checkbox input {
  accent-color: #7B2FBE;
  width: 16px;
  height: 16px;
  margin-top: 0.35rem;
  cursor: pointer;
  flex-shrink: 0;
}

/* ---------- CHARACTER COUNTER ---------- */
.counter {
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  margin-top: 0.45rem;
  text-align: right;
}

.counter.under { color: rgba(232,135,74,0.85); }   /* below the minimum */
.counter.ok    { color: rgba(255,255,255,0.35); }  /* minimum met */

/* ---------- ERROR STATE ---------- */
.field.error input[type="text"],
.field.error input[type="number"],
.field.error select,
.field.error textarea {
  border-color: #B03030;
  background: rgba(176,48,48,0.1);
}

.field.error .radio-list {
  border-left: 2px solid #B03030;
  padding-left: 0.5rem;
}

/* ---------- SUBMIT ---------- */
.submit-row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-top: 2.5rem;
}

/* btn-primary is an <a> in style.css and a <button> here,
   so these few lines reconcile the difference. */
button.btn-primary {
  border: none;
  cursor: pointer;
  font-family: inherit;
}

button.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.form-status {
  font-size: 0.85rem;
  line-height: 1.6;
}

.form-status.error { color: #E8874A; }

/* ---------- SUCCESS PANEL ----------
   On submit, JS adds .is-complete to the layout. That collapses the
   two-column grid down to one centred column, so the confirmation sits
   in the middle of the page instead of in the old form column. */
.apply-layout.is-complete {
  grid-template-columns: minmax(0, 640px);
  justify-content: center;
  padding: 11rem 2rem 10rem;
}

.success-panel {
  position: relative;
  max-width: 640px;
  margin: 0 auto;
  padding: 3.5rem 3rem;
  text-align: center;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(123,47,190,0.3);
  border-radius: 8px;
  overflow: hidden;
}

/* accent bar across the top of the card */
.success-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(to right, #7B2FBE, #E8874A);
}

.success-logo {
  height: 64px;
  width: auto;
  margin: 0 auto 1.75rem;
  display: block;
}

.success-panel h2 {
  font-size: 1.9rem;
  font-weight: 900;
  color: #E8874A;
  margin-bottom: 1.1rem;
}

.success-panel p {
  font-size: 0.96rem;
  line-height: 1.85;
  color: rgba(255,255,255,0.75);
  margin: 0 auto 1rem;
  max-width: 440px;
}

.success-sub {
  font-size: 0.85rem !important;
  color: rgba(255,255,255,0.45) !important;
  margin-bottom: 2rem !important;
}

/* =========================================================
   RESPONSIVE
   Below 1200px the rail has nowhere to live, so it's hidden
   and the form takes the full column.
   ========================================================= */
@media (max-width: 1200px) {
  .apply-layout {
    grid-template-columns: minmax(0, 820px);
    padding: 3rem 2.5rem 5rem;
  }
  .apply-rail { display: none; }
}

@media (max-width: 700px) {
  .apply-layout.is-complete { padding: 8rem 1.25rem 5rem; }
  .success-panel     { padding: 2.5rem 1.5rem; }
  .apply-header      { padding: 7rem 1.25rem 2.5rem; }
  .apply-layout      { padding: 2rem 1.25rem 4rem; }
  .apply-logo        { height: 60px; }
  .form-section      { padding: 1.75rem 1.25rem 1.75rem 1.5rem; }
  .form-section::after { font-size: 3.5rem; right: 1rem; }
}
