* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-bg: #101324;
  --card-bg: #232b45;
  --accent: #20b486;
  --accent-secondary: #0088cc;
  --text-muted: rgba(255, 255, 255, 0.7);
  --border-light: rgba(255, 255, 255, 0.15);
}

body {
  font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--primary-bg) fixed;
  color: #fff;
  min-height: 100vh;
  width: 100%;
  padding: 24px 16px 32px;
  line-height: 1.6;
  display: flex;
  justify-content: center;
}

.language-switch {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 12px;
}

.lang-btn {
  padding: 8px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-light);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.lang-btn:hover {
  transform: translateY(-2px);
}

.lang-btn.active {
  background: linear-gradient(135deg, #ffd166, #fca311);
  color: #1b1b1b;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(16, 19, 36, 0.8);
  pointer-events: none;
  z-index: -1;
}

.container {
  width: min(420px, 100%);
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 48px);
  gap: 16px;
}

.header {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.header-subtitle {
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.header-title {
  font-size: clamp(1.5rem, 6vw, 2rem);
  font-weight: 600;
}

.header-description {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.vacancies-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.vacancy-card {
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  display: flex;
  flex-direction: column;
}

.vacancy-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.25);
}

.vacancy-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.vacancy-title {
  padding: 12px;
  font-size: 0.98rem;
  font-weight: 600;
}

.loading-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 32px 12px;
  background: var(--card-bg);
  border-radius: 16px;
  border: 1px solid var(--border-light);
}

.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loading-text {
  color: var(--text-muted);
  font-size: 0.95rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.vacancy-details,
.contact-step {
  display: none;
  flex-direction: column;
  gap: 18px;
  background: var(--card-bg);
  border-radius: 18px;
  border: 1px solid var(--border-light);
  padding: 20px;
}

.vacancy-details.active,
.contact-step.active {
  display: flex;
}

.vacancy-details-header {
  display: flex;
  gap: 16px;
  align-items: center;
}

.vacancy-details-image-small {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.vacancy-details-title {
  font-size: 1.3rem;
  font-weight: 600;
}

.vacancy-company {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.vacancy-salary {
  margin-top: 4px;
  color: #ffd166;
  font-weight: 600;
}

.vacancy-description {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.9);
  white-space: pre-line;
}

.vacancy-chat {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 16px;
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.chat-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.chat-manager-name {
  font-weight: 600;
}

.chat-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #3ddc84;
  box-shadow: 0 0 8px rgba(61, 220, 132, 0.6);
}

.chat-status-text {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
  text-transform: lowercase;
}

.chat-title {
  font-size: 1.05rem;
  font-weight: 600;
}

.chat-model {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.chat-window {
  max-height: 240px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 12px;
}

.chat-message {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chat-message.assistant .chat-bubble {
  align-self: flex-start;
  background: rgba(32, 180, 134, 0.15);
  border: 1px solid rgba(32, 180, 134, 0.35);
}

.chat-message.user .chat-bubble {
  align-self: flex-end;
  background: rgba(0, 136, 204, 0.15);
  border: 1px solid rgba(0, 136, 204, 0.35);
}

.chat-author {
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.chat-bubble {
  padding: 10px 12px;
  border-radius: 12px;
  line-height: 1.5;
  max-width: 100%;
}

.chat-messenger-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

.chat-messenger-btn,
.chat-install-btn {
  padding: 10px 16px;
  border-radius: 12px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, #0088cc, #046a9f);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.chat-install-btn.ai-consult {
  background: linear-gradient(90deg, #6c63ff, #00c9ff);
  color: #fff;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  padding: 10px 14px;
  margin-top: 8px;
  cursor: pointer;
  transition: 0.3s;
}
.chat-install-btn.ai-consult:hover {
  opacity: 0.85;
  transform: scale(1.03);
}

.chat-messenger-btn.whatsapp {
  background: linear-gradient(135deg, #1ebe7d, #178a58);
}

.chat-messenger-btn.telegram {
  background: linear-gradient(135deg, #0088cc, #046a9f);
}

.chat-messenger-btn.no-messenger {
  background: linear-gradient(135deg, #5c6bc0, #3949ab);
}

.chat-install-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

.chat-install-btn.whatsapp-install {
  background: linear-gradient(135deg, #1ebe7d, #178a58);
}

.chat-install-btn.telegram-install {
  background: linear-gradient(135deg, #0088cc, #046a9f);
}

.chat-install-btn.signal-install {
  background: linear-gradient(135deg, #536dfe, #3d5afe);
}

.chat-install-btn.fill-form {
  background: linear-gradient(135deg, #ffb74d, #f57c00);
  color: #1b1b1b;
}

.chat-messenger-btn:hover,
.chat-install-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 16px;
}

.modal-backdrop.active {
  display: flex;
}

.modal-dialog {
  background: rgba(17, 23, 43, 0.95);
  border-radius: 20px;
  padding: 28px;
  width: min(420px, 100%);
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 18px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  font-size: 24px;
  cursor: pointer;
}

.modal-title {
  font-size: 1.5rem;
  margin-bottom: 20px;
  font-weight: 600;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.95rem;
}

.modal-field input,
.modal-field select {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(10, 14, 32, 0.85);
  color: #fff;
  font-size: 16px;
}

.modal-field input:focus,
.modal-field select:focus {
  border-color: #ffd166;
  outline: none;
}

.modal-submit {
  margin-top: 8px;
  padding: 14px 16px;
  border-radius: 14px;
  border: none;
  background: linear-gradient(135deg, #ffd166, #fca311);
  color: #1b1b1b;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.modal-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

.modal-success {
  margin-top: 20px;
  padding: 18px;
  border-radius: 14px;
  background: rgba(31, 122, 73, 0.2);
  border: 1px solid rgba(61, 220, 132, 0.4);
  color: #b9f6ca;
  font-weight: 600;
  text-align: center;
}

.chat-form {
  display: flex;
  gap: 10px;
}

.chat-input {
  flex: 1;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 16px;
}

.chat-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.chat-submit {
  padding: 12px 18px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #ffd166, #fca311);
  color: #1b1b1b;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.chat-submit:hover {
  transform: translateY(-2px);
}

.contact-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.contact-title {
  font-size: 1.6rem;
  font-weight: 600;
}

.contact-subtitle {
  font-size: 1rem;
  color: var(--text-muted);
}

.manager-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 18px;
  background: var(--card-bg);
  border-radius: 16px;
  border: 1px solid var(--border-light);
}

.manager-photo {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255, 255, 255, 0.25);
}

.manager-name {
  font-size: 1.2rem;
  font-weight: 600;
}

.contact-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.contact-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 28px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 14px;
  color: #fff;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.contact-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(255,255,255,0.4), transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.contact-btn:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.25);
}

.contact-btn:hover::before {
  opacity: 0.6;
}

.whatsapp-btn {
  background: linear-gradient(135deg, #1ebe7d, #178a58);
}

.telegram-btn {
  background: linear-gradient(135deg, #0088cc, #046a9f);
}

.navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  background: var(--card-bg);
  border-radius: 16px;
  border: 1px solid var(--border-light);
  backdrop-filter: blur(12px);
}

.navigation.hidden {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.navigation.visible {
  opacity: 1;
  transform: translateY(0);
}

.nav-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 12px;
  border: none;
  background: var(--card-bg);
  color: #fff;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s ease, transform 0.2s ease;
}

.nav-button svg {
  width: 20px;
  height: 20px;
}

.nav-button.back {
  padding-inline: 14px;
}

.nav-button.next {
  background: linear-gradient(135deg, #ffd166, #fca311);
  color: #1b1b1b;
  min-width: 120px;
}

.nav-button:hover {
  transform: translateY(-2px);
}

.error-message {
  text-align: center;
  color: #ff6b6b;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 20px;
  font-weight: 600;
}

@media (max-width: 560px) {
  body {
    padding: 18px 12px 28px;
  }

  .vacancies-grid {
    grid-template-columns: 1fr;
  }

  .vacancy-card {
    flex-direction: row;
    align-items: center;
  }

  .vacancy-image {
    width: 38%;
    aspect-ratio: 1;
  }

  .vacancy-title {
    padding: 16px;
    font-size: 1rem;
  }

  .vacancy-details {
    padding: 18px;
  }

  .vacancy-details-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .vacancy-details-image-small {
    width: 100%;
    height: 200px;
    border-radius: 16px;
  }

  .chat-window {
    max-height: 320px;
  }

  .contact-buttons {
    flex-direction: column;
    width: 100%;
  }

  .contact-btn {
    width: 100%;
    justify-content: center;
  }
}
