/* ========== RESET & BASE ========== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #0a0a0b;
  --bg-card: #141416;
  --bg-elevated: #1c1c1f;
  --border: #2a2a2e;
  --text: #e8e8ed;
  --text-muted: #8e8e93;
  --accent: #ff3b30;
  --accent-soft: rgba(255, 59, 48, 0.12);
  --green: #30d158;
  --orange: #ff9500;
  --radius: 14px;
  --radius-sm: 8px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ========== HERO ========== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 24px;
  background: radial-gradient(ellipse at 50% 0%, rgba(255, 59, 48, 0.08) 0%, transparent 60%);
}

.hero__badge {
  display: inline-block;
  padding: 6px 16px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 28px;
}

.hero__title {
  font-size: clamp(36px, 6vw, 72px);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
}

.hero__subtitle {
  font-size: clamp(16px, 2vw, 20px);
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 48px;
  line-height: 1.6;
}

.hero__stats {
  display: flex;
  justify-content: center;
  gap: 48px;
  margin-bottom: 48px;
}

.stat { display: flex; flex-direction: column; align-items: center; }

.stat__number {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}

.stat__label {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 4px;
}

.hero__cta {
  display: inline-block;
  padding: 16px 40px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  border-radius: 100px;
  font-weight: 600;
  font-size: 16px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.hero__cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(255, 59, 48, 0.3);
}

/* ========== MAP ========== */
.map-section { background: var(--bg); }

.map-header {
  padding: 60px 0 32px;
  text-align: center;
}

.map-header__title {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 8px;
}

.map-header__desc {
  color: var(--text-muted);
  font-size: 16px;
  margin-bottom: 24px;
}

.filter-group {
  margin-bottom: 16px;
}

.filter-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.filters {
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 8px 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  border-radius: 100px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.filter-btn:hover { border-color: var(--text-muted); color: var(--text); }

.filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.map-container {
  width: 100%;
  height: 75vh;
  min-height: 500px;
}

/* ========== CHAT ========== */
.chat-section {
  padding: 80px 0;
}

.section-title {
  font-size: 32px;
  font-weight: 800;
  text-align: center;
  margin-bottom: 8px;
}

.section-desc {
  text-align: center;
  color: var(--text-muted);
  font-size: 16px;
  margin-bottom: 40px;
}

.chat-window {
  max-width: 720px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 520px;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chat-message {
  display: flex;
  gap: 12px;
  max-width: 85%;
  animation: fadeIn 0.3s ease;
}

.chat-message.bot { align-self: flex-start; }
.chat-message.user { align-self: flex-end; flex-direction: row-reverse; }

.chat-message__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.chat-message.bot .chat-message__avatar {
  background: var(--accent-soft);
  color: var(--accent);
}

.chat-message.user .chat-message__avatar {
  background: rgba(48, 209, 88, 0.12);
  color: var(--green);
}

.chat-message__content {
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.6;
}

.chat-message.bot .chat-message__content {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}

.chat-message.user .chat-message__content {
  background: rgba(255, 59, 48, 0.08);
  border: 1px solid rgba(255, 59, 48, 0.15);
}

.chat-input-area {
  padding: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
}

.chat-input {
  flex: 1;
  padding: 12px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.chat-input:focus { border-color: var(--accent); }

.chat-input::placeholder { color: var(--text-muted); }

.chat-send {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
  flex-shrink: 0;
}

.chat-send:hover { transform: scale(1.08); }

/* ========== AGENCY ========== */
.agency-section {
  padding: 100px 0;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
}

.agency-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}

.agency-badge {
  display: inline-block;
  padding: 6px 14px;
  background: rgba(48, 209, 88, 0.1);
  color: var(--green);
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 20px;
}

.agency-title {
  font-size: 36px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}

.agency-desc {
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1.7;
  margin-bottom: 28px;
}

.agency-features {
  list-style: none;
  margin-bottom: 36px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.agency-features li {
  padding-left: 24px;
  position: relative;
  font-size: 15px;
  color: var(--text);
}

.agency-features li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 7px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
}

.agency-cta {
  display: inline-block;
  padding: 14px 36px;
  background: var(--green);
  color: #000;
  text-decoration: none;
  border-radius: 100px;
  font-weight: 600;
  font-size: 15px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.agency-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(48, 209, 88, 0.25);
}

.agency-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 48px;
  text-align: center;
}

.agency-card__icon { font-size: 48px; margin-bottom: 16px; }

.agency-card__number {
  font-size: 80px;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 12px;
}

.agency-card__text {
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ========== FOOTER ========== */
.footer {
  padding: 32px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  border-top: 1px solid var(--border);
}

/* ========== ANIMATIONS ========== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ========== SCROLLBAR ========== */
.chat-messages::-webkit-scrollbar { width: 6px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ========== BALLOON (Yandex Maps popup) ========== */
.balloon {
  font-family: 'Inter', sans-serif;
  min-width: 280px;
}

.balloon__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.balloon__name {
  font-size: 16px;
  font-weight: 700;
  color: #1a1a1a;
}

.balloon__developer {
  font-size: 12px;
  color: #888;
  margin-top: 2px;
}

.balloon__rating {
  background: #ff3b30;
  color: #fff;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}

.balloon__address {
  font-size: 13px;
  color: #666;
  margin-bottom: 12px;
}

.balloon__cons { list-style: none; }

.balloon__con {
  padding: 8px 0;
  border-top: 1px solid #eee;
  font-size: 13px;
  color: #333;
  cursor: pointer;
  transition: color 0.15s;
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.balloon__con:hover { color: #ff3b30; }

.balloon__con::before {
  content: '\26A0';
  flex-shrink: 0;
}

.balloon__severity {
  display: inline-flex;
  gap: 2px;
  margin-left: auto;
  flex-shrink: 0;
}

.balloon__severity-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ddd;
}

.balloon__severity-dot.active { background: #ff3b30; }

/* ========== RESPONSIVE ========== */

/* Tablet */
@media (max-width: 1024px) {
  .agency-grid { gap: 40px; }
  .agency-card { padding: 36px; }
  .agency-card__number { font-size: 64px; }
}

/* Mobile */
@media (max-width: 768px) {
  .container { padding: 0 16px; }

  /* Hero */
  .hero { padding: 60px 16px; min-height: auto; padding-top: 100px; padding-bottom: 80px; }
  .hero__badge { font-size: 11px; margin-bottom: 20px; }
  .hero__title { font-size: 32px; }
  .hero__subtitle { font-size: 15px; margin-bottom: 36px; }
  .hero__stats { gap: 20px; margin-bottom: 36px; }
  .stat__number { font-size: 28px; }
  .stat__label { font-size: 12px; }
  .hero__cta { padding: 14px 32px; font-size: 15px; }

  /* Map */
  .map-header { padding: 40px 0 20px; }
  .map-header__title { font-size: 24px; }
  .map-header__desc { font-size: 14px; }
  .filter-group { margin-bottom: 12px; }
  .filter-label { font-size: 11px; margin-bottom: 6px; }
  .filters {
    flex-wrap: nowrap;
    gap: 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    justify-content: flex-start;
    padding-bottom: 4px;
  }
  .filters::-webkit-scrollbar { display: none; }
  .filter-btn { padding: 6px 12px; font-size: 12px; white-space: nowrap; flex-shrink: 0; }
  .map-container { height: 55vh; min-height: 350px; }

  /* Chat */
  .chat-section { padding: 48px 0; }
  .section-title { font-size: 24px; }
  .section-desc { font-size: 14px; margin-bottom: 24px; }
  .chat-window { height: 400px; border-radius: 12px; }
  .chat-messages { padding: 16px; gap: 12px; }
  .chat-message { max-width: 92%; }
  .chat-message__content { padding: 10px 14px; font-size: 13px; }
  .chat-message__avatar { width: 28px; height: 28px; font-size: 10px; }
  .chat-input-area { padding: 12px; }
  .chat-input { padding: 10px 14px; font-size: 14px; }
  .chat-send { width: 40px; height: 40px; }

  /* Agency */
  .agency-section { padding: 60px 0; }
  .agency-grid { grid-template-columns: 1fr; gap: 32px; }
  .agency-title { font-size: 26px; }
  .agency-desc { font-size: 15px; }
  .agency-features li { font-size: 14px; }
  .agency-cta { padding: 12px 28px; font-size: 14px; width: 100%; text-align: center; }
  .agency-card { padding: 32px 24px; }
  .agency-card__icon { font-size: 36px; }
  .agency-card__number { font-size: 56px; }
  .agency-card__text { font-size: 14px; }

  /* Footer */
  .footer { padding: 24px 0; font-size: 12px; }
}

/* Small phones */
@media (max-width: 375px) {
  .hero__title { font-size: 26px; }
  .hero__stats { flex-direction: column; gap: 16px; }
  .stat { flex-direction: row; gap: 8px; }
  .stat__number { font-size: 24px; }
  .chat-window { height: 360px; }
  .agency-title { font-size: 22px; }
  .agency-card__number { font-size: 44px; }
}

/* ========== QUICK REPLIES ========== */
.quick-replies {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
}

.quick-reply-btn {
  display: block;
  width: 100%;
  padding: 10px 14px;
  background: rgba(255, 59, 48, 0.06);
  border: 1px solid rgba(255, 59, 48, 0.2);
  border-radius: 10px;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s;
  line-height: 1.4;
}

.quick-reply-btn:hover {
  background: rgba(255, 59, 48, 0.12);
  border-color: var(--accent);
  transform: translateX(4px);
}

/* ========== TYPING INDICATOR ========== */
.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 8px 0;
}

.typing-indicator span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-4px); }
}