:root {
  --bg: #f4f1ea;
  --surface: rgba(255, 255, 255, 0.84);
  --surface-strong: #ffffff;
  --surface-muted: #f8f6f2;
  --text: #1b2430;
  --text-soft: #5f6b76;
  --line: rgba(27, 36, 48, 0.12);
  --line-strong: rgba(27, 36, 48, 0.22);
  --accent: #1d4f5f;
  --accent-strong: #163f4d;
  --accent-soft: rgba(29, 79, 95, 0.1);
  --success: #2d6a4f;
  --shadow: 0 24px 60px rgba(27, 36, 48, 0.08);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(29, 79, 95, 0.08), transparent 28%),
    linear-gradient(180deg, #faf8f4 0%, var(--bg) 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.38) 0, rgba(255, 255, 255, 0.38) 1px, transparent 1px, transparent 120px),
    linear-gradient(rgba(255, 255, 255, 0.32) 0, rgba(255, 255, 255, 0.32) 1px, transparent 1px, transparent 120px);
  opacity: 0.18;
}

button,
input {
  font: inherit;
}

.page-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 56px 0 72px;
}

.hero,
.search-panel,
.panel {
  backdrop-filter: blur(16px);
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: var(--shadow);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(280px, 0.9fr);
  gap: 28px;
  padding: 40px;
  border-radius: var(--radius-lg);
  margin-bottom: 28px;
}

.eyebrow,
.section-kicker,
.hero-stat-label {
  margin: 0;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: var(--text-soft);
}

.hero h1,
.section-heading h2 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.hero h1 {
  max-width: 11ch;
  font-size: clamp(2.6rem, 5vw, 4.8rem);
  line-height: 0.95;
}

.hero-text {
  max-width: 54ch;
  margin: 20px 0 0;
  color: var(--text-soft);
  font-size: 1.05rem;
  line-height: 1.7;
}

.hero-panel {
  display: grid;
  gap: 16px;
  align-content: end;
}

.hero-stat {
  padding: 22px;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(248, 246, 242, 0.92));
  border: 1px solid var(--line);
}

.hero-stat strong {
  display: block;
  margin-top: 10px;
  font-size: 1.15rem;
  font-weight: 600;
}

.search-panel {
  padding: 28px;
  border-radius: 24px;
  margin-bottom: 28px;
}

.section-heading {
  display: grid;
  gap: 6px;
  margin-bottom: 22px;
}

.section-heading h2 {
  font-size: 1.65rem;
}

.search-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 16px;
  align-items: end;
}

.field {
  display: grid;
  gap: 8px;
}

.field span {
  color: var(--text-soft);
  font-size: 0.92rem;
}

.field input {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.86);
  color: var(--text);
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

.field input:focus {
  border-color: rgba(29, 79, 95, 0.4);
  box-shadow: 0 0 0 4px rgba(29, 79, 95, 0.08);
  background: var(--surface-strong);
}

.primary-button,
.book-button {
  border: none;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #f7f4ee;
  cursor: pointer;
  transition: transform 180ms ease, background-color 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
}

.primary-button {
  height: 52px;
  padding: 0 22px;
  min-width: 164px;
  box-shadow: 0 10px 24px rgba(29, 79, 95, 0.22);
}

.primary-button:hover,
.book-button:hover {
  transform: translateY(-1px);
  background: var(--accent-strong);
}

.primary-button:disabled,
.book-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
  box-shadow: none;
}

.status-message {
  min-height: 22px;
  margin: 14px 0 0;
  color: var(--text-soft);
  font-size: 0.95rem;
}

.status-message.is-success {
  color: var(--success);
}

.status-message.is-error {
  color: #8a3b2e;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.9fr);
  gap: 28px;
}

.panel {
  padding: 28px;
  border-radius: 24px;
  min-height: 320px;
}

.card-stack {
  display: grid;
  gap: 14px;
}

.empty-state {
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.4);
}

.train-card,
.booking-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 246, 242, 0.82));
  padding: 18px;
}

.train-card {
  display: grid;
  gap: 18px;
}

.train-card-header,
.booking-card-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.train-card h3,
.booking-card h3 {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 600;
}

.train-number,
.booking-meta,
.muted {
  color: var(--text-soft);
}

.route-line {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.98rem;
}

.route-line::before {
  content: "";
  width: 24px;
  height: 1px;
  background: var(--line-strong);
}

.seat-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.88rem;
}

.booking-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
}

.booking-form input {
  height: 46px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
}

.book-button {
  height: 46px;
  padding: 0 18px;
}

.booking-card {
  display: grid;
  gap: 10px;
}

.booking-chip {
  display: inline-flex;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(45, 106, 79, 0.12);
  color: var(--success);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@media (max-width: 920px) {
  .hero,
  .content-grid,
  .search-grid {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    max-width: none;
  }

  .primary-button {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 24px, 1180px);
    padding: 28px 0 40px;
  }

  .hero,
  .search-panel,
  .panel {
    padding: 20px;
    border-radius: 20px;
  }

  .booking-form {
    grid-template-columns: 1fr;
  }
}
