@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Instrument+Serif:ital@0;1&display=swap");

:root {
  --bg: #f4f0e6;
  --bg-strong: #efe6d5;
  --ink: #1e1b16;
  --muted: #5b5347;
  --accent: #0b6e4f;
  --accent-2: #f76f51;
  --surface: #ffffff;
  --shadow: rgba(28, 24, 17, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top left, #fff6e7 0%, #f4f0e6 45%, #ede5d7 100%);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

.bg-orb {
  position: absolute;
  border-radius: 50%;
  opacity: 0.3;
  z-index: 0;
}

.bg-orb--a {
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, rgba(247, 111, 81, 0.8), rgba(247, 111, 81, 0));
  top: -140px;
  right: -120px;
}

.bg-orb--b {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(11, 110, 79, 0.8), rgba(11, 110, 79, 0));
  bottom: 40px;
  left: -80px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 8vw 10px;
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
}

.back {
  position: absolute;
  left: 0;
  top: 28px;
  background-color: rgba(11, 110, 79, 0.08);
  background-image: linear-gradient(var(--accent), var(--accent));
  background-repeat: no-repeat;
  background-size: 0% 100%;
  background-position: left center;
  color: var(--accent);
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 600;
  border: 1px solid rgba(11, 110, 79, 0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease, color 0.2s ease,
    background-size 0.2s ease;
}

.home {
  position: absolute;
  right: 0;
  top: 28px;
  background-color: rgba(11, 110, 79, 0.08);
  background-image: linear-gradient(var(--accent), var(--accent));
  background-repeat: no-repeat;
  background-size: 0% 100%;
  background-position: left center;
  color: var(--accent);
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 600;
  border: 1px solid rgba(11, 110, 79, 0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease, color 0.2s ease,
    background-size 0.2s ease;
}

.back:hover,
.home:hover {
  transform: translateY(-2px);
  background-size: 100% 100%;
  color: #fff;
  box-shadow: 0 14px 30px var(--shadow);
}

.title {
  text-align: center;
}

.title h1 {
  margin: 0;
  font-size: clamp(26px, 3vw, 36px);
  font-family: "Instrument Serif", "Times New Roman", serif;
}

.title p {
  margin: 8px 0 0;
  color: var(--muted);
}

.content {
  padding: 24px 8vw 80px;
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
}

.card {
  background: var(--surface);
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 18px 40px var(--shadow);
}

.card__title h2 {
  margin: 0 0 6px;
}

.card__title p {
  margin: 0 0 24px;
}

.card__title--media {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.card__media {
  width: 72px;
  height: 72px;
  object-fit: contain;
  filter: drop-shadow(0 8px 14px rgba(28, 24, 17, 0.2));
}

.muted {
  color: var(--muted);
}

.card--modes {
  margin-bottom: 24px;
}

.mode-switch {
  display: inline-flex;
  background: rgba(11, 110, 79, 0.08);
  border-radius: 999px;
  padding: 4px;
  gap: 6px;
  border: 1px solid rgba(11, 110, 79, 0.2);
}

.mode-switch__btn {
  border: none;
  background: transparent;
  color: var(--accent);
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.mode-switch__btn.is-active {
  background: var(--accent);
  color: #fff;
}

.mode-switch--direction {
  background: rgba(11, 110, 79, 0.12);
}

.mode-switch--direction .mode-switch__btn[data-mode="ida"] {
  color: var(--accent);
}

.mode-switch--direction .mode-switch__btn[data-mode="volta"] {
  color: var(--accent-2);
}

.mode-switch--direction .mode-switch__btn[data-mode="ida"].is-active {
  background: var(--accent);
  color: #fff;
}

.mode-switch--direction .mode-switch__btn[data-mode="volta"].is-active {
  background: var(--accent-2);
  color: #fff;
}

.journey-panel {
  display: none;
}

.journey-panel.is-active {
  display: block;
}

.direction-summary {
  margin-top: 16px;
}

.direction-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(11, 110, 79, 0.12);
  color: var(--accent);
  font-weight: 600;
  font-size: 13px;
}

.selector-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 24px;
}

.line-card {
  background: var(--surface);
  border-radius: 18px;
  padding: 16px 20px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 16px;
  box-shadow: 0 12px 26px var(--shadow);
  border: 1px solid transparent;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.line-card:hover {
  transform: translateY(-2px);
  border-color: rgba(28, 24, 17, 0.12);
}

.line-card__chip {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: 16px;
}

.line-card__info h3 {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 600;
}

.line-card__info p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.empty {
  grid-column: 1 / -1;
  background: var(--surface);
  border-radius: 18px;
  padding: 28px;
  box-shadow: 0 12px 24px var(--shadow);
  text-align: center;
}

.chip--blue { background: #1d4ed8; }
.chip--pink { background: #ec4899; }
.chip--orange { background: #f97316; }
.chip--green { background: #22c55e; }
.chip--red { background: #ef4444; }
.chip--cyan { background: #06b6d4; }
.chip--purple { background: #8b5cf6; }
.chip--lime { background: #84cc16; }
.chip--amber { background: #f59e0b; }
.chip--lavender { background: #a78bfa; }
.chip--teal { background: #14b8a6; }
.chip--graphite { background: #1f2937; }

.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.choice-card {
  background: var(--bg-strong);
  border-radius: 18px;
  padding: 20px;
  border: 1px solid rgba(30, 27, 22, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.choice-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px var(--shadow);
}

.choice-card__tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  margin-bottom: 10px;
}

.choice-card__tag--alt {
  background: var(--accent-2);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip-button {
  border: 1px solid rgba(30, 27, 22, 0.18);
  background: var(--bg-strong);
  color: var(--ink);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.chip-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px var(--shadow);
}

.chip-button.is-active {
  background: var(--accent);
  color: #fff;
  border-color: rgba(11, 110, 79, 0.4);
}

.stop-panel {
  margin-top: 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
  gap: 20px;
  align-items: stretch;
}

.stop-info h3 {
  margin-top: 0;
}

.stop-time {
  font-weight: 600;
  margin-top: 10px;
}

.stop-map {
  height: 260px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(30, 27, 22, 0.08);
}

.stop-meta {
  margin-top: 12px;
  display: flex;
  gap: 16px;
  color: var(--muted);
  flex-wrap: wrap;
}

.card--lines {
  margin-top: 24px;
}

.trip-page .card + .card {
  margin-top: 24px;
}

.trip-form {
  display: grid;
  gap: 14px;
  margin-top: 8px;
}

.trip-label {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.trip-select {
  width: 100%;
  max-width: 100%;
  display: block;
  box-sizing: border-box;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(30, 27, 22, 0.12);
  background: #fff;
  font-family: inherit;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) calc(50% - 3px),
    calc(100% - 14px) calc(50% - 3px);
  background-size: 6px 6px;
  background-repeat: no-repeat;
  padding-right: 40px;
  box-shadow: 0 8px 20px rgba(28, 24, 17, 0.06);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.trip-select:focus {
  outline: none;
  border-color: rgba(11, 110, 79, 0.6);
  box-shadow: 0 0 0 3px rgba(11, 110, 79, 0.15);
}

.trip-submit {
  justify-self: flex-start;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600;
  border: 1px solid rgba(11, 110, 79, 0.4);
  background-color: rgba(11, 110, 79, 0.08);
  background-image: linear-gradient(var(--accent), var(--accent));
  background-repeat: no-repeat;
  background-size: 0% 100%;
  background-position: left center;
  color: var(--accent);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, color 0.2s ease,
    background-size 0.2s ease;
}

.trip-submit:hover {
  transform: translateY(-2px);
  background-size: 100% 100%;
  color: #fff;
  box-shadow: 0 14px 30px var(--shadow);
}

.planner-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-top: 8px;
}

.planner-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.planner-label {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.planner-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(30, 27, 22, 0.12);
  background: #fff;
  font-family: inherit;
  font-size: 16px;
  box-shadow: 0 8px 20px rgba(28, 24, 17, 0.06);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.planner-input:focus {
  outline: none;
  border-color: rgba(11, 110, 79, 0.6);
  box-shadow: 0 0 0 3px rgba(11, 110, 79, 0.15);
}

.planner-button {
  justify-self: flex-start;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600;
  border: 1px solid rgba(11, 110, 79, 0.4);
  background-color: rgba(11, 110, 79, 0.08);
  background-image: linear-gradient(var(--accent), var(--accent));
  background-repeat: no-repeat;
  background-size: 0% 100%;
  background-position: left center;
  color: var(--accent);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, color 0.2s ease,
    background-size 0.2s ease;
}

.planner-button:hover {
  transform: translateY(-2px);
  background-size: 100% 100%;
  color: #fff;
  box-shadow: 0 14px 30px var(--shadow);
}

.swap-button-wrapper {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 4px 0;
}

.swap-button {
  background-color: rgba(11, 110, 79, 0.08);
  border: 1px solid rgba(30, 27, 22, 0.2);
  border-radius: 50%;
  width: 42px;
  height: 42px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.swap-button:hover {
  transform: rotate(180deg);
  background-color: rgba(11, 110, 79, 0.18);
}

.swap-button svg {
  width: 22px;
  height: 22px;
  fill: var(--accent);
}

.autocomplete-container {
  position: relative;
}

.suggestions-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid rgba(30, 27, 22, 0.12);
  border-radius: 12px;
  z-index: 10;
  max-height: 220px;
  overflow-y: auto;
  box-shadow: 0 10px 24px rgba(28, 24, 17, 0.12);
}

.suggestion-item {
  padding: 10px 12px;
  cursor: pointer;
}

.suggestion-item:hover {
  background-color: rgba(11, 110, 79, 0.08);
}

.suggestions-list.hidden {
  display: none;
}

.results-container {
  margin-top: 26px;
  width: 100%;
}

.results-title {
  margin: 0 0 16px;
  font-size: 18px;
}

.route-card {
  background: var(--bg-strong);
  border-radius: 16px;
  padding: 16px;
  border: 1px solid rgba(30, 27, 22, 0.08);
  border-left: 4px solid var(--accent);
  margin-bottom: 16px;
  width: 100%;
}

.route-card--error {
  border-left-color: #b42318;
  background: rgba(180, 35, 24, 0.08);
}

.route-type {
  font-weight: 700;
  display: inline-block;
  margin-bottom: 12px;
}

.route-step {
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(30, 27, 22, 0.08);
}

.route-step:last-child {
  padding-bottom: 0;
  margin-bottom: 0;
  border-bottom: none;
}

.route-transfer {
  font-weight: 700;
  text-align: center;
  color: #b42318;
  margin: 8px 0;
}

.line-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.line-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  color: #fff;
  background: #555;
}

.line-chip small {
  font-size: 11px;
  font-weight: 500;
  opacity: 0.9;
}

.line-chip.line-0 { background-color: #555; }
.line-chip.line-1 { background-color: #2f49ca; }
.line-chip.line-2 { background-color: #f29cc1; color: #1e1b16; }
.line-chip.line-3 { background-color: #f6a34c; color: #1e1b16; }
.line-chip.line-4 { background-color: #3eb909; color: #1e1b16; }
.line-chip.line-5 { background-color: #ff0000; }
.line-chip.line-6 { background-color: #72caf0; color: #1e1b16; }
.line-chip.line-7 { background-color: #228b22; }
.line-chip.line-8 { background-color: #840154; }
.line-chip.line-9 { background-color: #d9d32f; color: #1e1b16; }
.line-chip.line-10 { background-color: #bebefe; color: #1e1b16; }
.line-chip.line-11 { background-color: #ab2986; }
.line-chip.line-12 { background-color: #e9c6ac; color: #1e1b16; }
.line-chip.line-13 { background-color: #ffdd00; color: #1e1b16; }
.line-chip.line-14 { background-color: #1695a2; }
.line-chip.line-15 { background-color: #a01d1b; }
.line-chip.line-16 { background-color: #1d1d1c; }

.trip-error {
  color: #b42318;
  margin-top: 12px;
}

.card--results {
  margin-top: 24px;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

.result-card {
  background: var(--bg-strong);
  border-radius: 16px;
  padding: 16px;
  border: 1px solid rgba(30, 27, 22, 0.08);
}

.result-card h3 {
  margin-top: 0;
  margin-bottom: 6px;
}

.result-link {
  display: inline-flex;
  margin-top: 8px;
  font-weight: 600;
  color: var(--accent);
}

.nearby-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.nearby-status {
  color: var(--muted);
  font-size: 14px;
}

.nearby-list {
  margin-top: 18px;
  display: grid;
  gap: 12px;
}

.nearby-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--bg-strong);
  border-radius: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(30, 27, 22, 0.08);
}

.nearby-distance {
  font-weight: 600;
  color: var(--accent);
}

.line-info {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(30, 27, 22, 0.08);
}

.line-info h3 {
  margin: 0 0 6px;
}

.line-info__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.line-info__link {
  margin-left: auto;
  align-self: center;
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 600;
  border: 1px solid rgba(11, 110, 79, 0.4);
  background-color: rgba(11, 110, 79, 0.08);
  background-image: linear-gradient(var(--accent), var(--accent));
  background-repeat: no-repeat;
  background-size: 0% 100%;
  background-position: left center;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, color 0.2s ease,
    background-size 0.2s ease;
}

.line-info__link[aria-disabled="true"] {
  opacity: 0.6;
  pointer-events: none;
}

.line-info__link:hover {
  transform: translateY(-2px);
  background-size: 100% 100%;
  color: #fff;
  box-shadow: 0 14px 30px var(--shadow);
}

.line-info__arrow {
  font-size: 16px;
  line-height: 1;
  transition: transform 0.2s ease;
}

.line-info__link:hover .line-info__arrow {
  transform: translateX(2px);
}

.thermo {
  list-style: none;
  margin: 0;
  padding: 0 0 0 20px;
  position: relative;
}

.thermo::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: rgba(30, 27, 22, 0.2);
}

.thermo__stop {
  position: relative;
  padding: 0 0 18px 10px;
}

.thermo__stop::before {
  content: "";
  position: absolute;
  left: -18px;
  top: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(11, 110, 79, 0.16);
}

.thermo__stop:last-child {
  padding-bottom: 0;
}

.thermo__stop:last-child::before {
  background: var(--accent-2);
  box-shadow: 0 0 0 4px rgba(247, 111, 81, 0.2);
}

.thermo__label {
  display: block;
}

@media (max-width: 900px) {
  .topbar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 16px 6vw 6px;
    justify-items: stretch;
  }

  .back {
    position: static;
    width: 100%;
    padding: 8px 12px;
    font-size: 14px;
    text-align: center;
  }

  .home {
    position: static;
    width: 100%;
    padding: 8px 12px;
    font-size: 14px;
    text-align: center;
  }

  .title {
    grid-column: 1 / -1;
    margin-top: 6px;
  }

  .choice-grid {
    grid-template-columns: 1fr;
  }

  .stop-panel {
    grid-template-columns: 1fr;
  }

  .stop-map {
    height: 220px;
  }

  .planner-button {
    justify-self: stretch;
  }

  .selector-list {
    grid-template-columns: 1fr;
  }
}
