/* APPLY — signature button, questionnaire form, patterns list + timeline. */

.apply-hero-inner { display: grid; gap: 26px; justify-items: start; }
.apply-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  width: min(820px, 100%);
}
.apply-steps span {
  display: grid;
  gap: 6px;
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  background: var(--surface);
}
.apply-steps b {
  color: var(--gold);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
}
.apply-steps em {
  color: var(--text);
  font-style: normal;
  font-weight: 900;
  line-height: 1.35;
}
.apply-cta {
  min-height: 60px;
  padding: 0 34px;
  font-size: 1.1rem;
  border-radius: 30px;
  box-shadow: 0 22px 60px rgba(143, 9, 21, 0.42);
}
.apply-boundary {
  max-width: 780px;
  margin: -8px 0 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 0.92rem;
}

/* ---- Form ---- */
.apply-intro { margin: 0 0 18px; color: var(--muted); line-height: 1.6; }
/* single-column vertical form (was 2-col) — every field spans the row */
.form-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 0.92rem; }
.field-wide { grid-column: 1 / -1; }
.field-label { color: var(--muted); font-weight: 700; }
.field .req { color: var(--red-bright); font-style: normal; }

.field input[type="text"],
.field input[type="email"],
.field select,
.field textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--text);
  background: var(--surface);
  font: inherit;
}
.field textarea { min-height: 84px; resize: vertical; }
.field select { cursor: pointer; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--gold); outline: none; }

/* ---- Target university: multi-select fuzzy search ---- */
.uni-multi {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  padding: 6px;
}
.uni-multi:focus-within { border-color: var(--gold); }
.uni-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.uni-chips:empty { display: none; }
.uni-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px 4px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--red-bright) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--red-bright) 40%, transparent);
  font-size: 0.84rem;
  font-weight: 600;
  max-width: 100%;
}
.uni-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uni-chip__x {
  flex: none;
  width: 18px; height: 18px;
  border: 0; border-radius: 50%;
  background: rgba(0, 0, 0, 0.18);
  color: inherit; cursor: pointer;
  font-size: 0.9rem; line-height: 1;
}
.uni-chip__x:hover { background: var(--red-bright); color: #fff; }
.uni-search {
  width: 100%;
  min-height: 34px;
  border: 0 !important;
  background: transparent !important;
  padding: 6px 6px !important;
  color: var(--text);
  font: inherit;
}
.uni-search:focus { outline: none; }
.uni-suggest {
  position: absolute;
  left: 0; right: 0; top: calc(100% + 4px);
  z-index: 20;
  max-height: 280px;
  overflow-y: auto;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.28);
  padding: 4px;
}
.uni-opt {
  display: flex;
  flex-direction: column;
  gap: 1px;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}
.uni-opt:hover, .uni-opt[data-first="1"] { background: var(--surface-strong); }
.uni-opt b { font-size: 0.9rem; }
.uni-opt span { color: var(--muted); font-size: 0.78rem; }
.uni-opt em { color: var(--subtle); font-size: 0.74rem; font-style: normal; }
.uni-opt--custom { color: var(--red-bright); font-weight: 700; flex-direction: row; }
.uni-hint { margin: 6px 0 0; color: var(--subtle); font-size: 0.78rem; line-height: 1.5; }
.uni-hint.is-warn { color: var(--red-bright); font-weight: 600; } /* at the selection cap */

.field-check { flex-direction: row; align-items: flex-start; gap: 10px; }
.field-check input { width: 20px; height: 20px; margin-top: 2px; flex: 0 0 auto; accent-color: var(--red-bright); }
.field-check span { color: var(--text); line-height: 1.5; }
.privacy-note {
  margin: 16px 0 0;
  border: 1px solid rgba(215, 170, 98, 0.28);
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--muted);
  background: rgba(215, 170, 98, 0.08);
  line-height: 1.6;
  font-size: 0.86rem;
}

.apply-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.apply-status { color: var(--red-bright); font-weight: 700; font-size: 0.9rem; }
.apply-status.ok { color: #1f9d55; }

.apply-success { text-align: center; padding: 24px 8px; }
.apply-success-mark {
  width: 64px; height: 64px; margin: 0 auto 14px;
  display: grid; place-items: center;
  border-radius: 50%; font-size: 2rem; color: #fff;
  background: linear-gradient(135deg, #1f9d55, #0f7a3e);
}
.apply-success h3 { margin: 0 0 10px; font-size: 1.5rem; }
.apply-success p { margin: 0 auto; max-width: 520px; color: var(--muted); line-height: 1.6; }
.apply-fallback { margin-top: 14px !important; font-size: 0.86rem; color: var(--subtle) !important; }

/* ---- Patterns ---- */
.patterns-layout { display: grid; grid-template-columns: minmax(200px, 260px) minmax(0, 1fr); gap: 22px; margin-top: 30px; align-items: start; }
.patterns-list { display: flex; flex-direction: column; gap: 8px; position: sticky; top: 96px; }
.pattern-tab {
  display: flex; flex-direction: column; gap: 2px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 16px;
  color: var(--muted);
  background: var(--surface);
  cursor: pointer;
  font: inherit;
}
.pattern-tab:hover { color: var(--text); background: var(--surface-strong); }
.pattern-tab[aria-selected="true"] {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--red-bright), var(--red));
}
.pattern-tab b { font-size: 1rem; font-weight: 900; }
.pattern-tab span { font-size: 0.78rem; opacity: 0.85; }

.patterns-detail { }
.pd-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.pd-head h3 { margin: 0; font-size: clamp(1.6rem, 3vw, 2.2rem); }
.pd-duration { color: var(--gold); font-weight: 900; font-size: 0.9rem; }
.pd-intro { margin: 14px 0 24px; color: var(--muted); line-height: 1.75; font-size: 1.02rem; }

.pd-subhead { margin: 0 0 14px; font-size: 0.9rem; color: var(--gold); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 900; }

.timeline { position: relative; margin: 0 0 26px; padding-left: 40px; }
.timeline::before { content: ""; position: absolute; left: 15px; top: 8px; bottom: 8px; width: 2px; background: linear-gradient(var(--red-bright), var(--gold)); }
.tl-step { position: relative; padding: 0 0 18px; }
.tl-step:last-child { padding-bottom: 0; }
.tl-node {
  position: absolute; left: -40px; top: -2px;
  width: 32px; height: 32px; display: grid; place-items: center;
  border-radius: 50%; border: 2px solid var(--red-bright);
  background: var(--bg-soft); color: var(--text); font-weight: 900; font-size: 0.85rem;
}
.tl-step h4 { margin: 0 0 4px; font-size: 1.05rem; }
.tl-step p { margin: 0; color: var(--muted); line-height: 1.6; font-size: 0.94rem; }

.pd-min { display: grid; gap: 8px; margin: 0 0 22px; padding: 0; list-style: none; }
.pd-min li { position: relative; padding-left: 24px; color: var(--text); line-height: 1.6; }
.pd-min li::before { position: absolute; left: 0; top: 0.55em; width: 9px; height: 9px; border-radius: 2px; content: ""; background: var(--gold); }

.pd-warning {
  display: flex; gap: 10px;
  border: 1px solid rgba(215, 25, 43, 0.32);
  border-radius: 12px;
  padding: 14px 16px;
  background: rgba(215, 25, 43, 0.08);
  color: var(--muted);
  line-height: 1.6;
}
.pd-warning b { color: var(--text); }

@media (max-width: 860px) {
  .apply-hero { padding-top: 132px; }
  .apply-steps { grid-template-columns: 1fr; }
  .apply-steps span { min-height: auto; }
  .form-grid { grid-template-columns: 1fr; }
  .patterns-layout { grid-template-columns: 1fr; }
  .patterns-list { position: static; flex-direction: row; flex-wrap: wrap; }
  .pattern-tab { flex: 1 1 auto; }
}

/* ---------------- draft restore note (resume unfinished questionnaire) ---------------- */
.apply-draft-note {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 14px;
  padding: 9px 12px;
  border: 1px dashed var(--gold);
  border-radius: 12px;
  color: var(--muted);
  font-size: 0.85rem;
}
.apply-draft-note[hidden] { display: none; }
.apply-draft-clear {
  border: 0;
  background: transparent;
  color: var(--gold);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  text-decoration: underline;
}
.apply-draft-clear:hover { color: var(--text); }
