/* ================================================================
   The project application form.

   Reuses the site's tokens from styles.css so the page belongs to the
   same website; everything here is specific to the form itself.
   ================================================================ */

/*
 * The browser's own [hidden] rule is a bare attribute selector, so any class
 * that sets a display — .panel, .btn, .notice — silently beats it and the
 * element stays on screen. Everything here is toggled with the hidden
 * property, so state this once and forcefully.
 */
[hidden] { display: none !important; }

.apply-body {
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.apply-shell {
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- header ---------- */

.apply-head {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 20;
}
.apply-head-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 68px;
}
.apply-head-actions { display: flex; align-items: center; gap: 8px; }

.mini-select,
.mini-btn {
  height: 34px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 9px;
  font: inherit;
  font-size: 13px;
  padding: 0 10px;
  cursor: pointer;
}
.mini-btn { width: 38px; display: grid; place-items: center; }
.mini-select:hover, .mini-btn:hover { border-color: var(--border-strong); }

/* ---------- page ---------- */

.apply-main { padding: 44px 24px 80px; flex: 1; }

.apply-main .eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--brand);
  margin: 0 0 10px;
}
.apply-main h1 {
  font-size: clamp(28px, 4vw, 38px);
  line-height: 1.15;
  letter-spacing: -.02em;
  margin: 0 0 12px;
  font-weight: 800;
}
.apply-main .lead {
  color: var(--text-soft);
  font-size: 16px;
  line-height: 1.65;
  margin: 0 0 32px;
  max-width: 60ch;
}

/* ---------- progress ---------- */

.steps {
  display: flex;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0 0 28px;
}
.step {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 1;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
  transition: color .25s var(--ease), border-color .25s var(--ease);
}
.step .dot {
  width: 25px; height: 25px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 12.5px; font-weight: 700;
  background: var(--surface-2);
  border: 1px solid var(--border);
  flex: none;
}
.step.is-current { color: var(--text); border-bottom-color: var(--brand); }
.step.is-current .dot { background: var(--brand); border-color: var(--brand); color: #fff; }
.step.is-done { color: var(--text-soft); border-bottom-color: var(--brand-light); }
.step.is-done .dot { background: var(--brand-light); border-color: var(--brand-light); color: #fff; }

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

.panel { border: 0; padding: 0; margin: 0 0 26px; display: grid; gap: 18px; }

.row-2 { display: grid; gap: 18px; grid-template-columns: 1fr 1fr; }
.row-3 { display: grid; gap: 18px; grid-template-columns: repeat(3, 1fr); }

.field { display: block; }
.field > span {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 7px;
  color: var(--text);
}
.field > span + b { display: none; }
.field > span::after { content: ''; }
.field b { color: var(--brand); font-weight: 700; margin-inline-start: 3px; }

.field input,
.field select,
.field textarea {
  width: 100%;
  font: inherit;
  font-size: 14.5px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 11px 13px;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.field textarea { resize: vertical; line-height: 1.6; min-height: 74px; }
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(214,219,227, .16);
}
.field input[readonly] { background: var(--surface-2); color: var(--text-soft); }
.field input[aria-invalid="true"],
.field select[aria-invalid="true"],
.field textarea[aria-invalid="true"] { border-color: #dc2626; }

.hint, .err { display: block; font-style: normal; font-size: 12.5px; margin-top: 6px; }
.hint { color: var(--muted); }
.err { color: #dc2626; font-weight: 500; }
.err:empty { display: none; }

/* ---------- chips ---------- */

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font: inherit;
  font-size: 13.5px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-soft);
  cursor: pointer;
  transition: all .16s var(--ease);
}
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip[aria-pressed="true"] {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 600;
}

/* ---------- checkbox ---------- */

.check {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-soft);
  cursor: pointer;
}
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--brand); flex: none; }

/* ---------- uploads ---------- */

.drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  padding: 26px 20px;
  border: 1.5px dashed var(--border-strong);
  border-radius: 13px;
  background: var(--surface-2);
  color: var(--text-soft);
  font-size: 14px;
  cursor: pointer;
  transition: all .18s var(--ease);
}
.drop:hover, .drop:focus-visible, .drop.is-over {
  border-color: var(--brand);
  background: var(--grad-light);
  color: var(--text);
  outline: none;
}
.drop em { font-style: normal; font-size: 12.5px; color: var(--muted); }

.filelist { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; }
.filelist li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  font-size: 13.5px;
}
.filelist .fname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filelist .fsize { color: var(--muted); font-size: 12.5px; flex: none; }
.filelist button {
  border: 0; background: none; color: var(--muted);
  cursor: pointer; padding: 2px; display: grid; place-items: center; border-radius: 6px;
}
.filelist button:hover { color: #dc2626; background: var(--surface-2); }

/* ---------- honeypot ---------- */

.hp {
  position: absolute;
  left: -9999px;
  width: 1px; height: 1px;
  overflow: hidden;
}

/* ---------- notices ---------- */

.notice {
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 12px;
  padding: 13px 15px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-soft);
  margin-bottom: 22px;
}
.notice-error {
  border-color: rgba(220, 38, 38, .4);
  background: rgba(220, 38, 38, .07);
  color: #b91c1c;
}
html[data-theme="dark"] .notice-error { color: #fca5a5; }
.notice strong { color: var(--text); }

/* ---------- actions ---------- */

.actions { display: flex; align-items: center; gap: 10px; padding-top: 6px; }
.actions .spacer { flex: 1; }
.actions .btn { min-width: 132px; justify-content: center; }

/* ---------- success ---------- */

.done { text-align: center; padding: 60px 0 40px; max-width: 520px; margin: 0 auto; }
.done-mark {
  width: 62px; height: 62px;
  border-radius: 50%;
  display: grid; place-items: center;
  margin: 0 auto 22px;
  background: rgba(5, 150, 105, .12);
  color: #059669;
}
.done h1 { font-size: 26px; margin: 0 0 12px; font-weight: 800; letter-spacing: -.01em; }
.done p { color: var(--text-soft); line-height: 1.65; margin: 0 0 14px; }
.done .ref { font-size: 15px; }
.done .ref code {
  font-family: 'Space Grotesk', ui-monospace, monospace;
  font-weight: 600;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px 9px;
  margin-inline-start: 5px;
}
.done .fine { font-size: 13px; color: var(--muted); margin-bottom: 26px; }

/* ---------- footer ---------- */

.apply-foot {
  border-top: 1px solid var(--border);
  padding: 22px 0;
  font-size: 13.5px;
  color: var(--muted);
}
.apply-foot .apply-shell { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.apply-foot a { color: var(--text-soft); text-decoration: none; }
.apply-foot a:hover { color: var(--brand); }

/* ---------- right-to-left ---------- */

html[dir="rtl"] .apply-body,
html[dir="rtl"] .apply-main { font-family: 'Cairo', 'Inter', system-ui, sans-serif; }
html[dir="rtl"] .drop, html[dir="rtl"] .done { text-align: center; }

/* ---------- narrow screens ---------- */

@media (max-width: 720px) {
  .row-2, .row-3 { grid-template-columns: 1fr; }
  .apply-main { padding: 30px 20px 60px; }
  .apply-shell { padding: 0 20px; }
  .steps { gap: 5px; }
  .step span:not(.dot) { display: none; }
  .step { justify-content: center; }
  .actions .btn { min-width: 0; flex: 1; }
}

/* ================================================================
   Redesign: black & silver glass card with a liquid chrome edge.
   Works in both themes through the site tokens; dark is the default.
   ================================================================ */

html:has(.apply-body) { background: var(--bg); }
.apply-body { background: transparent; position: relative; }
html[data-theme="dark"] {
  --bg: #07080a;
  --surface: rgba(22,23,27,.72);
  --surface-2: rgba(30,32,37,.7);
  --border: rgba(255,255,255,.09);
  --border-strong: rgba(255,255,255,.2);
  --text: #f4f5f7;
  --text-soft: #a3a8b1;
  --muted: #6f747d;
}
html[data-theme="dark"] .apply-body { --brand: #e4e7ec; --brand-light: #a3a8b1; }

/* header: floating glass bar */
.apply-head {
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  -webkit-backdrop-filter: blur(14px);
          backdrop-filter: blur(14px);
}
.mini-select, .mini-btn { border-radius: 999px; height: 36px; }
.mini-btn { width: 36px; color: var(--text); }

.apply-shell { max-width: 860px; }
.apply-main { padding-top: 64px; }

/* heading in liquid chrome */
.apply-main h1 {
  font-family: var(--display);
  font-size: clamp(34px, 5vw, 54px);
  letter-spacing: -.04em;
  line-height: 1.02;
  background: linear-gradient(100deg, var(--text) 0%, var(--text) 30%, #8e95a1 45%, var(--text) 60%, var(--text) 100%);
  background-size: 250% 100%;
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  animation: chromeText 7s ease-in-out infinite;
}
@keyframes chromeText { 0%, 100% { background-position: 100% 0; } 50% { background-position: 0% 0; } }
.apply-main .eyebrow { display: inline-flex; align-items: center; gap: 10px; color: var(--text-soft); letter-spacing: .2em; }
.apply-main .eyebrow::before { content: ''; width: 22px; height: 1.5px; background: linear-gradient(90deg, transparent, var(--text-soft)); }

/* reassurance row */
.assure { list-style: none; padding: 0; margin: -12px 0 30px; display: flex; flex-wrap: wrap; gap: 10px; }
.assure li {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13.5px; font-weight: 500;
  color: var(--text-soft);
  background: var(--surface);
  border: 1px solid var(--border);
}
.assure .ico { color: var(--text); }

/* the card */
.apply-card {
  position: relative;
  border-radius: 26px;
  padding: 34px 34px 28px;
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(255,255,255,.05), transparent 60%),
    var(--surface);
  -webkit-backdrop-filter: blur(18px);
          backdrop-filter: blur(18px);
  box-shadow: 0 40px 80px -40px rgba(0,0,0,.8), inset 0 1px 0 rgba(255,255,255,.06);
  overflow: hidden;
}
html[data-theme="light"] .apply-card {
  background: rgba(228,230,233,.75);
  box-shadow: 0 30px 60px -36px rgba(13,14,17,.35), inset 0 1px 0 rgba(255,255,255,.5);
}

/* thin chrome progress bar along the top of the card */
.progress { position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--border); }
.progress-fill {
  display: block; height: 100%; width: 33.4%;
  background: linear-gradient(90deg, #6b7280, #f4f6fa 50%, #9aa1ad);
  background-size: 200% 100%;
  animation: chromeText 3s linear infinite;
  transition: width .7s var(--ease);
}
.apply-card:has(.step:nth-child(2).is-current) .progress-fill { width: 66.7%; }
.apply-card:has(.step:nth-child(3).is-current) .progress-fill { width: 100%; }

/* steps */
.steps { margin-bottom: 30px; }
.step { border-bottom: 0; padding-bottom: 0; }
.step .dot { width: 30px; height: 30px; background: transparent; transition: all .35s var(--ease); }
.step.is-current .dot,
.step.is-done .dot {
  background: linear-gradient(180deg, #ffffff, #c4c9d1);
  border-color: transparent;
  color: #0a0b0d;
  box-shadow: 0 0 0 4px rgba(214,219,227,.12);
}

/* fields: quiet glass, silver focus ring */
.field > span { color: var(--text-soft); font-weight: 500; }
.field input,
.field select,
.field textarea {
  background: rgba(0,0,0,.18);
  border-radius: 14px;
  padding: 13px 15px;
  min-height: 48px;
}
html[data-theme="light"] .field input,
html[data-theme="light"] .field select,
html[data-theme="light"] .field textarea { background: rgba(255,255,255,.35); }
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--border-strong); }
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(214,219,227,.12), 0 8px 24px -12px rgba(0,0,0,.6);
}
.field input::placeholder, .field textarea::placeholder { color: var(--muted); }
.field select option { background: #15171b; color: #f4f5f7; }

/* chips */
.chip { background: transparent; padding: 9px 16px; }
.chip[aria-pressed="true"] {
  background: linear-gradient(180deg, #ffffff, #c9ced6);
  border-color: transparent;
  color: #0a0b0d;
}

/* upload area */
.drop { background: rgba(0,0,0,.12); border-radius: 18px; padding: 32px 20px; }
.drop .ico { width: 26px; height: 26px; color: var(--text); }
.drop:hover, .drop:focus-visible, .drop.is-over { background: rgba(255,255,255,.04); border-color: var(--brand); }

/* actions */
.actions { margin-top: 8px; padding-top: 22px; border-top: 1px solid var(--border); }
.btn-outline { color: var(--text); border-color: var(--border-strong); }

/* success */
.done { padding: 54px 34px 40px; }
.done-mark {
  background: linear-gradient(180deg, #ffffff, #c4c9d1);
  color: #0a0b0d;
  box-shadow: 0 0 0 8px rgba(214,219,227,.1);
}
.done h1 { font-size: clamp(26px, 4vw, 34px); }

@media (max-width: 720px) {
  .apply-card { padding: 26px 20px 22px; border-radius: 22px; }
  .apply-main { padding-top: 40px; }
}
html[data-theme="dark"] { color-scheme: dark; }
html[data-theme="dark"] .field select { background-color: rgba(0,0,0,.18); }

/* Cloudflare Turnstile check, shown only when keys are configured */
.turnstile-box { margin: 16px 0 4px; min-height: 65px; }


/* ---------- Card edge and dropdowns ---------- */
.apply-card .metal, .apply-card::before, .apply-card::after { display: none !important; }
.apply-card { border: 1px solid var(--border); box-shadow: none; background: var(--surface); }
html[data-theme="dark"] .apply-card, html:not([data-theme="light"]) .apply-card { border-color: rgba(255,255,255,.13); }
/* the step bar sits inside the card, so it no longer runs along the edge */
.progress { position: relative; height: 3px; margin: 0 0 24px; border-radius: 3px; overflow: hidden; }
.progress-fill { animation: none; background: var(--text); border-radius: 3px; }
.field select {
  -webkit-appearance: none; appearance: none; cursor: pointer;
  padding-inline-end: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23989ea9' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center; background-size: 18px;
}
html[dir="rtl"] .field select { background-position: left 16px center; }
