/* Job application wizard (About job.html) */

.job-apply {
  max-width: 980px;
  margin: 18px auto 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.015));
  position: relative;
}

.job-apply--success {
  background: radial-gradient(900px 400px at 50% -20%, rgba(236,241,240,0.10), rgba(255,255,255,0.015));
}

.job-apply--success .job-success {
    justify-content: center;
  margin-top: 0;
}

.job-apply--success .content-card__body {
  padding-top: 6px;
  padding-bottom: 6px;
  /*min-height: min(520px, 70vh); */
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.job-apply__title {
  margin: 0 0 8px 0;
  font-size: clamp(18px, 2.3vw, 26px);
  font-weight: 800;
}

.job-apply__subtitle {
  margin: 0 0 18px 0;
  color: rgba(236,241,240,0.78);
  font-size: 15px;
  line-height: 1.55;
}

.job-progress {
  padding: 14px 14px 12px;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  background: rgba(255,255,255,0.02);
  box-shadow: 0 10px 26px rgba(0,0,0,0.25);
  margin-bottom: 16px;
}

.job-progress,
.job-form {
  transition: opacity 320ms ease, transform 320ms ease;
}

.job-form.is-fading,
.job-apply--success .job-progress {
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
}

.job-progress__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.job-progress__label {
  font-weight: 700;
  font-size: 14px;
  color: rgba(236,241,240,0.92);
}

.job-progress__percent {
  font-weight: 800;
  font-size: 14px;
  color: rgba(236,241,240,0.92);
}

.job-progress__bar {
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
}

.job-progress__barFill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(236,241,240,0.95), rgba(236,241,240,0.55));
  box-shadow: 0 0 0 1px rgba(0,0,0,0.08) inset;
  transition: width 260ms ease;
}

.job-form {
  display: grid;
  gap: 14px;
}

.job-step {
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  padding: 18px 20px;
  background: rgba(255,255,255,0.02);
  /* Prevent long unbreakable strings from overflowing the card */
  overflow-wrap: anywhere;
  word-break: break-word;
}

.job-step__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap; /* on narrow screens kicker + title stack instead of clipping */
}

.job-step__kicker {
  font-size: 12px;
  font-weight: 800;
  color: rgba(236,241,240,0.75);
}

.job-step__title {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
}

.job-field {
  display: grid;
  gap: 8px;
}

.job-field__label {
  font-weight: 700;
  font-size: 14px;
  line-height: 1.5;
  color: rgba(236,241,240,0.92);
}

.job-field__hint {
  font-size: 13px;
  line-height: 1.55;
  color: rgba(236,241,240,0.68);
}

.job-field__error {
  min-height: 18px;
  font-size: 13px;
  font-weight: 700;
  color: rgba(236,241,240,0.92);
}

.job-input,
.job-textarea {
  width: 100%;
  max-width: 100%;     /* never escape the step card */
  box-sizing: border-box;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.06);
  color: var(--text-strong, #ECF1F0);
  padding: 12px 14px;
  font-size: 16px;
  line-height: 1.5;
  font-family: inherit;
  outline: none;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.job-textarea {
  resize: vertical;
  min-height: 130px;
  /* Keep the placeholder template legible when it has line breaks */
  white-space: pre-wrap;
}

.job-input::placeholder,
.job-textarea::placeholder {
  color: rgba(236,241,240,0.55);
}

.job-input:focus,
.job-textarea:focus {
  border-color: rgba(236,241,240,0.28);
  background: rgba(255,255,255,0.08);
}

.job-input[aria-invalid="true"],
.job-textarea[aria-invalid="true"] {
  border-color: rgba(236,241,240,0.38);
  box-shadow: 0 0 0 3px rgba(206,235,255,0.18);
}

.job-field__error:not(:empty) {
  color: rgba(236,241,240,0.92);
  opacity: 0.95;
}

.job-fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  display: grid;
  /* Two equal columns so a Yes/No pair stops eating full-width rows.
     Auto-fit keeps it sensible when a third option ever appears. */
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

/* Legend spans both columns above the option grid. */
.job-fieldset__legend {
  grid-column: 1 / -1;
  padding: 0;
  margin: 0 0 4px;
  font-weight: 700;
  font-size: 14px;
  color: rgba(236,241,240,0.92);
}

/* Notes/hints inside a fieldset (e.g. the citizen-gate refusal note)
   should also span the full row, not squeeze into one column. */
.job-fieldset .job-note,
.job-fieldset__legend + .job-note {
  grid-column: 1 / -1;
}

.job-radio {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.03);
  cursor: pointer;
  user-select: none;
  font-weight: 500;
  transition:
    transform 160ms ease,
    background 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.job-radio:hover {
  transform: translateY(-1px);
  background: rgba(139,92,246,0.06);
  border-color: rgba(139,92,246,0.32);
}

.job-radio input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-violet, #8B5CF6);
  flex-shrink: 0;
}

/* Selected state — picks up the brand accent so the choice is obvious. */
.job-radio:has(input:checked) {
  background: rgba(139,92,246,0.14);
  border-color: rgba(139,92,246,0.65);
  box-shadow: 0 4px 16px rgba(139,92,246,0.18);
}

/* Stack to one column on narrow phones — readability beats symmetry. */
@media (max-width: 480px) {
  .job-fieldset {
    grid-template-columns: 1fr;
  }
}

/* Conditional sub-section that appears under a radio. Sits visually
   nested inside the parent step. */
.job-conditional {
  display: grid;
  gap: 14px;
  margin-top: 16px;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid rgba(139, 92, 246, 0.18);
  background: rgba(139, 92, 246, 0.06);
  animation: jobConditionalIn 240ms cubic-bezier(.4, 0, .2, 1);
}

.job-conditional[hidden] { display: none !important; }

/* Nested conditional (step 6: hasConvictions=Нет → clearance radio →
   canProvideClearance=Нет → reason). Tinted with magenta so the deeper
   layer of the question chain reads as distinct. */
.job-conditional .job-conditional {
  margin-top: 14px;
  border-color: rgba(236, 72, 153, 0.22);
  background: rgba(236, 72, 153, 0.06);
}

@keyframes jobConditionalIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== Floating CTA — jumps to the wizard form ===== */
.job-scroll-cta {
  position: fixed;
  right: clamp(12px, 2vw, 28px);
  top: 38vh;
  z-index: 50;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px 14px 18px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent-violet, #8B5CF6), var(--accent-magenta, #EC4899));
  color: #FFFFFF;
  font-family: inherit;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow:
    0 14px 36px rgba(139, 92, 246, 0.42),
    0 0 0 1px rgba(255, 255, 255, 0.08) inset;
  transition:
    transform 280ms cubic-bezier(.4, 0, .2, 1),
    opacity 280ms ease,
    box-shadow 280ms ease;
  animation: jobScrollCtaBob 3.6s ease-in-out infinite;
}

.job-scroll-cta:hover {
  transform: translateX(-4px) scale(1.04);
  box-shadow:
    0 18px 44px rgba(139, 92, 246, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.12) inset;
}

.job-scroll-cta:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 3px rgba(139, 92, 246, 0.4),
    0 14px 36px rgba(139, 92, 246, 0.42);
}

.job-scroll-cta.is-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateX(80px);
  animation: none;
}

.job-scroll-cta__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  color: currentColor;
  animation: jobScrollCtaArrow 1.6s ease-in-out infinite;
}

@keyframes jobScrollCtaBob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

@keyframes jobScrollCtaArrow {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(3px); }
}

@media (prefers-reduced-motion: reduce) {
  .job-scroll-cta,
  .job-scroll-cta__icon { animation: none; }
}

@media (max-width: 768px) {
  .job-scroll-cta {
    padding: 12px 18px 12px 16px;
    font-size: 14px;
    top: auto;
    bottom: 92px;
  }
}

@media (max-width: 480px) {
  .job-scroll-cta {
    padding: 0;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    bottom: 84px;
    right: 16px;
    justify-content: center;
  }
  .job-scroll-cta__label { display: none; }
  .job-scroll-cta__icon { width: 24px; height: 24px; }
}

.job-note {
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(236,241,240,0.18);
  background: rgba(255,255,255,0.03);
  font-weight: 700;
  color: rgba(236,241,240,0.86);
}

/* Flex (not grid) so the layout collapses gracefully when [data-action="back"]
   is hidden on step 1 — primary 'Далее' then claims the full row instead
   of leaving an awkward empty column. */
.job-actions {
  display: flex;
  gap: 12px;
  margin-top: 18px;
}

.job-btn {
  flex: 1 1 0;
  min-width: 120px;
  height: 52px;
  padding: 0 28px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-strong, #ECF1F0);
  font-family: inherit;
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0.01em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition:
    transform 180ms cubic-bezier(.4, 0, .2, 1),
    box-shadow 180ms ease,
    background 180ms ease,
    border-color 180ms ease,
    opacity 180ms ease;
}

/* display:inline-flex on .job-btn beat the user-agent [hidden]{display:none}
   rule, so hidden buttons stayed visible. Restore the expected behaviour. */
.job-btn[hidden] { display: none !important; }

.job-btn:active { transform: translateY(0); }

.job-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.job-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.35);
}

/* Primary — brand gradient (violet → magenta) with a soft accent glow.
   Same visual language as .btn-primary / .contact-btn on the rest of
   the site so the wizard doesn't feel orphaned. */
.job-btn--primary {
  background: linear-gradient(135deg, var(--accent-violet, #8B5CF6), var(--accent-magenta, #EC4899));
  color: #FFFFFF;
  border-color: transparent;
  box-shadow:
    0 8px 24px rgba(139, 92, 246, 0.32),
    0 1px 0 rgba(255, 255, 255, 0.08) inset;
}
.job-btn--primary:hover {
  transform: translateY(-2px);
  box-shadow:
    0 14px 34px rgba(139, 92, 246, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.06) inset;
}
.job-btn--primary:active {
  transform: translateY(0);
  box-shadow:
    0 6px 16px rgba(139, 92, 246, 0.30),
    0 1px 0 rgba(0, 0, 0, 0.10) inset;
}

/* Ghost (back) — neutral outline. Lower visual weight than primary so the
   'Далее' direction reads as the obvious next step. */
.job-btn--ghost {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-strong, #ECF1F0);
  border-color: rgba(255, 255, 255, 0.14);
}
.job-btn--ghost:hover {
  background: rgba(139, 92, 246, 0.10);
  border-color: rgba(139, 92, 246, 0.55);
  transform: translateY(-1px);
}
/* Hide 'Назад' entirely when the wizard JS disables it (i.e. step 1) —
   a visibly-disabled outline button next to the primary just adds noise.
   Scoped to .job-btn--ghost so the primary's disabled state (cooldown
   'Доступно через Xs') still renders normally with opacity. */
.job-btn--ghost[disabled],
.job-btn--ghost:disabled {
  display: none !important;
}

/* On narrow viewports keep both buttons usable by stacking. */
@media (max-width: 480px) {
  .job-actions { flex-direction: column-reverse; gap: 10px; }
  .job-btn { width: 100%; }
}

.job-status {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(720px, calc(100% - 24px));
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(17, 1, 30, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 14px 30px rgba(0,0,0,0.35);
  font-size: 14px;
  color: rgba(236,241,240,0.92);
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.job-status:not(:empty) {
  opacity: 1;
}

.job-success {
  margin-top: 10px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  padding: 22px 16px;
  text-align: center;
  box-shadow: 0 10px 26px rgba(0,0,0,0.25);
}

.job-success__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.05);
  margin-bottom: 10px;
  color: var(--fg);
  transform: scale(0.92);
  opacity: 0;
  animation: jobSuccessPop 420ms ease forwards;
}

.job-success__title {
  font-weight: 900;
  font-size: clamp(18px, 2.2vw, 24px);
  margin-bottom: 6px;
}

.job-success__text {
  color: rgba(236,241,240,0.78);
  font-size: 15px;
}

@keyframes jobSuccessPop {
  to { opacity: 1; transform: scale(1); }
}

@media (max-width: 900px) {
  .job-apply { margin: 16px auto 0; }
}

@media (max-width: 520px) {
  .job-apply__subtitle { font-size: 14px; }
  .job-actions { grid-template-columns: 1fr; }
  .job-btn { height: 52px; font-size: 17px; }
  .job-step { padding: 12px; }
  .job-input, .job-textarea { font-size: 16px; }
}
