/* ============================================================
   Apply modal — application form
   Reuses the site's design tokens (defined per-page in :root):
   --bg, --bg-elevated, --surface, --text, --text-muted, --text-dim,
   --border, --border-strong, --yellow, --yellow-dark, --red, --red-dark,
   --sans, --mono
   ============================================================ */

/* The Apply CTA button reuses the page's .btn / .btn-red styles.
   These rules only add modal-specific UI. */

.apply-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  overflow-y: auto;
  background: rgba(5, 9, 20, 0.72);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.apply-overlay.is-open { display: flex; }
body.apply-lock { overflow: hidden; }

.apply-modal {
  position: relative;
  width: 100%;
  max-width: 560px;
  margin: auto;
  background: var(--bg-elevated, #131D44);
  border: 1px solid var(--border-strong, rgba(255,255,255,0.16));
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
  font-family: var(--sans, system-ui, sans-serif);
  color: var(--text, #fff);
  animation: apply-pop 0.18s ease;
}
@keyframes apply-pop {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}

.apply-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 28px 18px;
  border-bottom: 1px solid var(--border, rgba(255,255,255,0.08));
}
.apply-modal-title {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.apply-modal-title .y { color: var(--yellow, #FFC93C); }
.apply-modal-sub {
  margin-top: 4px;
  font-family: var(--mono, monospace);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--text-dim, #6B7290);
  text-transform: uppercase;
}

.apply-close {
  flex: none;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted, #A8AFC2);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.15s ease;
}
.apply-close:hover { color: var(--text, #fff); border-color: var(--text, #fff); }

.apply-form { padding: 22px 28px 28px; }
.apply-intro {
  font-size: 14px;
  color: var(--text-muted, #A8AFC2);
  margin-bottom: 18px;
}

.apply-field { margin-bottom: 16px; }
.apply-field > label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted, #A8AFC2);
  margin-bottom: 7px;
}
.apply-field .req { color: var(--red, #E84747); margin-left: 2px; }

.apply-input,
.apply-select,
.apply-file {
  width: 100%;
  font-family: var(--sans, system-ui, sans-serif);
  font-size: 15px;
  color: var(--text, #fff);
  background: var(--surface, rgba(255,255,255,0.03));
  border: 1px solid var(--border-strong, rgba(255,255,255,0.16));
  border-radius: 8px;
  padding: 12px 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.apply-input::placeholder { color: var(--text-dim, #6B7290); }
.apply-input:focus,
.apply-select:focus,
.apply-file:focus {
  outline: none;
  border-color: var(--yellow, #FFC93C);
  box-shadow: 0 0 0 3px rgba(255, 201, 60, 0.18);
}
.apply-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23A8AFC2' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
  cursor: pointer;
}
.apply-select option { background: var(--bg-elevated, #131D44); color: var(--text, #fff); }

/* native file input */
.apply-file { padding: 10px 14px; cursor: pointer; }
.apply-file::file-selector-button {
  font-family: var(--sans, system-ui, sans-serif);
  font-weight: 600;
  font-size: 13px;
  color: #0A1432;
  background: var(--yellow, #FFC93C);
  border: none;
  border-radius: 6px;
  padding: 7px 12px;
  margin-right: 12px;
  cursor: pointer;
}
.apply-hint {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-dim, #6B7290);
}

/* two-up on wider screens */
.apply-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 480px) {
  .apply-row { grid-template-columns: 1fr; }
  .apply-modal-head { padding: 20px 18px 16px; }
  .apply-form { padding: 18px 18px 22px; }
}

/* validation error */
.apply-field.has-error .apply-input,
.apply-field.has-error .apply-select,
.apply-field.has-error .apply-file {
  border-color: var(--red, #E84747);
}
.apply-error {
  display: none;
  margin-top: 6px;
  font-size: 12px;
  color: var(--red, #E84747);
}
.apply-field.has-error .apply-error { display: block; }

/* honeypot — visually hidden, off-screen, not display:none (bots skip those) */
.apply-hp {
  position: absolute !important;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.apply-privacy {
  font-size: 12px;
  font-style: italic;
  color: var(--text-dim, #6B7290);
  margin: 18px 0;
  line-height: 1.5;
}
.apply-privacy a { color: var(--text-muted, #A8AFC2); }

.apply-submit { width: 100%; justify-content: center; font-size: 15px; padding: 15px 22px; }
.apply-submit[disabled] { opacity: 0.6; cursor: not-allowed; }

.apply-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: apply-spin 0.7s linear infinite;
}
@keyframes apply-spin { to { transform: rotate(360deg); } }

/* form-level status banner */
.apply-banner {
  display: none;
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.5;
}
.apply-banner.is-error {
  display: block;
  background: rgba(232, 71, 71, 0.12);
  border: 1px solid rgba(232, 71, 71, 0.4);
  color: #ffb3b3;
}
.apply-banner.is-info {
  display: block;
  background: rgba(255, 201, 60, 0.1);
  border: 1px solid rgba(255, 201, 60, 0.35);
  color: var(--yellow, #FFC93C);
}

/* success state */
.apply-success {
  display: none;
  text-align: center;
  padding: 40px 28px 48px;
}
.apply-success.is-open { display: block; }
.apply-success-check {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 201, 60, 0.12);
  border: 1px solid rgba(255, 201, 60, 0.4);
  color: var(--yellow, #FFC93C);
  font-size: 30px;
}
.apply-success h3 { font-size: 22px; font-weight: 800; margin-bottom: 10px; }
.apply-success p { color: var(--text-muted, #A8AFC2); font-size: 15px; max-width: 380px; margin: 0 auto 22px; }
