/* =========================================================
   Plan Your Himalayan Trip — private itinerary builder
   Uses the design tokens from style.css
   ========================================================= */

.tb-main { background: var(--color-surface-muted); padding-bottom: 72px; }
/* .btn and the card styles set display, which would otherwise beat [hidden] */
.tb-shell [hidden] { display: none !important; }

.tb-intro {
  padding-top: clamp(40px, 6vw, 72px);
  padding-bottom: 28px;
  max-width: 820px;
  text-align: center;
}
.tb-kicker {
  display: inline-block;
  background: var(--color-black);
  color: var(--color-accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  margin-bottom: 18px;
}
.tb-intro h1 { font-size: clamp(32px, 5vw, 56px); margin-bottom: 14px; }
.tb-dot { color: var(--color-accent-dark); }
.tb-intro p { color: var(--color-text-muted); font-size: clamp(15px, 1.6vw, 18px); }

.tb-shell {
  max-width: 920px;
  background: #fff;
  border: 1px solid #e6e6df;
  border-radius: 24px;
  box-shadow: var(--shadow-card);
  padding: clamp(20px, 4vw, 40px);
}

/* ---------- Progress ---------- */
.tb-progress {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin: 0 0 32px;
  padding: 0;
  list-style: none;
  counter-reset: tbstep;
}
.tb-progress li {
  counter-increment: tbstep;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
  padding-top: 12px;
  border-top: 4px solid #e6e6df;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.tb-progress li::before { content: counter(tbstep) ". "; }
.tb-progress li.is-done { border-color: var(--color-black); color: var(--color-text); cursor: pointer; }
.tb-progress li.is-active { border-color: var(--color-accent-dark); color: var(--color-text); }
@media (max-width: 640px) {
  .tb-progress li { font-size: 0; padding-top: 0; }
  .tb-progress li::before { content: none; }
  .tb-progress li.is-active { font-size: 13px; padding-top: 10px; grid-column: span 1; white-space: nowrap; }
}

/* ---------- Steps & fields ---------- */
.tb-step h2 { font-size: clamp(22px, 3vw, 30px); margin-bottom: 8px; }
.tb-help { color: var(--color-text-muted); font-size: 14px; margin-bottom: 22px; }
.tb-step > h2 + .tb-row,
.tb-step > h2 + .tb-field { margin-top: 22px; }

.tb-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 640px) { .tb-row { grid-template-columns: 1fr; gap: 0; } }

.tb-field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 22px; }
.tb-field > label,
.tb-label { font-weight: 600; font-size: 14px; }
.tb-field small { color: var(--color-text-muted); font-weight: 500; }

.tb-input {
  width: 100%;
  font: inherit;
  font-size: 15px;
  color: var(--color-text);
  background: #fff;
  border: 1.5px solid #d9d9d0;
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.tb-input:focus { outline: none; border-color: var(--color-black); box-shadow: 0 0 0 3px rgba(214, 255, 63, 0.6); }
textarea.tb-input { resize: vertical; min-height: 44px; }

.tb-check { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; cursor: pointer; }
.tb-check input { width: 18px; height: 18px; accent-color: var(--color-black); }

.tb-range { width: 100%; accent-color: var(--color-black); height: 28px; }
.tb-range-scale { display: flex; justify-content: space-between; font-size: 12px; color: var(--color-text-muted); margin-top: -4px; }

.tb-stepper {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid #d9d9d0;
  border-radius: var(--radius-pill);
  width: max-content;
  overflow: hidden;
}
.tb-stepper button {
  width: 46px;
  height: 44px;
  border: 0;
  background: transparent;
  font-size: 22px;
  line-height: 1;
}
.tb-stepper button:hover { background: var(--color-surface-muted); }
.tb-stepper output { min-width: 36px; text-align: center; font-weight: 700; font-size: 17px; }

/* ---------- Region cards ---------- */
.tb-region-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
@media (max-width: 480px) { .tb-region-grid { grid-template-columns: 1fr 1fr; gap: 10px; } }
.tb-region {
  position: relative;
  aspect-ratio: 4 / 3;
  border: 3px solid transparent;
  border-radius: var(--radius-card);
  padding: 0;
  overflow: hidden;
  background: var(--color-black);
  color: #fff;
  text-align: left;
  transition: transform 0.18s ease, border-color 0.18s ease;
}
.tb-region:hover { transform: translateY(-2px); }
.tb-region img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.85; transition: opacity 0.2s ease; }
.tb-region::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0, 0, 0, 0.78), rgba(0, 0, 0, 0.05) 65%); }
.tb-region-text { position: absolute; left: 14px; right: 14px; bottom: 12px; z-index: 1; display: flex; flex-direction: column; gap: 2px; }
.tb-region-text strong { font-size: 18px; }
.tb-region-text small { font-size: 12px; opacity: 0.9; line-height: 1.3; }
@media (max-width: 480px) { .tb-region-text small { display: none; } .tb-region-text strong { font-size: 15px; } }
.tb-region-tick {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.25);
  color: transparent;
  border: 2px solid #fff;
}
.tb-region.is-selected { border-color: var(--color-accent); }
.tb-region.is-selected img { opacity: 1; }
.tb-region.is-selected .tb-region-tick { background: var(--color-accent); color: var(--color-black); border-color: var(--color-accent); }

/* ---------- Chips & option cards ---------- */
.tb-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.tb-chip {
  border: 1.5px solid #d9d9d0;
  background: #fff;
  border-radius: var(--radius-pill);
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
}
.tb-chip:hover { border-color: var(--color-black); }
.tb-chip.is-selected { background: var(--color-black); border-color: var(--color-black); color: #fff; }

.tb-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 10px; }
@media (max-width: 480px) { .tb-options { grid-template-columns: 1fr 1fr; } }
.tb-option {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
  border: 1.5px solid #d9d9d0;
  background: #fff;
  border-radius: 14px;
  padding: 14px;
  color: var(--color-text);
}
.tb-option strong { font-size: 15px; }
.tb-option small { font-size: 12px; color: var(--color-text-muted); line-height: 1.35; }
.tb-option:hover { border-color: var(--color-black); }
.tb-option.is-selected { border-color: var(--color-black); background: var(--color-accent); box-shadow: inset 0 0 0 1px var(--color-black); }
.tb-option.is-selected small { color: var(--color-text); }

/* ---------- Warnings ---------- */
.tb-warnings { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 20px; }
.tb-warnings:empty { display: none; }
.tb-warning {
  background: #fff8e1;
  border: 1px solid #f1d27a;
  border-left: 4px solid #e0a800;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 14px;
  line-height: 1.45;
}

/* ---------- Day builder ---------- */
.tb-starters { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 20px; }
@media (max-width: 720px) { .tb-starters { grid-template-columns: 1fr; } }
.tb-starter {
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-align: left;
  background: var(--color-surface-muted);
  border: 1.5px dashed #c9c9bf;
  border-radius: 14px;
  padding: 14px;
  color: var(--color-text);
  font-size: 14px;
}
button.tb-starter:hover { border-style: solid; border-color: var(--color-black); }
.tb-starter span { font-size: 12px; color: var(--color-text-muted); }
.tb-starter label { display: flex; flex-direction: column; gap: 3px; }
.tb-starter-select .tb-input { margin-top: 8px; padding: 8px 10px; font-size: 14px; }

.tb-days { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.tb-days-empty { color: var(--color-text-muted); font-size: 14px; padding: 18px; text-align: center; border: 1.5px dashed #d9d9d0; border-radius: 14px; }
.tb-day { border: 1.5px solid #e2e2d9; border-radius: 16px; background: #fff; overflow: hidden; }
.tb-day-head { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--color-surface-muted); border-bottom: 1px solid #e9e9e1; }
.tb-day-num { display: flex; flex-direction: column; font-weight: 800; font-size: 14px; min-width: 64px; line-height: 1.2; }
.tb-day-num small { font-weight: 500; font-size: 11px; color: var(--color-text-muted); }
.tb-day-title {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-weight: 700;
  font-size: 15px;
  border: 0;
  border-bottom: 1.5px dashed transparent;
  background: transparent;
  padding: 6px 2px;
  color: var(--color-text);
}
.tb-day-title::placeholder { color: var(--color-text); opacity: 0.85; }
.tb-day-title:hover, .tb-day-title:focus { outline: none; border-bottom-color: var(--color-black); }
.tb-day-actions { display: flex; gap: 4px; }
.tb-day-actions button {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid #d9d9d0;
  background: #fff;
  font-size: 14px;
  color: var(--color-text);
}
.tb-day-actions button:hover:not(:disabled) { border-color: var(--color-black); }
.tb-day-actions button:disabled { opacity: 0.35; cursor: default; }
.tb-day-body { display: grid; grid-template-columns: 1fr 2fr; gap: 12px; padding: 12px; }
@media (max-width: 640px) {
  .tb-day-body { grid-template-columns: 1fr; }
  .tb-day-head { flex-wrap: wrap; }
  .tb-day-title { order: 3; flex-basis: 100%; }
  .tb-day-actions { margin-left: auto; }
}
.tb-mini { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 600; color: var(--color-text-muted); }
.tb-mini .tb-input { padding: 9px 12px; font-size: 14px; }
.tb-mini-wide { grid-column: 1 / -1; }
.tb-stops {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-height: 42px;
  border: 1.5px solid #d9d9d0;
  border-radius: var(--radius-sm);
  padding: 5px 8px;
  background: #fff;
}
.tb-stops:focus-within { border-color: var(--color-black); box-shadow: 0 0 0 3px rgba(214, 255, 63, 0.6); }
.tb-stop {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--color-accent);
  color: var(--color-black);
  border-radius: var(--radius-pill);
  padding: 4px 6px 4px 11px;
  font-size: 13px;
  font-weight: 600;
}
.tb-stop button { border: 0; background: transparent; font-size: 16px; line-height: 1; padding: 0 4px; color: inherit; }
.tb-stop-input { flex: 1; min-width: 160px; border: 0; font: inherit; font-size: 14px; padding: 6px 4px; background: transparent; color: var(--color-text); }
.tb-stop-input:focus { outline: none; }
.tb-add-day { margin-bottom: 8px; }

/* ---------- Review ---------- */
.tb-summary { margin: 0 0 18px; border: 1.5px solid #e2e2d9; border-radius: 16px; overflow: hidden; }
.tb-summary > div { display: grid; grid-template-columns: 110px 1fr auto; gap: 12px; align-items: baseline; padding: 12px 16px; border-bottom: 1px solid #eeeee7; }
.tb-summary > div:last-child { border-bottom: 0; }
.tb-summary dt { font-weight: 700; font-size: 13px; color: var(--color-text-muted); }
.tb-summary dd { margin: 0; font-size: 15px; }
@media (max-width: 560px) {
  .tb-summary > div { grid-template-columns: 1fr auto; }
  .tb-summary dd { grid-column: 1 / -1; grid-row: 2; }
}
.tb-link { background: none; border: 0; padding: 0; font: inherit; font-size: 13px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; color: var(--color-text); }

.tb-timeline-head { display: flex; align-items: baseline; justify-content: space-between; margin: 8px 0 12px; }
.tb-timeline-head h3 { font-size: 18px; }
.tb-timeline { list-style: none; margin: 0 0 28px; padding: 0 0 0 22px; border-left: 2px solid var(--color-black); }
.tb-timeline li { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 0 0 18px 6px; font-size: 14px; }
.tb-timeline li::before {
  content: '';
  position: absolute;
  left: -31px;
  top: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--color-accent);
  border: 2px solid var(--color-black);
}
.tb-tl-day { font-size: 12px; font-weight: 700; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.tb-timeline strong { font-size: 16px; }
.tb-timeline em { color: var(--color-text-muted); font-style: normal; }
.tb-tl-sleep { font-size: 12px; color: var(--color-text-muted); }

.tb-contact { border-top: 1px solid #e6e6df; padding-top: 24px; }
.tb-contact h3 { font-size: 20px; margin-bottom: 18px; }
.tb-callback {
  background: var(--color-black);
  color: #fff;
  border-radius: 14px;
  padding: 14px 16px;
  font-weight: 600;
  font-size: 15px;
}
.tb-callback::before { content: '📞 '; }
.tb-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Nav & errors ---------- */
.tb-error {
  margin-top: 18px;
  color: var(--color-danger);
  font-weight: 600;
  font-size: 14px;
}
.tb-error a { text-decoration: underline; }
.tb-nav { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; padding-top: 20px; border-top: 1px solid #eeeee7; }
.tb-nav #tbBack { margin-right: auto; }
@media (max-width: 480px) {
  .tb-nav .btn { flex: 1; padding-inline: 14px; }
  .tb-nav #tbBack { flex: 0 0 auto; }
}

/* ---------- Done ---------- */
.tb-done { text-align: center; padding: 20px 0; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.tb-done[hidden] { display: none; }
.tb-done-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 30px;
  font-weight: 800;
  background: var(--color-accent);
  border: 2px solid var(--color-black);
}
.tb-done h2 { font-size: clamp(26px, 4vw, 36px); }
.tb-done-lead { font-size: 18px; font-weight: 600; max-width: 520px; }
.tb-done-ref { color: var(--color-text-muted); font-size: 14px; }
.tb-done .tb-help { max-width: 420px; margin: 0; }
.tb-wa-btn { background: var(--color-whatsapp); border-color: var(--color-whatsapp); color: #fff; }
