:root {
  --bg: #f1f5f9;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;
  --accent: #0d9488;
  --accent-hover: #0f766e;
  --accent-soft: #ccfbf1;
  --danger: #dc2626;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 24px rgba(15, 23, 42, 0.07);
  --radius: 14px;
  --radius-sm: 10px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto 0;
  height: 320px;
  background: linear-gradient(
    180deg,
    #ffffff 0%,
    rgba(255, 255, 255, 0.85) 40%,
    transparent 100%
  );
  pointer-events: none;
  z-index: -1;
}

.wrap {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.125rem;
}

main {
  padding: 2rem 0 3rem;
}

.hero {
  margin-bottom: 1.5rem;
  text-align: center;
}

.hero h1 {
  margin: 0;
  font-size: clamp(1.75rem, 4.5vw, 2.5rem);
  line-height: 1.12;
  letter-spacing: -0.035em;
  font-weight: 700;
}

.hero-subline {
  margin: 0.75rem auto 0;
  max-width: 32rem;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--muted);
}

.content-grid {
  display: grid;
  gap: 1.25rem;
  align-items: start;
}

.column-main,
.column-side {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-width: 0;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.35rem 1.4rem;
  box-shadow: var(--shadow-md);
}

.hint strong {
  color: var(--accent-hover);
  font-weight: 600;
}

.results-savings {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.45;
  color: #065f46;
  background: var(--accent-soft);
  border: 1px solid #99f6e4;
  border-radius: var(--radius-sm);
}

.card-head {
  margin-bottom: 1.15rem;
}

.card h2 {
  margin: 0 0 0.35rem;
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.hint,
.results-note,
.card > p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.5;
}

.field-row {
  display: grid;
  gap: 0.85rem;
}

.field {
  display: block;
}

.field span {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.4rem;
}

.field input {
  width: 100%;
  min-height: 2.875rem;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #fafbfc;
  color: var(--text);
  font-size: 0.9375rem;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.field input:hover {
  border-color: #cbd5e1;
}

.field input::placeholder {
  color: #94a3b8;
}

.field input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.18);
}

.suggestions {
  list-style: none;
  margin: 0.5rem 0 0.75rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.suggestions li + li {
  border-top: 1px solid var(--border);
}

.suggestions li button {
  width: 100%;
  text-align: left;
  padding: 0.7rem 0.9rem;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 0.875rem;
  font-family: inherit;
  cursor: pointer;
  min-height: 2.75rem;
  line-height: 1.4;
}

.suggestions li button:hover {
  background: var(--bg);
}

.map-hint {
  margin: 0.75rem 0 0.5rem;
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.45;
}

.map {
  height: 240px;
  border-radius: var(--radius-sm);
  margin: 0 0 1.15rem;
  border: 1px solid var(--border);
  z-index: 0;
  overflow: hidden;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.875rem;
  padding: 0.75rem 1.35rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
}

.btn:active:not(:disabled) {
  transform: scale(0.99);
}

.btn.primary {
  width: 100%;
  background: var(--text);
  color: #fff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.15);
}

.btn.primary:hover:not(:disabled) {
  background: #1e293b;
}

.btn.primary:disabled {
  opacity: 0.7;
  cursor: wait;
}

.btn.primary.is-loading .btn-label {
  opacity: 0.85;
}

.btn-spinner {
  display: none;
  width: 1.125rem;
  height: 1.125rem;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.btn.primary.is-loading .btn-spinner {
  display: block;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.btn.whatsapp {
  background: #128c7e;
  color: #fff;
}

.btn.whatsapp:hover {
  background: #0d7368;
}

.btn.telegram {
  background: #0088cc;
  color: #fff;
}

.btn.telegram:hover {
  background: #0077b5;
}

.contact-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 1rem;
}

.contact-buttons .btn {
  width: 100%;
}

.steps-list {
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
}

.steps-list li {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  margin-bottom: 0.85rem;
  font-size: 0.875rem;
  color: var(--text);
  line-height: 1.45;
}

.steps-list li:last-child {
  margin-bottom: 0;
}

.step-num {
  flex-shrink: 0;
  width: 1.625rem;
  height: 1.625rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-hover);
  background: var(--accent-soft);
  border-radius: 999px;
}

.quote-placeholder {
  border-style: dashed;
  background: #fafbfc;
  box-shadow: none;
}

.quote-placeholder.is-hidden {
  display: none;
}

.quote-placeholder-title {
  margin: 0 0 0.35rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
}

.quote-placeholder-text {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.5;
}

.error {
  margin: 0.85rem 0 0;
  padding: 0.65rem 0.85rem;
  color: #991b1b;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
}

.fare-cards {
  display: grid;
  gap: 0.65rem;
}

.fare-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem 1rem;
  align-items: center;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fafbfc;
}

.fare-card-book {
  grid-column: 1 / -1;
  width: 100%;
  min-height: 2.5rem;
  margin-top: 0.25rem;
  background: var(--text);
  color: #fff;
  font-size: 0.875rem;
}

.fare-card-book:hover {
  background: #1e293b;
}

.book-modal {
  border: none;
  padding: 0;
  max-width: calc(100vw - 2rem);
  width: min(420px, 100%);
  background: transparent;
}

.book-modal::backdrop {
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
}

.book-modal-panel {
  position: relative;
  padding: 1.5rem 1.4rem 1.35rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}

.book-modal-close {
  position: absolute;
  top: 0.65rem;
  right: 0.75rem;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 8px;
  background: var(--bg);
  color: var(--muted);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
}

.book-modal-close:hover {
  color: var(--text);
  background: #e2e8f0;
}

.book-modal-panel h2 {
  margin: 0 2rem 0.5rem 0;
  font-size: 1.125rem;
  font-weight: 600;
}

.book-modal-summary {
  margin: 0 0 0.65rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--accent-hover);
  line-height: 1.45;
}

.book-modal-note {
  margin: 0 0 0.75rem;
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.5;
}

.book-message-block {
  margin-bottom: 0.75rem;
}

.book-message-block label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text);
}

.book-modal-message {
  width: 100%;
  min-height: 9rem;
  padding: 0.65rem 0.75rem;
  font-family: inherit;
  font-size: 0.8125rem;
  line-height: 1.45;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fafbfc;
  color: var(--text);
  resize: vertical;
}

.book-modal-copy {
  width: 100%;
  margin-top: 0.5rem;
  min-height: 2.5rem;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  font-size: 0.875rem;
}

.book-modal-copy:hover {
  background: #e2e8f0;
}

.book-modal-telegram-hint {
  margin: 0 0 1rem;
  padding: 0.65rem 0.85rem;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.45;
  color: #0c4a6e;
  background: #e0f2fe;
  border: 1px solid #7dd3fc;
  border-radius: var(--radius-sm);
}

.book-modal-actions {
  margin-top: 0;
}

.fare-card.unavailable {
  opacity: 0.72;
}

.fare-card-name {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
}

.fare-card-meta {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  align-items: baseline;
}

.fare-block {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.fare-block-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.fare-block-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.fare-block-value.strike {
  text-decoration: line-through;
  color: #94a3b8;
  font-weight: 500;
}

.fare-block-value.highlight {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--accent-hover);
}

.fare-card-badge {
  justify-self: end;
  align-self: start;
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-hover);
}

.fare-card.unavailable .fare-card-badge {
  background: #f1f5f9;
  color: var(--muted);
}

@media (min-width: 600px) {
  .field-row {
    grid-template-columns: 1fr 1fr;
  }

  .contact-buttons {
    flex-direction: row;
  }

  .contact-buttons .btn {
    flex: 1;
  }
}

@media (min-width: 768px) {
  main {
    padding-top: 2.5rem;
    padding-bottom: 3rem;
  }

  .content-grid {
    grid-template-columns: 1fr minmax(280px, 320px);
    gap: 1.5rem;
  }

  .column-side {
    position: sticky;
    top: 1.25rem;
  }

  .map {
    height: 300px;
  }
}

@media (min-width: 1024px) {
  .wrap {
    padding: 0 1.5rem;
  }

  .card {
    padding: 1.5rem 1.65rem;
  }
}
