/* ══════════════════════════
   PAGE: APPLY
══════════════════════════ */

.apply-page {
  padding: 28px 24px 80px;
  max-width: 560px;
  margin: 0 auto;
}

/* ─── HEADER ─── */
.apply-header { margin-bottom: 28px; text-align: center; }

.apply-title {
  font-family: var(--font-display);
  font-size: clamp(22px, 3.5vw, 30px);
  font-weight: 800;
  font-style: italic;
  margin-bottom: 8px;
}

.apply-subtitle {
  font-size: clamp(12px, 1vw, 13px);
  color: var(--muted);
  line-height: 1.5;
}

/* ─── STEP INDICATOR ─── */
.apply-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 28px;
}

.apply-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.apply-step-num {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--panel);
  border: 2px solid var(--border-md);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  color: var(--muted);
  transition: all .25s;
}

.apply-step-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  white-space: nowrap;
  transition: color .25s;
}

.apply-step--active .apply-step-num {
  background: var(--gold-dim);
  border-color: var(--gold);
  color: var(--gold);
}

.apply-step--active .apply-step-label { color: var(--gold); }

.apply-step--completed .apply-step-num {
  background: var(--teal);
  border-color: var(--teal);
  color: #000;
}

.apply-step--completed .apply-step-num::after { content: '✓'; }
.apply-step--completed .apply-step-num { font-size: 0; }
.apply-step--completed .apply-step-num::after { font-size: 14px; }

.apply-step-line {
  flex: 1;
  height: 2px;
  background: var(--border-md);
  min-width: 32px;
  max-width: 60px;
  margin-bottom: 18px;
}

/* ─── CARD ─── */
.apply-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 4px 24px var(--shadow-sm);
  transition: background .3s;
}

.apply-card--hidden { display: none !important; }

/* ─── PHOTO UPLOAD ─── */
.apply-photo-zone {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 2px dashed var(--border-md);
  margin: 0 auto;
  cursor: pointer;
  overflow: hidden;
  position: relative;
  transition: border-color .2s;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--panel);
}

.apply-photo-zone:hover { border-color: var(--gold); }

.apply-photo-zone--filled { border-style: solid; border-color: var(--gold); }

.apply-photo-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
  padding: 8px;
}

.apply-photo-icon { font-size: 28px; }

.apply-photo-hint {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
}

.apply-photo-sub {
  font-size: 10px;
  color: var(--muted);
}

.apply-photo-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* ─── FIELDS ─── */
.apply-field { display: flex; flex-direction: column; gap: 6px; }

.apply-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--muted);
}

.apply-input {
  width: 100%;
  padding: 13px 16px;
  background: var(--panel);
  border: 1px solid var(--border-md);
  border-radius: var(--r-sm);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: clamp(14px, 1.1vw, 15px);
  outline: none;
  transition: border-color .2s;
  -webkit-appearance: none;
}

.apply-input:focus { border-color: var(--gold-glow); }
.apply-input::placeholder { color: var(--muted); }

/* ─── BUTTONS ─── */
.apply-btn {
  width: 100%;
  padding: 14px;
  background: var(--gold);
  color: #000;
  border: none;
  border-radius: var(--r-sm);
  font-family: var(--font-ui);
  font-size: clamp(14px, 1.1vw, 16px);
  font-weight: 700;
  cursor: pointer;
  transition: opacity .18s, transform .18s;
  -webkit-tap-highlight-color: transparent;
}

.apply-btn:hover  { opacity: .9; transform: translateY(-1px); }
.apply-btn:active { transform: scale(.98); }
.apply-btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }

/* Outline variant — for secondary actions */
.apply-btn--outline {
  background: transparent;
  border: 1.5px solid var(--gold);
  color: var(--gold);
}

.apply-btn--outline:hover {
  background: var(--gold-dim);
  opacity: 1;
}

/* Two-button row */
.apply-btn-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

@media (min-width: 400px) {
  .apply-btn-row {
    flex-direction: row;
  }
  .apply-btn-row .apply-btn {
    flex: 1;
  }
}

.apply-link-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-style: dotted;
  padding: 4px 0;
  transition: color .15s;
  -webkit-tap-highlight-color: transparent;
}

.apply-link-btn:hover { color: var(--text); }

.apply-back-btn { color: var(--muted); }

/* ─── ERROR ─── */
.apply-error {
  font-size: 12px;
  color: #ef4444;
  min-height: 18px;
}

.apply-error-inline {
  padding: 12px;
  background: var(--red-dim);
  border-radius: var(--r-sm);
  font-size: 13px;
  color: #ef4444;
}

/* ─── NOTE ─── */
.apply-note {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
  text-align: center;
}

/* ─── OTP STEP ─── */
.apply-otp-header { text-align: center; }

.apply-otp-icon { font-size: 44px; display: block; margin-bottom: 10px; }

.apply-otp-title {
  font-family: var(--font-display);
  font-size: clamp(18px, 2.5vw, 22px);
  font-weight: 800;
  font-style: italic;
  margin-bottom: 8px;
}

.apply-otp-sub {
  font-size: clamp(12px, 1vw, 13px);
  color: var(--muted);
  line-height: 1.5;
}

.otp-boxes {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.otp-box {
  width: 48px; height: 56px;
  font-size: clamp(20px, 3vw, 24px);
  font-weight: 700;
  text-align: center;
  background: var(--panel);
  border: 1px solid var(--border-md);
  border-radius: var(--r-sm);
  color: var(--text);
  font-family: var(--font-display);
  outline: none;
  transition: border-color .2s;
  padding: 0;
  -webkit-appearance: none;
}

.otp-box:focus { border-color: var(--gold); }

.apply-dev-otp {
  text-align: center;
  font-size: 12px;
  color: var(--teal);
  background: rgba(45, 212, 191, .08);
  border: 1px solid rgba(45, 212, 191, .2);
  border-radius: var(--r-sm);
  padding: 8px 12px;
  font-family: monospace;
}

/* ─── CATEGORY PICKER ─── */
.apply-cat-title {
  font-family: var(--font-display);
  font-size: clamp(18px, 2.5vw, 22px);
  font-weight: 800;
  font-style: italic;
}

.apply-cat-sub {
  font-size: clamp(12px, 1vw, 13px);
  color: var(--muted);
  line-height: 1.5;
}

.apply-cat-tree {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.apply-cat-section { display: flex; flex-direction: column; gap: 10px; }

.apply-cat-section-header {
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--muted);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.apply-pills-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ─── ANIMATED PILLS ─── */
.apply-pill {
  padding: 8px 16px;
  background: var(--panel);
  border: 1.5px solid var(--border-md);
  border-radius: 50px;
  color: var(--text-2);
  font-family: var(--font-ui);
  font-size: clamp(12px, 1vw, 13px);
  font-weight: 600;
  cursor: pointer;
  transition: all .2s cubic-bezier(.4, 0, .2, 1);
  -webkit-tap-highlight-color: transparent;
  animation: pill-pop .25s cubic-bezier(.34, 1.56, .64, 1) both;
}

@keyframes pill-pop {
  from { opacity: 0; transform: scale(.8); }
  to   { opacity: 1; transform: scale(1); }
}

.apply-pill:hover {
  border-color: var(--gold-glow);
  background: var(--card);
  color: var(--text);
  transform: translateY(-2px);
}

.apply-pill--selected {
  background: var(--gold-dim);
  border-color: var(--gold);
  color: var(--gold);
  font-weight: 700;
}

.apply-pill--expandable {
  border-style: dashed;
}

.apply-pill--expanded {
  background: var(--card);
  border-color: var(--purple);
  color: var(--purple);
  border-style: solid;
}

/* Sub-pills (third level) */
.apply-sub-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 0 4px 16px;
  border-left: 2px solid var(--border-md);
  margin-left: 8px;
  width: 100%;
  animation: pill-pop .2s ease both;
}

.apply-sub-pills .apply-pill {
  font-size: clamp(11px, 0.9vw, 12px);
  padding: 6px 12px;
}

/* ─── SELECTED SUMMARY ─── */
.apply-selected-wrap {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 12px 14px;
}

.apply-selected-wrap--empty { display: none; }

.apply-selected-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin-bottom: 8px;
}

.apply-selected-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.apply-selected-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: var(--gold-dim);
  border: 1px solid var(--gold-glow);
  border-radius: 50px;
  font-size: 12px;
  color: var(--gold);
  font-weight: 600;
  animation: pill-pop .2s ease both;
}

.apply-selected-rm {
  background: none;
  border: none;
  color: var(--gold);
  font-size: 14px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  opacity: .7;
  transition: opacity .15s;
}

.apply-selected-rm:hover { opacity: 1; }

/* ─── SUCCESS ─── */
.apply-success-icon {
  font-size: 64px;
  text-align: center;
  animation: pill-pop .4s cubic-bezier(.34, 1.56, .64, 1) both;
}

.apply-success-title {
  font-family: var(--font-display);
  font-size: clamp(20px, 3vw, 26px);
  font-weight: 800;
  font-style: italic;
  text-align: center;
  color: var(--gold);
}

.apply-success-text {
  font-size: clamp(13px, 1vw, 14px);
  color: var(--muted);
  text-align: center;
  line-height: 1.6;
}

.apply-loading {
  padding: 20px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
  .apply-page { padding: 20px 14px calc(var(--bottom-h) + 20px); }
  .apply-card { padding: 20px 16px; }
}

@media (max-width: 480px) {
  .otp-box { width: 40px; height: 48px; font-size: 18px; }
  .otp-boxes { gap: 6px; }
  .apply-step-line { min-width: 20px; }
}

@media (max-width: 360px) {
  .otp-box { width: 34px; height: 42px; font-size: 16px; }
  .otp-boxes { gap: 4px; }
}
