/* Mentor application form. Single-column production form pattern.
   Stripe / Linear / OpenAI Console reference. */

/* Container — narrow on purpose. Forms read better short. */
.hb-page.apply-page {
  max-width: 640px;
  padding: 64px 40px 120px;
}

/* Inputs ship as content-box by default — that breaks width:100% + padding.
   Scope border-box to anything inside the form, but keep it local. */
.apply-page *,
.apply-page *::before,
.apply-page *::after {
  box-sizing: border-box;
}

/* Kill all browser-default fieldset chrome — we draw our own. */
.apply-form fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}
.apply-form legend {
  padding: 0;
  display: block;
}

/* --- Hero ------------------------------------------------------------ */

.apply-page > h1 {
  font-size: clamp(28px, 3.2vw, 36px);
  line-height: 1.15;
  letter-spacing: -0.022em;
  margin: 8px 0 14px;
  text-wrap: balance;
}
.apply-page > .h1-sub {
  font-size: 16px;
  color: var(--fg-secondary);
  line-height: 1.6;
  margin: 0 0 56px;
  text-wrap: pretty;
}

/* --- Honeypot -------------------------------------------------------- */

.apply-form .hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* --- Sections -------------------------------------------------------- */

.apply-section {
  margin: 0 0 48px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
}
.apply-section:first-of-type {
  border-top: none;
  padding-top: 0;
}

.apply-section-title {
  font-family: var(--sans);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.3;
  color: var(--fg);
  margin: 0 0 8px;
  /* override .hb-page h2 */
  border: none;
  padding-top: 0;
}
.apply-section-sub {
  font-size: 14.5px;
  color: var(--fg-secondary);
  line-height: 1.55;
  margin: 0 0 28px;
  text-wrap: pretty;
}
.apply-section-title:last-child,
.apply-section-title + .apply-grid,
.apply-section-title + .apply-field,
.apply-section-title + fieldset {
  /* When there's no sub paragraph, give the heading some breathing room */
  margin-bottom: 28px;
}
.apply-section-sub + .apply-grid,
.apply-section-sub + .apply-field,
.apply-section-sub + fieldset,
.apply-section-sub + .sample-submission {
  margin-top: 0;
}

/* --- Form fields ----------------------------------------------------- */

.apply-grid.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}
.apply-grid.two:last-child { margin-bottom: 0; }

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

.apply-field label,
.apply-field legend {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--fg);
  margin-bottom: 8px;
  line-height: 1.4;
}
.apply-field .req {
  color: var(--magenta);
  margin-left: 2px;
  font-weight: 600;
}
.apply-field .apply-optional {
  font-weight: 400;
  color: var(--fg-tertiary);
  margin-left: 6px;
  font-size: 12.5px;
}

.apply-field input[type="text"],
.apply-field input[type="email"],
.apply-field input[type="url"],
.apply-field select,
.apply-field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  font-family: var(--sans);
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--fg);
  background: #fff;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  -webkit-appearance: none;
  appearance: none;
}
.apply-field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23545E63' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
.apply-field textarea {
  resize: vertical;
  min-height: 120px;
}
.apply-field input:focus,
.apply-field select:focus,
.apply-field textarea:focus {
  border-color: var(--magenta);
  box-shadow: 0 0 0 3px rgba(153, 41, 147, 0.10);
}
.apply-field input::placeholder,
.apply-field textarea::placeholder {
  color: var(--fg-tertiary);
  opacity: 1;
}
.apply-field.invalid input,
.apply-field.invalid select,
.apply-field.invalid textarea { border-color: #b8302a; }
.apply-field.invalid input:focus,
.apply-field.invalid select:focus,
.apply-field.invalid textarea:focus {
  box-shadow: 0 0 0 3px rgba(184, 48, 42, 0.12);
}

.apply-help {
  font-size: 12.5px;
  color: var(--fg-tertiary);
  line-height: 1.55;
  margin: 8px 0 0;
}
.apply-help-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin-top: 8px;
}
.apply-help-row .apply-help { margin: 0; flex: 1; }
.apply-counter {
  font-size: 11.5px;
  color: var(--fg-tertiary);
  font-family: var(--mono);
  letter-spacing: 0.04em;
  margin: 0;
  flex: none;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
/* `met` is currently styled the same as the default (gray tertiary). The
   format change from "X / Y chars" to "X chars" is the signal — no color
   shift needed. Kept as a hook for future polish (e.g. a tiny ✓). */

/* --- Sample submission (rubric reference) ---------------------------- */

.sample-submission {
  background: #fbf8f3;
  border-left: 3px solid var(--magenta);
  border-radius: 0 10px 10px 0;
  padding: 24px 28px 20px;
  margin: 0 0 28px;
}
.sample-submission .ss-label {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--magenta);
  margin-bottom: 12px;
}
.sample-submission .ss-title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--fg);
  margin: 0 0 16px;
  line-height: 1.3;
}
.sample-submission .ss-body p {
  font-size: 14px;
  line-height: 1.65;
  color: var(--fg-secondary);
  margin: 0 0 10px;
}
.sample-submission .ss-body p:last-child { margin-bottom: 0; }
.sample-submission .ss-body strong { color: var(--fg); font-weight: 600; }

/* --- Radio cards ----------------------------------------------------- */

.radio-list { display: flex; flex-direction: column; gap: 10px; }
.radio-row { display: flex; gap: 10px; flex-wrap: wrap; }

.radio {
  display: block;
  position: relative;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 14px 18px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  background: #fff;
}
.radio:hover { border-color: var(--magenta); }
.radio input[type="radio"] {
  position: absolute;
  left: -9999px;
  opacity: 0;
}
.radio .r-title {
  display: block;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 4px;
  letter-spacing: -0.005em;
}
.radio .r-sub {
  display: block;
  font-size: 13px;
  color: var(--fg-secondary);
  line-height: 1.5;
}
.radio.compact {
  padding: 11px 20px;
  flex: 1 1 0;
  text-align: center;
}
.radio.compact .r-title { margin-bottom: 0; font-size: 14px; }

.radio:has(input:checked) {
  border-color: var(--magenta);
  background: #fbf8f3;
  box-shadow: 0 0 0 3px rgba(153, 41, 147, 0.06);
}
.radio:has(input:checked) .r-title { color: var(--magenta); }

/* --- Checkbox list (availability) ------------------------------------ */

.check-list { display: flex; flex-direction: column; gap: 10px; }
.check {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  background: #fff;
  font-size: 14px;
  color: var(--fg);
}
.check:hover { border-color: var(--magenta); }
.check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  flex: none;
  accent-color: var(--magenta);
}
.check:has(input:checked) {
  border-color: var(--magenta);
  background: #fbf8f3;
}

/* --- Turnstile + Submit + Privacy ------------------------------------ */

.apply-turnstile {
  margin: 36px 0 24px;
  min-height: 70px;
}

.apply-actions { margin: 8px 0 32px; }
.apply-submit {
  background: var(--near-black);
  color: var(--paper);
  border: none;
  padding: 15px 32px;
  border-radius: 100px;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.005em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: background 0.18s ease;
}
.apply-submit:hover:not(:disabled) { background: var(--magenta); }
.apply-submit:disabled { opacity: 0.5; cursor: not-allowed; }
.apply-submit.loading { background: var(--fg-secondary); cursor: progress; }
.apply-submit .arrow { transition: transform 0.2s ease; }
.apply-submit:hover:not(:disabled) .arrow { transform: translateX(3px); }
.apply-privacy {
  margin: 16px 0 0;
  font-size: 12.5px;
  color: var(--fg-tertiary);
  line-height: 1.6;
}

/* --- Error + success ------------------------------------------------- */

.apply-error {
  margin: 20px 0 0;
  padding: 16px 20px;
  background: #fdf3f2;
  border-left: 3px solid #b8302a;
  border-radius: 0 8px 8px 0;
}
.apply-error .ae-msg {
  font-size: 14.5px;
  color: var(--fg);
  margin: 0 0 6px;
  font-weight: 500;
}
.apply-error .ae-ref {
  margin: 0;
  font-size: 12px;
  color: var(--fg-tertiary);
  font-family: var(--mono);
}
.apply-error code { font-family: var(--mono); }

.apply-success {
  padding: 44px 44px;
  background: #fbf8f3;
  border-left: 3px solid var(--magenta);
  border-radius: 0 12px 12px 0;
  margin: 32px 0 0;
}
.apply-success .as-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--magenta);
  margin-bottom: 20px;
}
.apply-success h2 {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.018em;
  color: var(--fg);
  margin: 0 0 14px;
  border: none;
  padding-top: 0;
}
.apply-success p {
  font-size: 15px;
  color: var(--fg-secondary);
  line-height: 1.65;
  margin: 0 0 12px;
}
.apply-success .as-ref {
  font-size: 12px;
  color: var(--fg-tertiary);
  font-family: var(--mono);
  margin-top: 18px;
}
.apply-success .as-ref code { font-family: var(--mono); }
.apply-success .as-links {
  margin-top: 28px;
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}
.apply-success .as-links a {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--fg);
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-underline-offset: 3px;
}
.apply-success .as-links a:hover {
  color: var(--magenta);
  text-decoration-color: var(--magenta);
}

/* --- Mobile (< 780px) ------------------------------------------------ */

@media (max-width: 780px) {
  .hb-page.apply-page { padding: 32px 22px 80px; }

  .apply-page > h1 { font-size: 28px; }
  .apply-page > .h1-sub { margin-bottom: 40px; }

  .apply-grid.two {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .apply-section {
    margin-bottom: 40px;
    padding-top: 32px;
  }

  .sample-submission { padding: 20px 22px 16px; }

  .radio.compact { padding: 12px 18px; }

  .apply-submit { width: 100%; justify-content: center; padding: 14px 28px; }
  .apply-success { padding: 32px 24px; }
  .apply-success h2 { font-size: 22px; }
}
