/* ===========================================================
   Rejoice Careers — application form (apply.php)
   Loads after base.css. Mobile-first: perfect at 360px wide.
   =========================================================== */

/* The hidden attribute must always win, even over display:flex rules below */
[hidden] { display: none !important; }

/* ---------- Hero strip ---------- */
.apply-hero {
  background: var(--grad-deep);
  color: #fff;
  padding: 1.4rem 0 3.4rem;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  color: rgba(255, 255, 255, .82);
  font-size: .9rem;
  font-weight: 600;
  margin-bottom: 1rem;
}
.back-link:hover { color: #fff; text-decoration: none; }
.hero-kicker {
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #c7d2fe;
  margin: 0 0 .35rem;
}
.hero-title {
  color: #fff;
  font-size: clamp(1.45rem, 4.5vw, 2.2rem);
  margin-bottom: .35rem;
}
.hero-salary {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(1.05rem, 3.5vw, 1.3rem);
  color: #fbbf24;
  margin: 0 0 .8rem;
}
.hero-salary .per-month {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: .85rem;
  color: rgba(255, 255, 255, .75);
}
.hero-chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.hchip {
  display: inline-flex;
  align-items: center;
  font-size: .8rem;
  font-weight: 600;
  padding: .3rem .8rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .22);
  color: #fff;
  white-space: nowrap;
}
.hchip-amber { background: rgba(251, 191, 36, .18); border-color: rgba(251, 191, 36, .5); color: #fde68a; }

/* ---------- Layout ---------- */
.apply-main { margin-top: -2rem; padding-bottom: 3rem; }
.apply-main .container { max-width: 780px; }

.wizard-card,
.pick-card,
.success-panel {
  padding: 1.4rem 1.25rem 1.6rem;
}

/* ---------- Progress bar ---------- */
.progress {
  list-style: none;
  display: flex;
  margin: 0 0 1.1rem;
  padding: .9rem .5rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  counter-reset: step;
}
.p-step {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .3rem;
  text-align: center;
}
.p-step::before,
.p-step::after {
  content: "";
  position: absolute;
  top: 14px;
  height: 3px;
  width: 50%;
  background: var(--line);
  z-index: 0;
}
.p-step::before { left: 0; }
.p-step::after  { right: 0; }
.p-step:first-child::before, .p-step:last-child::after { display: none; }
.p-step.is-done::before, .p-step.is-done::after,
.p-step.is-active::before { background: var(--brand); }
.p-dot {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: .8rem;
  font-weight: 700;
  background: #fff;
  border: 2px solid var(--line);
  color: var(--muted);
  transition: all .2s ease;
}
.p-step.is-active .p-dot {
  background: var(--grad);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 12px rgba(79, 70, 229, .4);
}
.p-step.is-done .p-dot {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  cursor: pointer;
}
.p-label {
  font-size: .72rem;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.25;
}
.p-step.is-active .p-label { color: var(--brand); }
.p-step.is-done .p-label { color: var(--ink-2); cursor: pointer; }

/* ---------- Steps ---------- */
.step { display: none; }
.step.is-active { display: block; animation: stepIn .28s ease both; }
@keyframes stepIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
.step-title { font-size: 1.3rem; margin-bottom: .2rem; }
.step-sub { font-size: .92rem; margin-bottom: 1.3rem; }
.block-title {
  font-size: 1rem;
  margin: 0 0 .8rem;
}
.extra-block {
  margin-top: 1.4rem;
  padding-top: 1.2rem;
  border-top: 1px dashed var(--line);
}
.optional { font-weight: 500; font-size: .8rem; color: var(--faint); }

.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
@media (max-width: 620px) {
  .row-2 { grid-template-columns: 1fr; gap: 0; }
}

.check-inline {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  margin: .45rem 0 0;
  font-weight: 500;
  font-size: .85rem;
  color: var(--muted);
  cursor: pointer;
}
.check-inline input { width: 16px; height: 16px; accent-color: var(--brand); cursor: pointer; }

/* Honeypot — off-screen, never visible */
.hp { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* Visually-hidden file inputs (kept in the form so FormData picks them up) */
.sr-file {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Step navigation ---------- */
.step-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  margin-top: 1.6rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
}
.step-nav .js-next, .step-nav .btn-submit { flex: 1; max-width: 300px; }
@media (max-width: 480px) {
  .step-nav .js-next, .step-nav .btn-submit { max-width: none; }
}
.btn-submit[disabled] { position: relative; }

/* ---------- Banner ---------- */
.banner {
  border-radius: var(--radius-sm);
  padding: .8rem 1rem;
  font-size: .92rem;
  font-weight: 600;
  margin-bottom: 1.1rem;
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}
.banner-notice { background: #fef3c7; color: #92400e; border-color: #fde68a; }

/* ---------- Photo dropzone ---------- */
.dropzone {
  border: 2px dashed var(--line);
  border-radius: var(--radius-sm);
  background: var(--tint);
  cursor: pointer;
  transition: border-color .15s, background .15s;
  outline: none;
}
.dropzone:hover, .dropzone:focus-visible { border-color: var(--brand); }
.dropzone:focus-visible { box-shadow: 0 0 0 4px rgba(79, 70, 229, .15); }
.dropzone.is-dragover { border-color: var(--brand); background: #e5e7fb; }
.dz-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
  padding: 1.6rem 1rem;
  color: var(--brand);
  text-align: center;
}
.dz-cta { font-weight: 700; font-size: .95rem; color: var(--ink-2); }
.dz-hint { font-size: .78rem; color: var(--muted); }
.dz-preview { padding: .8rem; }
.dz-preview img {
  max-height: 220px;
  width: auto;
  max-width: 100%;
  margin-inline: auto;
  border-radius: 10px;
  box-shadow: var(--shadow);
}
.dz-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: .7rem;
}
.dz-name {
  font-size: .82rem;
  font-weight: 600;
  color: var(--ink-2);
  overflow-wrap: anywhere;
  min-width: 0;
}
.dz-actions { display: inline-flex; gap: .9rem; flex-shrink: 0; }
.link-btn {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-size: .85rem;
  font-weight: 600;
  color: var(--brand);
  cursor: pointer;
}
.link-btn:hover { text-decoration: underline; }
.link-danger { color: var(--danger); }

/* ---------- Voice recorder ---------- */
.recorder {
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  padding: .9rem 1rem;
}
.rec-idle { display: flex; align-items: center; flex-wrap: wrap; gap: .7rem; }
.rec-btn {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font: inherit;
  font-weight: 700;
  font-size: .95rem;
  color: #fff;
  background: linear-gradient(120deg, #dc2626, #b91c1c);
  border: 0;
  border-radius: 999px;
  padding: .65rem 1.4rem;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(220, 38, 38, .3);
  transition: transform .15s, box-shadow .15s;
}
.rec-btn:hover { transform: translateY(-1px); box-shadow: 0 9px 20px rgba(220, 38, 38, .38); }
.rec-btn:active { transform: translateY(1px); }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: #fff; }
.rec-hint { font-size: .8rem; color: var(--muted); }
.rec-live { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.rec-pulse {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--danger);
  animation: recPulse 1.1s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes recPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, .45); }
  50%      { box-shadow: 0 0 0 9px rgba(220, 38, 38, 0); }
}
.rec-timer {
  font-family: 'Sora', monospace;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  flex: 1;
}
.rec-timer em { font-style: normal; font-weight: 500; font-size: .85rem; color: var(--muted); }
.rec-denied p { margin: 0 0 .3rem; font-size: .88rem; color: var(--ink-2); }

.voice-done { margin-top: .8rem; }
.voice-done audio { width: 100%; border-radius: 10px; }
.voice-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: .5rem;
}
.voice-alt {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .6rem;
  margin-top: .8rem;
}
.alt-or { font-size: .82rem; font-weight: 600; color: var(--faint); text-transform: uppercase; letter-spacing: .04em; }
.alt-hint { font-size: .78rem; color: var(--muted); }

/* ---------- Resume & samples ---------- */
.filebtn-row { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem; }
.filecard {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-top: .6rem;
  padding: .6rem .85rem;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--tint);
}
.filecard .dz-name { flex: 1; }
.filecard-icon { font-size: 1.1rem; flex-shrink: 0; }
.samples-list { list-style: none; margin: .6rem 0 0; padding: 0; display: grid; gap: .45rem; }
.samples-list li {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .5rem .85rem;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--tint);
  font-size: .85rem;
}
.samples-list .dz-name { flex: 1; }
.samples-list .file-size { font-size: .75rem; color: var(--muted); flex-shrink: 0; }

/* ---------- Portfolio links ---------- */
.plink-row { display: flex; gap: .5rem; margin-bottom: .55rem; }
.plink-row input { flex: 1; min-width: 0; }
.plink-del {
  flex-shrink: 0;
  width: 42px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--muted);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  transition: color .15s, border-color .15s;
}
.plink-del:hover { color: var(--danger); border-color: var(--danger); }

/* ---------- Review ---------- */
.review {
  margin-top: 1.5rem;
  padding: 1rem 1.1rem;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--tint);
}
.review .help { margin: .7rem 0 0; }
.review-chips { display: flex; flex-wrap: wrap; gap: .45rem; }
.review-chips .chip { background: #fff; border: 1px solid var(--line); white-space: normal; }
.review-chips .chip-green { background: #d1fae5; border-color: #a7f3d0; }

/* ---------- Success panel ---------- */
.success-panel { text-align: center; padding: 2.4rem 1.4rem 2.2rem; }
.success-check { display: flex; justify-content: center; margin-bottom: 1rem; }
.sc-circle {
  stroke: var(--success);
  stroke-dasharray: 202;
  stroke-dashoffset: 202;
  animation: scDraw .6s ease-out forwards;
}
.sc-tick {
  stroke: var(--success);
  stroke-dasharray: 42;
  stroke-dashoffset: 42;
  animation: scDraw .35s ease-out .45s forwards;
}
@keyframes scDraw { to { stroke-dashoffset: 0; } }
.success-title { font-size: 1.6rem; margin-bottom: .3rem; }
.success-sub { color: var(--ink-2); max-width: 34rem; margin-inline: auto; }
.code-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  margin: 1.4rem auto .5rem;
  padding: 1.1rem 1.4rem;
  max-width: 22rem;
  border: 2px dashed var(--brand);
  border-radius: var(--radius);
  background: var(--tint);
}
.code-label {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--muted);
}
.code-value {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.7rem;
  letter-spacing: .08em;
  color: var(--brand);
}
.code-note { font-size: .85rem; color: var(--muted); max-width: 26rem; margin-inline: auto; }
.next-steps { margin-top: 1.8rem; text-align: left; max-width: 30rem; margin-inline: auto; }
.timeline { list-style: none; margin: 0; padding: 0; counter-reset: tstep; }
.timeline li {
  position: relative;
  counter-increment: tstep;
  padding: 0 0 1.2rem 2.6rem;
}
.timeline li::before {
  content: counter(tstep);
  position: absolute;
  left: 0;
  top: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--grad);
  color: #fff;
  font-weight: 700;
  font-size: .85rem;
}
.timeline li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 14px;
  top: 32px;
  bottom: 2px;
  width: 2px;
  background: var(--line);
}
.timeline li strong { display: block; font-size: .96rem; }
.timeline li span { display: block; font-size: .86rem; color: var(--muted); line-height: 1.5; }
.success-actions { margin-top: 1.4rem; }

/* ---------- Pick-a-role state ---------- */
.pick-title { font-size: 1.35rem; margin-bottom: .2rem; }
.pick-sub { font-size: .92rem; margin-bottom: 1.2rem; }
.pick-empty { text-align: center; padding: 2rem 0; }
.pick-empty .btn { margin-top: .6rem; }
.rolepick { list-style: none; margin: 0; padding: 0; display: grid; gap: .7rem; }
.rolepick-link {
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: .95rem 1.05rem;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  text-decoration: none !important;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.rolepick-link:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.rolepick-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .35rem; }
.rolepick-name { font-family: var(--font-head); font-weight: 700; font-size: 1rem; color: var(--ink); }
.rolepick-meta { display: flex; flex-wrap: wrap; gap: .4rem; }
.rolepick-salary { font-size: .88rem; font-weight: 600; color: var(--success); }
.rolepick-arrow {
  flex-shrink: 0;
  font-size: 1.2rem;
  color: var(--brand);
  transition: transform .15s;
}
.rolepick-link:hover .rolepick-arrow { transform: translateX(3px); }

/* ---------- Footer ---------- */
.apply-footer {
  padding: 1.4rem 0 2rem;
  text-align: center;
  font-size: .84rem;
  color: var(--muted);
}
.apply-footer p { margin: 0; }

/* ---------- Small screens (≤400px) ---------- */
@media (max-width: 400px) {
  .wizard-card, .pick-card { padding: 1.15rem .9rem 1.4rem; }
  .p-label { font-size: .66rem; }
  .step-nav { flex-wrap: wrap; }
  .step-nav .btn { padding-inline: 1.1rem; }
  .hero-chips { gap: .4rem; }
  .hchip { font-size: .74rem; padding: .26rem .65rem; }
  .code-value { font-size: 1.45rem; }
}

/* ---- upload progress (shown while the application is being sent) ---- */
.upload-progress { margin-top: 1rem; }
.upload-progress[hidden] { display: none; }
.upload-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--tint);
  overflow: hidden;
}
.upload-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--grad);
  transition: width .25s ease;
}
.upload-text {
  margin: .5rem 0 0;
  font-size: .85rem;
  font-weight: 500;
  color: var(--muted);
}
