/* ================================================================
   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(37, 99, 235, .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; }
}
