/* ========================================
   Vacancy Detail
======================================== */

.vacancy-detail {
  padding: 40px 0 90px;
}


/* ========================================
   Layout
======================================== */

.vacancy-detail__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  align-items: start;
  gap: 28px;

  margin-top: 24px;
}

.vacancy-detail__content {
  min-width: 0;
}


/* ========================================
   Vacancy Header
======================================== */

.vacancy-detail__header {
  margin-bottom: 30px;
}


/* ========================================
   Company
======================================== */

.vacancy-detail__company {
  display: flex;
  align-items: center;
  gap: 14px;

  margin-bottom: 24px;
}

.company-logo {
  display: flex;
  flex: 0 0 54px;
  align-items: center;
  justify-content: center;

  width: 54px;
  height: 54px;
  padding: 7px;

  overflow: hidden;

  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 14px;

  text-decoration: none;

  transition: var(--transition);
}

.company-logo:hover,
.company-logo:focus-visible {
  border-color: #cbd5e1;

  outline: none;
}

.company-logo__image {
  display: block;

  width: 100%;
  height: 100%;

  object-fit: contain;

  border-radius: 8px;
}

.company-logo__placeholder {
  display: flex;
  align-items: center;
  justify-content: center;

  width: 100%;
  height: 100%;

  background: #f8fafc;
  border-radius: 9px;
}

.company-logo__placeholder-icon {
  width: 24px;
  height: 24px;

  object-fit: contain;

  opacity: 0.55;
}

.vacancy-detail__company-info {
  display: flex;
  flex-direction: column;
  gap: 5px;

  min-width: 0;
}

.company-name {
  color: var(--color-text);

  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;

  overflow-wrap: anywhere;

  text-decoration: none;

  transition: var(--transition);
}

.company-name:hover,
.company-name:focus-visible {
  color: var(--color-primary);

  outline: none;
}

.vacancy-detail__company-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 12px;

  color: var(--color-text-light);

  font-size: 12px;
  line-height: 1.4;
}

.company-status {
  color: var(--color-primary);

  font-weight: 600;
}


/* ========================================
   Title
======================================== */

.vacancy-detail__title {
  max-width: 900px;

  margin: 0 0 18px;

  overflow-wrap: anywhere;

  color: var(--color-text);

  font-size: clamp(32px, 3vw, 42px);
  font-weight: 800;
  line-height: 1.1;

  letter-spacing: -0.02em;
}


/* ========================================
   Meta
======================================== */

.vacancy-detail__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 18px;

  margin-bottom: 24px;

  color: var(--color-text-light);

  font-size: 14px;
  line-height: 1.4;
}

.vacancy-detail__meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;

  min-width: 0;
}

/*
  Убираем старый bullet-разделитель.
  С location icon он больше не нужен.
*/
.vacancy-detail__meta-item + .vacancy-detail__meta-item::before {
  display: none;

  content: none;
}

.vacancy-detail__location img {
  flex: 0 0 auto;

  width: 16px;
  height: 16px;

  object-fit: contain;

  opacity: 0.72;
}

.vacancy-detail__location span {
  min-width: 0;

  overflow-wrap: anywhere;
}


/* ========================================
   Salary
======================================== */

.vacancy-detail__salary {
  overflow-wrap: anywhere;

  color: var(--color-text);

  font-size: clamp(26px, 2.4vw, 34px);
  font-weight: 800;
  line-height: 1.15;
}

.vacancy-detail__salary-empty {
  color: var(--color-text-light);

  font-size: 20px;
  font-weight: 600;
}


/* ========================================
   Structured Requirements
======================================== */

.vacancy-detail__requirements-summary {
  display: grid;
  grid-template-columns:
    repeat(
      auto-fit,
      minmax(160px, 1fr)
    );
  gap: 10px;

  margin: 0 0 30px;
}

.vacancy-detail__requirement {
  min-width: 0;
  padding: 14px 15px;

  background: #f8fafc;
  border: 1px solid #e8edf3;
  border-radius: 14px;
}

.vacancy-detail__requirement span,
.vacancy-detail__requirement strong {
  display: block;
}

.vacancy-detail__requirement span {
  margin-bottom: 5px;

  color: var(--color-text-light);

  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
}

.vacancy-detail__requirement strong {
  overflow-wrap: anywhere;

  color: var(--color-text);

  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
}


/* ========================================
   Skills
======================================== */

.vacancy-detail__skills-section {
  padding: 22px 0 30px;

  border-top: 1px solid #e8edf3;
  border-bottom: 1px solid #e8edf3;
}

.vacancy-detail__section-label {
  margin: 0 0 13px;

  color: var(--color-text-light);

  font-size: 12px;
  font-weight: 700;

  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.vacancy-detail__skills {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.vacancy-detail__skill {
  display: inline-flex;
  align-items: center;

  min-height: 32px;
  padding: 5px 12px;

  color: var(--color-primary);

  background: #eef7fd;
  border: 1px solid #d9edf9;
  border-radius: 999px;

  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
}

.vacancy-detail__empty {
  margin: 0;

  color: #94a3b8;

  font-size: 14px;
}


/* ========================================
   Content Sections
======================================== */

.vacancy-section {
  margin-top: 36px;
}

.vacancy-section + .vacancy-section {
  padding-top: 34px;

  border-top: 1px solid #edf1f5;
}

.vacancy-section h2 {
  margin: 0 0 16px;

  color: var(--color-text);

  font-size: 23px;
  font-weight: 750;
  line-height: 1.25;
}

.vacancy-section__content {
  max-width: 900px;

  overflow-wrap: anywhere;

  color: #475569;

  font-size: 15px;
  line-height: 1.75;
}

.vacancy-section__content br + br {
  line-height: 2.1;
}


/* ========================================
   Sidebar
======================================== */

.vacancy-sidebar {
  position: sticky;
  top: 110px;

  display: flex;
  flex-direction: column;
  gap: 14px;

  min-width: 0;
}


/* ========================================
   Sidebar Cards
======================================== */

.sidebar-card {
  padding: 22px;

  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 20px;
}

.sidebar-card__header {
  margin-bottom: 18px;
}

.sidebar-card__header h2,
.sidebar-card > h3 {
  margin: 0;

  color: var(--color-text);

  font-size: 18px;
  font-weight: 750;
  line-height: 1.25;
}

.sidebar-card__header p {
  margin: 6px 0 0;

  color: var(--color-text-light);

  font-size: 13px;
  line-height: 1.55;
}

.sidebar-card .button {
  width: 100%;
}


/* ========================================
   Apply
======================================== */

.apply-form {
  display: flex;
  flex-direction: column;

  gap: 16px;
}

.apply-form__field {
  display: flex;
  flex-direction: column;

  gap: 7px;
}

.apply-form label {
  color: #475569;

  font-size: 13px;
  font-weight: 700;
}

.apply-form textarea {
  width: 100%;
  min-height: 120px;

  resize: vertical;
}

.form-field-error {
  color: #dc2626;

  font-size: 13px;
  line-height: 1.4;
}

.vacancy-favorite-form {
  margin-top: 10px;
}


/* ========================================
   Report
======================================== */

.vacancy-report__trigger {
  justify-content: center;
}


/* ========================================
   Existing application
======================================== */

.application-status {
  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 16px;

  margin: 0 0 16px;

  padding: 13px 15px;

  background: #f8fafc;

  border: 1px solid #e8edf3;
  border-radius: 12px;
}

.application-status__label {
  color: #64748b;

  font-size: 14px;
}

.application-status strong {
  color: #0f172a;

  font-size: 14px;
}

.chat-unavailable {
  display: flex;
  flex-direction: column;

  gap: 9px;
}

.chat-unavailable__button {
  cursor: default;

  opacity: 0.65;
}

.chat-unavailable small {
  color: #64748b;

  font-size: 12px;
  line-height: 1.45;
}


/* ========================================
   AI Match
======================================== */

.sidebar-card--match {
  overflow: hidden;
}

.match-score {
  margin: 0 0 12px;

  color: #0e8ddb;

  font-size: 42px;
  font-weight: 800;
  line-height: 1;
}

.progress {
  width: 100%;
  height: 8px;

  margin-bottom: 16px;

  overflow: hidden;

  background: #e9eef3;

  border-radius: 999px;
}

.progress-fill {
  height: 100%;

  background: #0e8ddb;

  border-radius: inherit;
}

.match-explanation {
  margin: 0;

  color: #475569;

  font-size: 14px;
  line-height: 1.6;
}

.match-details {
  margin-top: 14px;
}

.match-details__summary,
.match-improvement__summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: 100%;
  min-height: 42px;

  padding: 10px 14px;

  color: #0e8ddb;
  background: #eef8ff;

  border: 1px solid #d6efff;
  border-radius: 12px;

  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;

  cursor: pointer;
  user-select: none;
}

.match-details__summary::-webkit-details-marker,
.match-improvement__summary::-webkit-details-marker {
  display: none;
}

.match-details__summary::after,
.match-improvement__summary::after {
  content: "";

  width: 8px;
  height: 8px;

  margin-left: 8px;

  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;

  transform: rotate(45deg) translateY(-2px);
}

.match-details[open] > .match-details__summary::after,
.match-improvement[open] > .match-improvement__summary::after {
  transform: rotate(225deg) translateY(-2px);
}

.match-details__body {
  margin-top: 12px;
  padding: 14px;

  background: #f8fafc;

  border: 1px solid #e2e8f0;
  border-radius: 14px;
}

.match-details__body h3,
.match-details__body h4 {
  margin: 0;

  color: #0f172a;
  line-height: 1.25;
}

.match-details__body h3 {
  font-size: 15px;
  font-weight: 800;
}

.match-details__body h4 {
  margin-bottom: 8px;

  font-size: 13px;
  font-weight: 800;
}

.match-details__text,
.match-improvement__body p {
  margin: 8px 0 0;

  color: #475569;

  font-size: 13px;
  line-height: 1.55;
}

.match-details__section {
  margin-top: 14px;
}

.match-details__list,
.match-improvement__body ul {
  display: flex;
  flex-direction: column;

  gap: 8px;

  margin: 0;
  padding: 0;

  list-style: none;
}

.match-details__list li,
.match-improvement__body li {
  position: relative;

  padding-left: 22px;

  color: #475569;

  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.match-details__list li::before,
.match-improvement__body li::before {
  position: absolute;
  left: 0;
  top: 0;
}

.match-details__list--strengths li::before {
  content: "✓";

  color: #16a34a;
  font-weight: 800;
}

.match-details__list--gaps li::before,
.match-improvement__body li::before {
  content: "•";

  color: #0e8ddb;
  font-weight: 900;
}

.match-improvement {
  margin-top: 14px;
}

.match-improvement__summary {
  color: #334155;
  background: #ffffff;
  border-color: #dbe4ee;
}

.match-improvement__body {
  margin-top: 10px;
  padding: 12px;

  background: #ffffff;

  border: 1px solid #e2e8f0;
  border-radius: 12px;
}

.match-improvement__body ul {
  margin-top: 10px;
}

.match-updated {
  margin: 12px 0 0;

  color: #94a3b8;

  font-size: 13px;
  line-height: 1.45;
}

.match-action-form {
  margin-top: 16px;
}

.match-empty {
  display: flex;
  align-items: center;

  gap: 10px;

  padding: 14px 0 2px;

  color: #94a3b8;

  font-size: 14px;
}

.match-empty__value {
  color: #cbd5e1;

  font-size: 32px;
  font-weight: 700;
  line-height: 1;
}


/* ========================================
   Company sidebar
======================================== */

.sidebar-company {
  display: flex;
  align-items: flex-start;

  gap: 13px;
}

.sidebar-company__logo {
  width: 46px;
  height: 46px;

  flex: 0 0 auto;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 7px;

  overflow: hidden;

  background: #f8fafc;

  border: 1px solid #e5eaf0;
  border-radius: 12px;
}

.sidebar-company__logo img {
  width: 100%;
  height: 100%;

  object-fit: contain;
}

.sidebar-company__content {
  min-width: 0;

  display: flex;
  flex-direction: column;

  gap: 4px;

  color: #64748b;

  font-size: 13px;
  line-height: 1.4;
}

.sidebar-company__name {
  color: #0f172a;

  font-size: 15px;
  line-height: 1.35;

  overflow-wrap: anywhere;
}

.sidebar-card__actions {
  display: flex;
  flex-direction: column;

  gap: 9px;

  margin-top: 20px;
}


/* ========================================
   Button icon
======================================== */

.button--with-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  gap: 8px;
}

.button--with-icon img {
  width: 17px;
  height: 17px;

  flex-shrink: 0;
}

.match-preparation-link {
  width: 100%;

  margin-top: 14px;
}


/* ========================================
   Interview preparation
======================================== */

.interview-preparation-page {
  padding: 58px 0 100px;
}

.interview-preparation-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;

  gap: 24px;

  margin-top: 28px;
  margin-bottom: 32px;
}

.interview-preparation-header__eyebrow {
  display: inline-flex;

  margin-bottom: 10px;

  color: #0e8ddb;

  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
}

.interview-preparation-header h1 {
  margin: 0;

  color: #0f172a;

  font-size: 44px;
  font-weight: 900;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.interview-preparation-header p {
  margin: 10px 0 0;

  color: #64748b;

  font-size: 16px;
  line-height: 1.45;
}

.interview-preparation-score {
  min-width: 124px;

  padding: 16px 18px;

  background: #ffffff;

  border: 1px solid #e2e8f0;
  border-radius: 18px;

  text-align: center;
}

.interview-preparation-score span {
  display: block;

  color: #64748b;

  font-size: 13px;
  font-weight: 700;
}

.interview-preparation-score strong {
  display: block;

  margin-top: 5px;

  color: #0e8ddb;

  font-size: 32px;
  font-weight: 900;
  line-height: 1;
}

.interview-preparation-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;

  gap: 28px;
  align-items: start;
}

.interview-preparation-content {
  min-width: 0;

  display: flex;
  flex-direction: column;

  gap: 18px;
}

.interview-preparation-card,
.interview-preparation-empty {
  padding: 26px;

  background: #ffffff;

  border: 1px solid #e2e8f0;
  border-radius: 20px;
  box-shadow: 0 18px 40px rgb(15 23 42 / 6%);
}

.interview-preparation-card h2,
.interview-preparation-empty h2 {
  margin: 0 0 14px;

  color: #0f172a;

  font-size: 24px;
  font-weight: 900;
  line-height: 1.2;
}

.interview-preparation-card p,
.interview-preparation-empty p {
  margin: 0;

  color: #475569;

  font-size: 15px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.interview-preparation-list,
.interview-preparation-questions {
  margin: 0;
  padding: 0;
}

.interview-preparation-list {
  display: flex;
  flex-direction: column;

  gap: 10px;

  list-style: none;
}

.interview-preparation-list li {
  position: relative;

  padding-left: 22px;

  color: #475569;

  font-size: 15px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.interview-preparation-list li::before {
  content: "•";

  position: absolute;
  left: 0;
  top: 0;

  color: #0e8ddb;
  font-weight: 900;
}

.interview-preparation-questions {
  display: flex;
  flex-direction: column;

  gap: 16px;

  list-style-position: inside;
}

.interview-preparation-questions li {
  color: #0e8ddb;

  font-weight: 800;
  overflow-wrap: anywhere;
}

.interview-preparation-questions h3 {
  display: inline;

  margin: 0;

  color: #0f172a;

  font-size: 16px;
  font-weight: 800;
  line-height: 1.45;
}

.interview-preparation-questions p {
  margin-top: 8px;
  padding-left: 22px;

  font-weight: 400;
}

.interview-preparation-side {
  position: sticky;
  top: 24px;

  min-width: 0;
}

.interview-preparation-side form,
.interview-preparation-empty form {
  margin-top: 18px;
}

.interview-preparation-side .button,
.interview-preparation-empty .button {
  width: 100%;
}


/* ========================================
   Tablet
======================================== */

@media (max-width: 900px) {
  .vacancy-detail__grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .vacancy-sidebar {
    position: static;

    display: flex;
    flex-direction: column;
    gap: 14px;

    width: 100%;
  }

  .sidebar-card--apply {
    grid-column: auto;
  }

  .vacancy-detail__requirements-summary {
    grid-template-columns:
      repeat(
        auto-fit,
        minmax(200px, 1fr)
      );
  }

  .interview-preparation-layout {
    grid-template-columns: 1fr;
  }

  .interview-preparation-side {
    position: static;
  }
}


/* ========================================
   Mobile
======================================== */

@media (max-width: 700px) {
  .vacancy-detail {
    padding: 30px 0 60px;
  }

  .vacancy-detail__grid {
    gap: 28px;

    margin-top: 20px;
  }

  .vacancy-detail__header {
    margin-bottom: 30px;
  }

  .vacancy-detail__company {
    align-items: flex-start;

    margin-bottom: 20px;
  }

  .company-logo {
    width: 50px;
    height: 50px;

    border-radius: 14px;
  }

  .vacancy-detail__title {
    margin-bottom: 15px;

    font-size: 32px;
  }

  .vacancy-detail__meta {
    gap: 5px 10px;

    font-size: 11px;
  }

  .vacancy-detail__meta-item + .vacancy-detail__meta-item::before {
    margin-right: 12px;
  }

  .vacancy-detail__salary {
    font-size: 30px;
  }

  .vacancy-detail__requirements-summary {
    grid-template-columns: 1fr;

    margin-bottom: 28px;
  }

  .vacancy-detail__skills-section {
    padding: 21px 0 28px;
  }

  .vacancy-section {
    margin-top: 34px;
  }

  .vacancy-section + .vacancy-section {
    padding-top: 32px;
  }

  .vacancy-section h2 {
    font-size: 24px;
  }

  .vacancy-section__content {
    font-size: 15px;
    line-height: 1.7;
  }

  .vacancy-sidebar {
    display: flex;
  }

  .sidebar-card {
    padding: 20px;

    border-radius: 18px;
  }

  .interview-preparation-page {
    padding: 42px 0 70px;
  }

  .interview-preparation-header {
    align-items: stretch;
    flex-direction: column;

    margin-top: 22px;
    margin-bottom: 26px;
  }

  .interview-preparation-header h1 {
    font-size: 34px;
  }

  .interview-preparation-score {
    width: 100%;
  }

  .interview-preparation-card,
  .interview-preparation-empty {
    padding: 20px;

    border-radius: 18px;
  }

  .interview-preparation-card h2,
  .interview-preparation-empty h2 {
    font-size: 21px;
  }
}

/* ========================================
   Small Mobile
======================================== */

@media (max-width: 480px) {
  .vacancy-detail {
    padding-top: 26px;
  }

  .vacancy-detail__title {
    font-size: 28px;
  }

  .vacancy-detail__salary {
    font-size: 25px;
  }

  .vacancy-detail__meta {
    gap: 8px 12px;
  }

  .vacancy-detail__requirement {
    padding: 13px 14px;
  }

  .vacancy-detail__skill {
    min-height: 30px;
    padding: 5px 10px;

    font-size: 12px;
  }

  .sidebar-card {
    padding: 18px;
  }
}
