/* Creator application — builds on the tokens in styles.css */
.apply-body { background: var(--ink-2); }
.apply-page {
  padding: clamp(2rem, 1.5rem + 3vw, 5rem) var(--gutter) clamp(3.5rem, 2.5rem + 5vw, 7rem);
  min-height: calc(100vh - var(--header-h));
}
.apply-shell { width: 100%; max-width: 60rem; margin-inline: auto; }
.apply-shell .crumbs { justify-content: center; }

/* Type sizes come from the shared roles in styles.css; only layout and colour live here. */
.apply-title { max-width: 16ch; margin: 0 auto .75rem; text-align: center; }
.apply-lede { max-width: 40ch; margin: 0 auto 1.5rem; text-align: center; color: var(--text-2); }
.apply-trust { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; margin-bottom: clamp(1.75rem, 1.4rem + 1.5vw, 2.75rem); }
.apply-badge {
  padding: .5rem 1rem; border: 1px solid var(--ink-line); border-radius: 999px; background: var(--ink-3);
  font-size: var(--fs-sm); font-weight: 600; color: var(--text-2);
}

.apply-card {
  position: relative;
  padding: clamp(1.25rem, .8rem + 2.2vw, 3rem);
  background: linear-gradient(145deg, #131925, #0f131c);
  border: 1px solid var(--ink-line);
  border-radius: clamp(1rem, .8rem + 1vw, 1.75rem);
  box-shadow: 0 1.5rem 5rem rgba(0, 0, 0, .4);
}
.apply-progress-wrap {
  position: sticky; top: calc(var(--header-h) + .5rem); z-index: 8;
  margin-bottom: clamp(1.25rem, 1rem + 1.2vw, 2rem); padding-bottom: .75rem;
  background: linear-gradient(#0f131c 75%, rgba(15, 19, 28, 0));
}
.apply-progress-bars { display: flex; gap: .4rem; margin-bottom: .65rem; }
.apply-progress-seg { flex: 1; height: .375rem; border-radius: 999px; background: #2a3446; transition: background-color .45s ease, opacity .45s ease; }
.apply-progress-seg.is-active { background: var(--accent); }
.apply-progress-seg.is-done { background: var(--accent); opacity: .55; }
.apply-progress-meta { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .25rem 1rem; font-size: var(--fs-sm); color: var(--text-3); }
.apply-strength strong { color: var(--accent); font-weight: 700; }

.apply-panel-outer { position: relative; min-height: min(20rem, 40vh); }
.apply-panel { transition: opacity .35s ease, transform .35s ease; }
.apply-panel.is-exit { opacity: .35; transform: scale(.985); pointer-events: none; }
.apply-panel.is-enter { animation: applySlideIn .45s var(--ease) both; }
.apply-panel.is-enter-back { animation: applySlideInBack .45s var(--ease) both; }
@keyframes applySlideIn { from { opacity: 0; transform: translateX(1.25rem); } to { opacity: 1; transform: none; } }
@keyframes applySlideInBack { from { opacity: 0; transform: translateX(-1.25rem); } to { opacity: 1; transform: none; } }
@keyframes applyFadeIn { from { opacity: 0; } to { opacity: 1; } }

.apply-loading-global {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center; padding: 1.5rem;
  background: rgba(7, 9, 14, .85);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  animation: applyFadeIn .2s ease;
}
.apply-loading-global[hidden] { display: none !important; }
.apply-loading-card {
  max-width: 22rem; padding: clamp(1.75rem, 1.4rem + 1.5vw, 2.5rem); text-align: center;
  border: 1px solid var(--ink-line); border-radius: 1.25rem;
  background: linear-gradient(145deg, #131925, #0f131c); box-shadow: 0 2rem 6rem rgba(0, 0, 0, .55);
}
.apply-loading-global p { margin-top: 1rem; font-size: var(--fs-lead); font-weight: 600; line-height: var(--lh-lead); }
.apply-loading-dots { display: flex; justify-content: center; gap: .5rem; }
.apply-loading-dots span { width: .625rem; height: .625rem; border-radius: 50%; background: var(--accent); animation: applyDot 1s ease-in-out infinite; }
.apply-loading-dots span:nth-child(2) { animation-delay: .15s; }
.apply-loading-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes applyDot { 0%, 80%, 100% { opacity: .35; transform: scale(.85); } 40% { opacity: 1; transform: scale(1); } }

/* Steps */
.apply-step-h2 { margin-bottom: .4rem; }
.apply-step-lede { margin-bottom: clamp(1.5rem, 1.2rem + 1.2vw, 2.25rem); color: var(--text-2); }
.apply-field { display: block; margin-bottom: clamp(1.1rem, 1rem + .6vw, 1.5rem); }
.apply-label { display: block; margin-bottom: .5rem; font-size: var(--fs-sm); font-weight: 600; }
.apply-label .req { color: var(--accent); }
.apply-hint { display: block; margin-top: .45rem; font-size: var(--fs-sm); line-height: var(--lh-sm); color: var(--text-3); }

.apply-input, .apply-textarea {
  width: 100%; padding: .9rem 1.1rem;
  font-size: max(16px, var(--fs-body)); /* 16px+ stops iOS zooming on focus */
  color: var(--text); background: #0e1420;
  border: 1.5px solid #2a3446; border-radius: .875rem; outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.apply-input:focus, .apply-textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(1, 183, 251, .2); }
.apply-input::placeholder, .apply-textarea::placeholder { color: #6d7789; }
.apply-textarea { min-height: 7rem; max-height: 40vh; resize: vertical; line-height: var(--lh-sm); }

.apply-upload {
  display: flex; align-items: center; gap: 1rem; padding: 1.1rem 1rem;
  border: 1.5px dashed #3a4558; border-radius: 1rem; background: #0e1420; cursor: pointer;
  transition: border-color .2s, background-color .2s;
}
.apply-upload:hover, .apply-upload.is-drag { border-color: var(--accent); background: rgba(1, 183, 251, .05); }
.apply-upload.has-file { border-style: solid; border-color: rgba(1, 183, 251, .35); }
.apply-upload-icon, .apply-upload-preview { flex-shrink: 0; width: clamp(3.25rem, 2.8rem + 2vw, 4.25rem); height: clamp(3.25rem, 2.8rem + 2vw, 4.25rem); border-radius: 50%; }
.apply-upload-icon { display: grid; place-items: center; font-size: 1.6rem; background: rgba(1, 183, 251, .14); }
.apply-upload-preview { object-fit: cover; object-position: 50% 20%; }
.apply-upload-title { display: block; margin-bottom: .25rem; font-size: var(--fs-sm); font-weight: 600; }
.apply-upload-sub { display: block; font-size: var(--fs-sm); line-height: var(--lh-sm); color: var(--text-3); }
.apply-file-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.apply-fieldset { min-width: 0; margin: 0 0 clamp(1.5rem, 1.2rem + 1vw, 2.25rem); padding: 0; border: 0; }
.apply-legend { margin-bottom: .35rem; padding: 0; }
.apply-legend-sub { margin: 0 0 1rem; font-size: var(--fs-sm); line-height: var(--lh-sm); color: var(--text-2); }

.apply-choice-grid { display: grid; gap: .6rem; }
@media (min-width: 480px) { .apply-choice-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.apply-choice {
  display: flex; align-items: flex-start; gap: .75rem; width: 100%; padding: .95rem 1rem; text-align: left;
  border: 1.5px solid #2a3446; border-radius: 1rem; background: #0e1420; color: var(--text); cursor: pointer;
  transition: border-color .2s, background-color .2s, transform .15s;
}
.apply-choice:hover { border-color: #4b5567; }
.apply-choice:active { transform: scale(.985); }
.apply-choice.is-selected { border-color: var(--accent); background: rgba(1, 183, 251, .07); }
.apply-radio {
  flex-shrink: 0; display: grid; place-items: center; width: 1.25rem; height: 1.25rem; margin-top: .1rem;
  border: 1.5px solid #4b5567; border-radius: 50%; transition: border-color .2s, background-color .2s;
}
.apply-choice.is-selected .apply-radio { border-color: var(--accent); background: var(--accent); }
.apply-choice.is-selected .apply-radio::after { content: "✓"; color: var(--accent-ink); font-size: .7rem; font-weight: 700; }
.min-w-0 { min-width: 0; }
.apply-choice-text { font-size: var(--fs-sm); font-weight: 500; line-height: var(--lh-sm); }
.apply-choice-sub { display: block; margin-top: .2rem; font-size: var(--fs-label); font-weight: 400; color: var(--text-3); }

.apply-chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .75rem; }
.apply-chip {
  min-height: 2.75rem; padding: .6rem 1rem; border: 1.5px solid #2a3446; border-radius: 999px;
  background: #0e1420; color: var(--text-2); font-size: var(--fs-sm); font-weight: 600; cursor: pointer;
  transition: border-color .2s, color .2s, background-color .2s;
}
.apply-chip:hover { border-color: #4b5567; }
.apply-chip.is-active { border-color: var(--accent); color: var(--accent); background: rgba(1, 183, 251, .08); }
.apply-platform-rows { display: grid; gap: .6rem; margin-top: .25rem; }
.apply-platform-row { display: none; gap: .6rem; align-items: center; animation: applyFadeIn .3s ease; }
.apply-platform-row.is-visible { display: grid; grid-template-columns: minmax(5.5rem, auto) minmax(0, 1fr); }
.apply-platform-tag { color: var(--accent); }
@media (max-width: 419.98px) { .apply-platform-row.is-visible { grid-template-columns: 1fr; gap: .35rem; } }

.apply-actions { display: flex; align-items: center; gap: .75rem; margin-top: 1.75rem; }
.apply-btn-primary, .apply-btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; min-height: 3.25rem;
  padding: .9rem 1.5rem; border-radius: 999px; font-size: var(--fs-sm); font-weight: 700; cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s, opacity .2s;
}
.apply-btn-primary { flex: 1; border: 0; background: var(--accent); color: var(--accent-ink); }
.apply-btn-primary:not(:disabled):hover { background: var(--text); color: var(--ink); }
.apply-btn-primary:disabled { opacity: .45; cursor: not-allowed; }
.apply-btn-ghost { border: 1.5px solid #3a4558; background: transparent; color: var(--text-2); }
.apply-btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.apply-btn-ghost:disabled { opacity: .4; cursor: not-allowed; }
.apply-footnote { margin-top: .9rem; text-align: center; font-size: var(--fs-sm); line-height: var(--lh-sm); color: var(--text-3); }

.apply-consent { display: flex; align-items: flex-start; gap: .65rem; margin-top: 1.25rem; font-size: var(--fs-sm); line-height: var(--lh-sm); color: var(--text-2); cursor: pointer; }
.apply-consent input { flex-shrink: 0; width: 1.15rem; height: 1.15rem; margin-top: .15rem; accent-color: var(--accent); }
.apply-submit-error {
  margin: 0 0 1.1rem; padding: .85rem 1rem; border: 1px solid rgba(255, 107, 107, .35); border-radius: .75rem;
  background: rgba(255, 107, 107, .08); color: #ffb4b4; font-size: var(--fs-sm); line-height: var(--lh-sm);
}

.apply-success { padding: 1.5rem .5rem .5rem; text-align: center; animation: applySlideIn .5s ease; }
.apply-success-icon { display: grid; place-items: center; width: 3.5rem; height: 3.5rem; margin: 0 auto 1.1rem; border-radius: 50%; background: rgba(1, 183, 251, .14); color: var(--accent); font-size: 1.5rem; }
.apply-success h2 { margin-bottom: .6rem; }
.apply-success p { max-width: 28rem; margin: 0 auto 1.5rem; color: var(--text-2); }

.apply-privacy { max-width: 50ch; margin: 1.5rem auto 0; text-align: center; font-size: var(--fs-sm); line-height: var(--lh-sm); color: var(--text-3); }

@media (max-width: 649.98px) {
  .apply-actions { flex-direction: column-reverse; }
  .apply-btn-primary, .apply-btn-ghost { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .apply-panel.is-enter, .apply-panel.is-enter-back, .apply-loading-dots span { animation: none; }
}
