/* /apply: the beta application, one calm column, one step at a time. Every step fits a laptop screen (~800px). */
.apply-page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
.apply-page .nav {
  background: rgba(255, 255, 255, 0.86);
  -webkit-backdrop-filter: saturate(1.6) blur(18px);
  backdrop-filter: saturate(1.6) blur(18px);
}
.stepcount {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray);
  font-variant-numeric: tabular-nums;
}
.progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--line);
}
.progress i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--ink);
  transition: width 0.6s var(--ease-out);
}
.apply {
  flex: 1;
  padding: clamp(24px, 4.5vh, 48px) 0 clamp(32px, 6vh, 64px);
  font-size: 1rem;
  line-height: 1.5;
}
.apply-col {
  width: 100%;
  max-width: calc(600px + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.step-title {
  font-size: clamp(1.9rem, 1.3rem + 1.6vw, 2.5rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
  font-weight: 600;
  margin: 0;
  text-wrap: balance;
  outline: none;
}
.step-note {
  margin: 12px 0 0;
  color: var(--gray);
  font-size: 1rem;
  line-height: 1.5;
  max-width: 54ch;
}
.step-note .after {
  display: block;
  margin-top: 8px;
  color: var(--ink);
  font-weight: 500;
}
.qs {
  display: grid;
  gap: 22px;
  margin-top: 26px;
}
.q {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}
.q > label.qlabel {
  display: block;
  padding: 0;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.35;
}
.q .opt-tag {
  font-weight: 400;
  color: var(--gray);
  font-size: 0.875rem;
  margin-left: 6px;
}
.q .help {
  margin: 2px 0 0;
  color: var(--gray);
  font-size: 0.875rem;
}
.q .control {
  margin-top: 8px;
}
.q .err {
  margin-top: 8px;
  font-size: 0.875rem;
}

/* fields: one height, one border, a soft ring while in use */
.apply .input {
  height: 46px;
  padding: 0 14px;
  border-radius: 12px;
  font-size: 1rem;
}
.apply textarea.input {
  height: auto;
  min-height: 72px;
  padding: 11px 14px;
}
/* a missing answer: a slightly darker border and the message under it, never a thick frame */
.q.bad .input,
.q.bad .dd-btn {
  border-color: rgba(28, 28, 30, 0.5);
}
.other-input {
  margin-top: 8px;
}

/* dropdowns (one or several answers): the same box as a field, the list opens under it */
.dd {
  position: relative;
}
.dd-btn {
  display: flex;
  align-items: center;
  width: 100%;
  height: 46px;
  padding: 0 40px 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b6b70' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 14px center / 16px;
  font: inherit;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.dd-btn:hover {
  border-color: rgba(28, 28, 30, 0.32);
}
.dd-btn:focus-visible,
.dd.open .dd-btn {
  outline: none;
  border-color: rgba(28, 28, 30, 0.38);
  box-shadow: 0 0 0 3px rgba(28, 28, 30, 0.07);
}
.dd-val {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dd-val.ph {
  color: #a1a1a6;
}
.dd-menu {
  position: absolute;
  z-index: 40;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  max-height: min(320px, 60vh);
  overflow: auto;
  padding: 6px;
  border-radius: 12px;
  background: var(--paper);
  box-shadow: 0 0 0 1px var(--line), 0 14px 32px -10px rgba(0, 0, 0, 0.2);
}
.dd.up .dd-menu {
  top: auto;
  bottom: calc(100% + 6px);
}
.dd-menu[hidden] {
  display: none;
}
.dd-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 0.9375rem;
  line-height: 1.3;
  cursor: pointer;
  outline: none;
}
.dd-opt:hover,
.dd-opt:focus {
  background: var(--surface);
}
.dd-opt .tick {
  flex: none;
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  color: var(--ink);
}
.dd-opt .tick svg {
  width: 14px;
  height: 14px;
  opacity: 0;
}
.dd-opt[aria-selected='true'] .tick svg {
  opacity: 1;
}
/* several answers: a checkbox in front of each */
.dd.multi .dd-opt .tick {
  border-radius: 5px;
  box-shadow: inset 0 0 0 1.5px rgba(28, 28, 30, 0.32);
  color: var(--paper);
}
.dd.multi .dd-opt .tick svg {
  width: 11px;
  height: 11px;
}
.dd.multi .dd-opt[aria-selected='true'] .tick {
  background: var(--ink);
  box-shadow: none;
}

/* platforms: two columns of checkboxes; a checked one opens its username field */
.plats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
.plat {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 6px 0 0;
  border-radius: 12px;
  background: var(--paper);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  transition: background 0.15s, box-shadow 0.15s;
}
.plat:hover {
  box-shadow: inset 0 0 0 1px rgba(28, 28, 30, 0.32);
}
.plat.on {
  background: var(--surface);
}
.plat label {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 100%;
  padding-left: 13px;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.plat.on label {
  flex: none;
}
.plat input[type='checkbox'] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.plat .mark {
  flex: none;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  box-shadow: inset 0 0 0 1.5px rgba(28, 28, 30, 0.32);
  color: var(--paper);
  transition: background 0.15s;
}
.plat .mark svg {
  width: 11px;
  height: 11px;
  opacity: 0;
}
.plat.on .mark {
  background: var(--ink);
  box-shadow: none;
}
.plat.on .mark svg {
  opacity: 1;
}
.plat label:has(input:focus-visible) .mark {
  outline: 3px solid rgba(28, 28, 30, 0.16);
  outline-offset: 2px;
}
.plat .handle {
  flex: 1;
  width: 0;
  min-width: 0;
  height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: var(--paper);
  box-shadow: inset 0 0 0 1px var(--line);
  font: inherit;
  font-size: 0.9375rem;
  color: var(--ink);
}
.plat .handle[hidden] {
  display: none;
}
.plat .handle::placeholder {
  color: #a1a1a6;
}
.plat .handle:focus {
  box-shadow: inset 0 0 0 1px rgba(28, 28, 30, 0.38);
}
.plat .handle.bad {
  box-shadow: inset 0 0 0 1px rgba(28, 28, 30, 0.5);
}

.apply-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.apply-actions .spacer {
  flex: 1;
}
.apply-actions .btn {
  --h: 46px;
  padding: 0 22px;
  font-size: 0.9375rem;
}
.back {
  border: 0;
  background: none;
  padding: 10px 6px;
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.back:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}
.back[hidden] {
  display: none;
}
.apply-col .status {
  text-align: right;
  font-size: 0.875rem;
}
.q .hint {
  margin: 8px 0 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--gray);
}
.step-host {
  animation: step-in 0.5s var(--ease-out);
}
@keyframes step-in {
  from {
    opacity: 0;
    transform: translateX(var(--from-x, 18px));
  }
}
.end {
  text-align: left;
}
.done-mark {
  width: 44px;
  height: 44px;
}
.end .step-title {
  margin-top: 4px;
}
.end .ctas {
  margin-top: 28px;
}
.end .ctas .btn {
  --h: 46px;
  padding: 0 22px;
  font-size: 0.9375rem;
}
@media (max-width: 640px) {
  .plats {
    grid-template-columns: 1fr;
  }
  .apply-actions {
    position: sticky;
    bottom: 0;
    z-index: 5;
    margin: 32px calc(-1 * var(--gutter)) 0;
    padding: 12px var(--gutter) calc(12px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.92);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
  }
  .apply-actions .btn {
    flex: 1;
  }
  .apply-actions .spacer {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .step-host {
    animation: none;
  }
}
