/* The apply form: a printed menu (progress) and a place card beside one course (step) at a time.
   Steps and role questions are switched by apply_controller.js. */

.apply { padding-block: clamp(32px, 6vw, 88px) var(--section); align-items: start; row-gap: 32px; }
.apply-side { grid-column: 1 / span 4; position: sticky; top: 32px; display: grid; gap: 40px; }
.apply-form { grid-column: 6 / span 7; max-width: 640px; }

/* ---------- Menu card: the courses, crossed off as they're served ---------- */
.menu-card { padding: 32px 28px; border-block: 3px double var(--line); text-align: center; }
.menu-title { font: italic 400 22px var(--display); color: var(--accent); margin-bottom: 22px; }
.menu-courses { list-style: none; display: grid; gap: 16px; }
.menu-courses li { display: grid; gap: 1px; color: var(--muted); transition: color .3s; }
.course { font: 400 19px/1.3 var(--display); }
.course-what { font-size: 13px; }
.menu-courses .is-current { color: var(--ink); }
.menu-courses .is-current .course::before,
.menu-courses .is-current .course::after { content: "·"; color: var(--accent); margin-inline: 8px; }
.menu-courses .is-done { color: #6b6270; }
.menu-courses .is-done .course { text-decoration: line-through; text-decoration-color: var(--accent); text-decoration-thickness: 1px; }

/* ---------- Place card: fills in with the applicant's name and role ---------- */
.place-card {
  --mx: 40%;
  position: relative; display: grid; justify-items: center; gap: 8px; padding: 40px 24px 30px;
  border-radius: 6px; text-align: center;
  background:
    radial-gradient(circle at 35% 20%, rgba(255, 236, 244, .16), transparent 55%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .025) 0 1px, transparent 1px 3px),
    linear-gradient(135deg, #3b3242 0%, #221e29 45%, #3a3040 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .09), inset 0 1px 0 rgba(255, 255, 255, .15), 0 30px 60px -30px rgba(0, 0, 0, .9);
}
/* The fold line of a tented place card. */
.place-card::before { content: ""; position: absolute; left: 0; right: 0; top: 14px; height: 1px; background: rgba(255, 255, 255, .06); }
/* The foil is clipped to the text's box, so pad below it or descenders (g, j, y) get cut off. */
.place-name { font: 300 clamp(28px, 2.6vw, 36px)/1.15 var(--display); overflow-wrap: anywhere; padding-bottom: .15em; margin-bottom: -.15em; }
.place-role { font: 500 11px var(--body); letter-spacing: .24em; text-transform: uppercase; color: var(--muted); }

/* ---------- Steps ---------- */
.step-course { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); margin-bottom: 14px; }
/* Size and font come from the base h1/h2 rules; the intro's h1 matches the h2s. */
.step-title { font-size: clamp(30px, 3.4vw, 46px); line-height: 1.1; letter-spacing: -.01em; margin-bottom: 14px; }
.step-lede { color: var(--muted); margin-bottom: 32px; max-width: 34em; }
.step-title + .field, .step-title + .choices { margin-top: 32px; }
.step-nav { display: flex; align-items: center; gap: 24px; margin-top: 40px; }
.navback { background: none; border: 0; color: var(--muted); font: 400 15px var(--body); cursor: pointer; padding: 8px 0; }
.navback:hover { color: var(--ink); }

.optional { color: #6b6270; font-size: 13px; margin-left: 6px; }
.field-label { font-size: 14px; color: var(--muted); margin: 28px 0 12px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Tappable options: the real radio or checkbox covers the label, invisibly ---------- */
:is(.choice, .chip, .sev) input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
:is(.choice, .chip, .sev):has(input:focus-visible), .chip-add:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.heard-from-detail { margin-top: 16px; }

/* ---------- Role choices ---------- */
.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 8px; }
.choice {
  position: relative; display: grid; gap: 2px; padding: 16px 18px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 3px; transition: border-color .2s, background-color .2s;
}
.choice-label { font: 400 19px/1.3 var(--display); color: var(--ink); }
.choice-hint { font-size: 13px; color: var(--muted); }
.choice-price { display: block; font: 400 13px var(--body); color: var(--accent); margin-top: 2px; }
.choice:hover { border-color: #4a4252; }
.choice:has(input:checked) { border-color: var(--accent); background: var(--raise); }
.role-questions { border: 0; margin-top: 28px; padding: 24px 0 0; border-top: 1px solid var(--line); }

/* ---------- Chips (topics, dietary quick-adds) ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  position: relative; display: inline-flex; align-items: center; padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--ink); background: none; font: 400 14px var(--body);
  cursor: pointer; transition: border-color .2s, color .2s, background-color .2s;
}
.chip:hover { border-color: #4a4252; }
.chip:has(input:checked) { border-color: var(--accent); color: var(--accent); background: var(--raise); }
.chip-add { color: var(--muted); }

/* ---------- Topic tags: typed answers that become pills inside one box ---------- */
.tags {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: 50px; padding: 7px 8px;
  border: 1px solid var(--line); border-radius: 2px; background: var(--bg); cursor: text;
}
.tags:focus-within { border-color: var(--accent); }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 5px 6px 5px 12px; border-radius: 999px; background: var(--raise); border: 1px solid var(--accent); color: var(--accent); font-size: 14px; }
.tag-remove { background: none; border: 0; color: inherit; font-size: 16px; line-height: 1; padding: 0 4px; cursor: pointer; opacity: .7; }
.tag-remove:hover { opacity: 1; }
.tags .tag-input { flex: 1; min-width: 160px; border: 0; padding: 6px; background: none; }
.tags .tag-input:focus { border: 0; }

/* ---------- Dietary rows: what, and how serious ---------- */
.diet-add { display: flex; gap: 10px; margin-top: 16px; }
.diet-add input { flex: 1; }
.btn-quiet { padding: 0 20px; border: 1px solid var(--line); border-radius: 2px; background: none; color: var(--ink); font: 500 15px var(--body); cursor: pointer; }
.btn-quiet:hover { border-color: var(--accent); }
.diet-list { list-style: none; display: grid; gap: 12px; margin-top: 20px; }
.diet-row { padding: 16px; border: 1px solid var(--line); border-radius: 3px; background: var(--raise); }
.diet-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.diet-head .diet-item { flex: 1; border-color: transparent; background: none; padding: 4px 0; font: 400 19px var(--display); }
.diet-head .diet-item:focus { border-color: transparent; border-bottom-color: var(--accent); }
.diet-remove { background: none; border: 0; color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer; padding: 4px 8px; }
.diet-remove:hover { color: var(--ink); }
.severity { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.sev {
  position: relative; display: grid; align-content: center; gap: 2px; padding: 10px 8px; text-align: center;
  border: 1px solid var(--line); border-radius: 2px; color: var(--muted); cursor: pointer;
}
.sev-label { font-size: 14px; line-height: 1.25; }
.sev-hint { font-size: 12px; line-height: 1.3; color: #6b6270; }
/* Each level gets warmer, so a severe allergy reads as one at a glance. */
.sev-prefer:has(input:checked) { border-color: var(--muted); color: var(--ink); background: #26222c; }
.sev-avoid:has(input:checked) { border-color: var(--accent); color: var(--accent); background: #2b2230; }
.sev-severe:has(input:checked) { border-color: #e0727f; color: #f2b1b8; background: #3a2128; }
.sev:has(input:checked) .sev-hint { color: inherit; opacity: .75; }

/* ---------- Thank-you page: the place card is set ---------- */
.apply-done { padding-block: clamp(56px, 10vw, 140px) var(--section); }
.done-inner { grid-column: 3 / span 8; display: grid; justify-items: center; text-align: center; }
.done-inner h1 { font-size: clamp(36px, 4.4vw, 60px); margin: 48px 0 16px; }
.done-inner p { color: var(--muted); max-width: 32em; }
.done-back { margin-top: 32px; }
.place-card-set { width: min(360px, 100%); animation: set-card 1s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes set-card {
  from { opacity: 0; transform: translateY(-28px) rotateX(24deg) scale(.96); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) { .place-card-set { animation: none; } }

/* ---------- Tablet and phone: the menu becomes a compact strip, the place card waits for the end ---------- */
@media (max-width: 900px) {
  .apply-side, .apply-form, .done-inner { grid-column: 1 / -1; }
  .apply-side { position: static; }
  .apply-side .place-card { display: none; }
  .menu-card { padding: 14px 0; }
  .menu-title { display: none; }
  .menu-courses { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
  .course { font-size: 14px; }
  .course-what { display: none; }
  .menu-courses .is-current .course::before, .menu-courses .is-current .course::after { content: none; }
  .menu-courses .is-current .course { color: var(--accent); }
}
@media (max-width: 560px) {
  .choices { grid-template-columns: 1fr; }
  .severity { grid-template-columns: 1fr; }
  .sev { grid-template-columns: auto 1fr; text-align: left; column-gap: 10px; padding: 10px 12px; }
  .course { font-size: 12px; }
}
