/* ==========================================================================
   Shark Ecom — careers.css
   Список вакансій, сторінка вакансії, форма відгуку
   Потребує base.css
   ========================================================================== */

.page-head {
  padding: calc(var(--nav-h) + 88px) var(--pad-x) 0;
}

.page-head h1 { margin-bottom: 20px; }

.page-head .section-intro { margin-bottom: 0; max-width: 560px; }

/* --------------------------------------------------------------------------
   Хлібні крихти / назад
   -------------------------------------------------------------------------- */

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 40px;
  transition: color 0.2s, gap 0.2s;
}

.back-link:hover { color: var(--text); gap: 14px; }

/* --------------------------------------------------------------------------
   Список вакансій
   -------------------------------------------------------------------------- */

.jobs {
  padding: 64px var(--pad-x) 100px;
}

.jobs-group + .jobs-group { margin-top: 72px; }

.jobs-group-title {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

.job-card {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 28px;
  padding: 28px 20px 28px 4px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: background 0.25s, padding-left 0.25s;
}

.job-card:hover {
  background: var(--surface);
  padding-left: 20px;
}

.job-card-main { min-width: 0; }

.job-card-title {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: clamp(20px, 2.4vw, 26px);
  color: #fff;
  letter-spacing: -0.4px;
  line-height: 1.2;
  margin-bottom: 8px;
}

.job-card-desc {
  font-size: 14px;
  font-weight: 300;
  color: var(--muted);
  line-height: 1.6;
  max-width: 620px;
}

.job-card-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.tag {
  font-size: 12px;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 13px;
  white-space: nowrap;
}

.tag-open {
  color: var(--accent);
  border-color: var(--accent-border);
  background: var(--accent-dim);
}

.job-card-arrow {
  font-size: 20px;
  color: var(--muted);
  transition: color 0.25s, transform 0.25s;
}

.job-card:hover .job-card-arrow { color: var(--accent); transform: translateX(4px); }

/* Порожній стан / спонтанний відгук */
.jobs-cta {
  margin-top: 64px;
  padding: 36px 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  flex-wrap: wrap;
}

.jobs-cta-text { max-width: 560px; }

.jobs-cta-title {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 20px;
  color: #fff;
  margin-bottom: 8px;
}

.jobs-cta-desc {
  font-size: 14px;
  font-weight: 300;
  color: var(--muted);
  line-height: 1.6;
}

/* --------------------------------------------------------------------------
   Сторінка вакансії
   -------------------------------------------------------------------------- */

.job {
  padding: calc(var(--nav-h) + 56px) var(--pad-x) 0;
}

.job-hero { margin-bottom: 72px; }

.job-hero h1 {
  font-size: clamp(38px, 6.2vw, 88px);
  letter-spacing: -3px;
  max-width: 15ch;
  margin-bottom: 0;
}

.job-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 80px;
  align-items: start;
  padding-bottom: 40px;
}

/* Ліва колонка з мета-даними — липка на десктопі */
.job-aside {
  position: sticky;
  top: calc(var(--nav-h) + 40px);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.job-meta-label {
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 2px;
}

.job-meta-value {
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
}

.job-aside .btn-primary { margin-top: 8px; justify-content: center; }

.job-body {
  font-size: 17px;
  font-weight: 300;
  line-height: 1.75;
  color: var(--text);
  max-width: 720px;
}

.job-body > p { color: #eef1f8; }
.job-body > p + p { margin-top: 18px; }
.job-body strong { font-weight: 700; color: #fff; }

.job-body h2 {
  font-size: clamp(26px, 3.4vw, 40px);
  margin-top: 72px;
  margin-bottom: 28px;
}

.job-body ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.job-body ul li {
  position: relative;
  padding-left: 26px;
  color: #eef1f8;
}

.job-body ul li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 13px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.job-body ul li strong { font-weight: 700; color: #fff; }

/* Плашка з умовами */
.job-offer {
  margin-top: 32px;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.job-salary-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.job-salary-value {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 30px;
  color: #fff;
  letter-spacing: -1px;
  line-height: 1.1;
  /* інакше рядок ламається всередині вилки: "$1000 —" / "$1500" */
  white-space: nowrap;
}

/* Syne не має кирилиці — 'Від' у ньому падає на системний шрифт і поруч
   з латинськими цифрами виглядає як помилка верстки. Тому кириличний
   префікс свідомо винесений окремим рядком у DM Sans. */
.job-salary-prefix {
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  white-space: nowrap;
}

.job-salary-note {
  display: block;
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  font-size: 13px;
  color: var(--muted);
  margin-top: 8px;
}

/* --------------------------------------------------------------------------
   Форма відгуку
   -------------------------------------------------------------------------- */

.apply {
  padding: 96px var(--pad-x) 120px;
  border-top: 1px solid var(--border);
  margin-top: 96px;
}

.apply-inner {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 80px;
  align-items: start;
}

.apply-side .section-tag { margin-bottom: 12px; }

.apply-side-text {
  font-size: 14px;
  font-weight: 300;
  color: var(--muted);
  line-height: 1.7;
}

.apply-form { max-width: 720px; }

.apply-form h2 { margin-bottom: 40px; }

.field { margin-bottom: 24px; }

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.field label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
}

.field label .req { color: var(--accent); }

.field-hint {
  float: right;
  font-size: 12px;
  color: var(--muted-dim);
}

.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field input[type="url"],
.field textarea {
  width: 100%;
  font-family: 'DM Sans', sans-serif;
  font-size: 16px; /* < 16px змушує iOS Safari зумити сторінку на фокусі */
  font-weight: 400;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 15px 18px;
  transition: border-color 0.2s, background 0.2s;
  -webkit-appearance: none;
  appearance: none;
}

.field textarea {
  min-height: 150px;
  resize: vertical;
  line-height: 1.6;
}

.field input::placeholder,
.field textarea::placeholder { color: var(--muted-dim); }

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface2);
}

.field input:focus-visible,
.field textarea:focus-visible { outline: none; }

.field.invalid input,
.field.invalid textarea,
.field.invalid .tg-input,
.field.invalid .file-drop { border-color: #ff5a5f; }

.field-error {
  display: none;
  font-size: 13px;
  color: #ff8b8f;
  margin-top: 8px;
}

.field.invalid .field-error { display: block; }

/* Телеграм-нік з префіксом @ */
.tg-input {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: border-color 0.2s, background 0.2s;
}

.tg-input:focus-within {
  border-color: var(--accent);
  background: var(--surface2);
}

.tg-input span {
  padding-left: 18px;
  font-size: 16px;
  color: var(--muted);
  user-select: none;
}

.tg-input input {
  border: none !important;
  background: transparent !important;
  padding-left: 4px !important;
}

/* Завантаження CV */
.file-drop {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: 12px;
  padding: 22px 20px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.file-drop:hover,
.file-drop.dragover { border-color: var(--accent); background: var(--surface2); }

.file-drop input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.file-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--accent-dim);
  color: var(--accent);
}

.file-icon svg { width: 20px; height: 20px; }

.file-text { min-width: 0; display: block; }

.file-name {
  display: block;
  font-size: 15px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-sub {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.file-clear {
  margin-left: auto;
  position: relative;
  z-index: 2;
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  padding: 6px;
  display: none;
}

.file-drop.has-file .file-clear { display: block; }
.file-clear:hover { color: #fff; }

/* Ханіпот замість капчі */
.hp-field {
  position: absolute !important;
  left: -9999px !important;
  width: 1px; height: 1px;
  overflow: hidden;
}

.apply-submit {
  margin-top: 36px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.apply-submit .btn-primary {
  padding: 17px 44px;
  font-size: 16px;
}

.apply-consent {
  font-size: 12px;
  color: var(--muted-dim);
  line-height: 1.6;
  max-width: 380px;
}

/* Стани відповіді */
.form-status {
  display: none;
  margin-top: 24px;
  padding: 18px 22px;
  border-radius: 12px;
  font-size: 15px;
  line-height: 1.6;
}

.form-status.show { display: block; }

.form-status.error {
  background: rgba(255,90,95,0.08);
  border: 1px solid rgba(255,90,95,0.3);
  color: #ff9ea1;
}

.apply-done {
  display: none;
  text-align: center;
  padding: 64px 32px;
  background: var(--surface);
  border: 1px solid var(--accent-border);
  border-radius: 20px;
}

.apply-done.show { display: block; }

.apply-done-mark {
  width: 56px;
  height: 56px;
  margin: 0 auto 24px;
  border-radius: 50%;
  background: var(--accent-dim);
  color: var(--accent);
  display: grid;
  place-items: center;
}

.apply-done-mark svg { width: 26px; height: 26px; }

.apply-done h3 { margin-bottom: 12px; }

.apply-done p {
  font-size: 15px;
  font-weight: 300;
  color: var(--muted);
  max-width: 420px;
  margin: 0 auto;
  line-height: 1.7;
}

/* --------------------------------------------------------------------------
   RESPONSIVE
   -------------------------------------------------------------------------- */

@media (max-width: 1100px) {
  .job-layout, .apply-inner { gap: 48px; grid-template-columns: 220px minmax(0, 1fr); }
}

@media (max-width: 900px) {
  .page-head { padding-top: calc(var(--nav-h) + 56px); }

  .job { padding-top: calc(var(--nav-h) + 36px); }
  .job-hero { margin-bottom: 40px; }
  .job-hero h1 { letter-spacing: -1.5px; max-width: none; }

  /* minmax(0,1fr), а не 1fr: інакше min-content колонки (у файловому полі
     стоїть white-space: nowrap) розпирає сітку ширше за екран */
  .job-layout,
  .apply-inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 36px;
  }

  .apply-form, .apply-side { min-width: 0; }

  /* Липка колонка на мобільному з'їдає екран — розкладаємо в рядок */
  .job-aside {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px;
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
  }

  .job-meta { flex: 1 1 40%; }
  .job-aside .btn-primary { flex: 1 1 100%; margin-top: 8px; }

  .job-body { font-size: 16px; }
  .job-body h2 { margin-top: 52px; margin-bottom: 22px; }

  /* На 390px рядок "ВІД $1000 — $1500" при 30px не влазить у картку
     (виходило 300px при доступних 296) і переносився. Кегль тепер
     тягнеться за шириною екрана, щоб вилка лишалась одним рядком
     і на 320px, і на 430px. */
  .job-offer { padding: 22px; }
  .job-salary-value { font-size: clamp(18px, 5.9vw, 30px); }
  .job-salary-row { gap: 8px; }

  .apply { padding: 64px var(--pad-x) 80px; margin-top: 64px; }

  .field-row { grid-template-columns: 1fr; gap: 0; }

  .apply-submit .btn-primary { width: 100%; justify-content: center; }

  .job-card {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 24px 0;
  }
  .job-card:hover { padding-left: 0; background: transparent; }
  .job-card-meta { justify-content: flex-start; }
  .job-card-arrow { display: none; }

  .jobs-cta { padding: 28px 22px; }
  .jobs-cta .btn-primary { width: 100%; justify-content: center; }
}

/* --------------------------------------------------------------------------
   Підказка під полем (не помилка) — зʼявляється, коли в поле вставили
   посилання на хмарну теку
   -------------------------------------------------------------------------- */

.field-note {
  display: none;
  font-size: 12px;
  font-style: italic;
  font-weight: 300;
  line-height: 1.5;
  color: var(--muted);
  margin-top: 8px;
}

.field-note.show { display: block; }

/* Помилка важливіша за підказку — не показуємо обидві одночасно */
.field.invalid .field-note { display: none; }

/* --------------------------------------------------------------------------
   Опис вакансії на мобільному
   Чисто білий текст. Акценти відрізняються не кольором (він однаковий),
   а вагою: 300 проти 700. DM Sans 700 підвантажується окремо — без нього
   браузер малює faux bold, і різниця майже не читається.
   -------------------------------------------------------------------------- */

@media (max-width: 900px) {
  .job-body > p,
  .job-body ul li { color: #fff; }

  .job-body strong,
  .job-body ul li strong {
    color: #fff;
    font-weight: 700;
  }
}
