/* ── Page shell ─────────────────────────────────────────── */
#tf-root .tf-shell {
  min-height: 100vh;
  padding: 0 16px 28px;
  position: relative;
}

#tf-root .tf-container {
  max-width: 800px;
  margin: 0 auto;
}

#tf-root .tf-page-title {
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--tf-text);
  letter-spacing: -0.03em;
  margin-bottom: 4px;
}

#tf-root .tf-page-sub {
  font-size: 0.9rem;
  color: var(--tf-text-muted);
  margin-bottom: 28px;
}

/* ── Step indicator ─────────────────────────────────────── */
#tf-root .tf-steps {
  display: flex;
  align-items: flex-start;
  margin-bottom: 28px;
  padding: 16px 0;
}

#tf-root .tf-step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

#tf-root .tf-step-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  padding: 0;
  cursor: default;
  outline: none;
}

#tf-root .tf-step-btn.clickable {
  cursor: pointer;
}

#tf-root .tf-step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  font-weight: 700;
  flex-shrink: 0;
  border: 2px solid #b8c5d6;
  background: var(--tf-white);
  color: #64748b;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}

#tf-root .tf-step-num.active {
  background: var(--tf-primary);
  border-color: var(--tf-primary);
  color: var(--tf-white);
  box-shadow: 0 0 0 4px rgba(30, 106, 181, 0.15);
}

#tf-root .tf-step-num.done {
  background: var(--tf-primary);
  border-color: var(--tf-primary);
  color: var(--tf-white);
}

#tf-root .tf-step-label {
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--tf-text-muted);
  text-align: center;
  white-space: nowrap;
}

#tf-root .tf-step-label.active {
  color: var(--tf-primary);
  font-weight: 700;
}

#tf-root .tf-step-label.done {
  color: var(--tf-primary);
  font-weight: 600;
}

#tf-root .tf-step-connector {
  flex: 1;
  height: 2px;
  margin-top: 15px;
  background: var(--tf-border);
  border-radius: 1px;
  transition: background 0.3s ease;
}

#tf-root .tf-step-connector.done {
  background: linear-gradient(90deg, #003478, #00449e);
}

/* ── Main 2-col layout ──────────────────────────────────── */
#tf-root .tf-body {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

#tf-root .tf-main {
  flex: 3 1 0;
  min-width: 0;
}

#tf-root .tf-sidebar {
  flex: 2 1 0;
  min-width: 0;
}

/* ── Desktop: sidebar sticky, form scrolls with page ────── */
@media (min-width: 641px) {
  #tf-root .tf-sidebar {
    position: sticky;
    top: 64px;
    /* below sticky steps bar */
    max-height: calc(100vh - 72px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--tf-border) transparent;
  }

  #tf-root .tf-sidebar::-webkit-scrollbar {
    width: 4px;
  }

  #tf-root .tf-sidebar::-webkit-scrollbar-track {
    background: transparent;
  }

  #tf-root .tf-sidebar::-webkit-scrollbar-thumb {
    background: var(--tf-border);
    border-radius: 2px;
  }
}

@media (max-width: 640px) {
  #tf-root .tf-body {
    flex-direction: column;
  }

  #tf-root .tf-sidebar {
    display: none;
  }
}

/* ── Form card (steps 1+2) ──────────────────────────────── */
#tf-root .tf-form-card {
  background: #F8F8F6;
  border: 1px solid var(--tf-border);
  border-radius: 10px;
  padding: 20px;
  box-shadow: var(--tf-shadow-card);
}

/* ── Form card header ───────────────────────────────────── */
#tf-root .tf-form-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--tf-border);
}

#tf-root .tf-form-header-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--tf-primary-light) 0%, #dceffe 100%);
  border: 1px solid var(--tf-primary-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(30, 106, 181, 0.12);
}

#tf-root .tf-form-header-center {
  flex: 1;
  text-align: left;
  min-width: 0;
}

#tf-root .tf-form-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--tf-text);
  letter-spacing: -0.01em;
}

#tf-root .tf-form-header-sub {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--tf-primary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 2px;
  opacity: 0.7;
}

#tf-root .tf-next-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--tf-primary-light);
  border: 1px solid var(--tf-primary-border);
  border-radius: 20px;
  padding: 5px 11px;
  color: var(--tf-primary);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}

#tf-root .tf-next-btn:hover {
  background: #d6e8f5;
  box-shadow: 0 2px 8px rgba(30, 106, 181, 0.15);
}

#tf-root .tf-back-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: 1px solid var(--tf-border);
  border-radius: 20px;
  padding: 5px 11px;
  color: var(--tf-text-secondary);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  width: 100px;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}

#tf-root .tf-back-btn:hover {
  background: var(--tf-bg);
  border-color: var(--tf-border-hover);
}

/* ── Card 2 header ───────────────────────────────────────── */
#tf-root .tf-form-header-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}

#tf-root .tf-form-header-icon-center {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(30, 106, 181, 0.08);
  margin: 0 auto;
}

#tf-root .tf-form-header-next {
  display: flex;
  justify-content: flex-end;
}

#tf-root .tf-form-title-centered {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--tf-text);
  text-align: center;
  margin-bottom: 12px;
}

#tf-root .tf-divider-line {
  border: none;
  border-top: 1px solid var(--tf-border);
}

/* ── Grid helpers ───────────────────────────────────────── */
#tf-root .tf-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--tf-gap);
}

#tf-root .tf-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--tf-gap);
}

#tf-root .tf-grid-4 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 12px;
}

#tf-root .tf-stack {
  display: flex;
  flex-direction: column;
  gap: var(--tf-gap);
}

#tf-root .tf-stack-lg {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

#tf-root .tf-max-xs {
  max-width: 220px;
}

@media (max-width: 480px) {

  #tf-root .tf-grid-2,
  #tf-root .tf-grid-3 {
    grid-template-columns: 1fr;
  }

  #tf-root .tf-grid-4 {
    grid-template-columns: 1fr 1fr;
  }
}

/* ── Step 3 ─────────────────────────────────────────────── */
#tf-root .tf-step3-wrap {
  max-width: 700px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

#tf-root .tf-step3-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

#tf-root .tf-step3-badge {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--tf-primary), #4d94d6);
  color: var(--tf-white);
  font-size: 0.875rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

#tf-root .tf-section-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

#tf-root .tf-section-card-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--tf-primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

#tf-root .tf-review-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 24px;
}

#tf-root .tf-step3-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
}

/* ── Field rows ─────────────────────────────────────────── */
#tf-root .tf-row { display: grid; gap: 14px; margin-bottom: 14px; }
#tf-root .tf-row-2 { grid-template-columns: 1fr 1fr; }
#tf-root .tf-row-3 { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 560px) {
  #tf-root .tf-row-2,
  #tf-root .tf-row-3 { grid-template-columns: 1fr; }
  #tf-root .tf-travelers-grid-2col { grid-template-columns: 1fr; }
}

/* ── Field group ────────────────────────────────────────── */
#tf-root .tf-field-group { display: flex; flex-direction: column; margin-bottom: 14px; }
#tf-root .tf-row .tf-field-group { margin-bottom: 0; }

/* ── Card title ─────────────────────────────────────────── */
#tf-root .tf-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--tf-text);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--tf-border);
}

/* ── Form actions ───────────────────────────────────────── */
#tf-root .tf-form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--tf-border);
}
#tf-root .tf-form-actions:has(> :only-child) { justify-content: center; }

/* ── Toggle row (form-level, distinct from .tf-toggle-group) */
#tf-root .tf-toggle-row {
  display: flex;
  border: 1.5px solid var(--tf-border);
  border-radius: var(--tf-radius-md);
  overflow: hidden;
  max-width: 320px;
}
#tf-root .tf-toggle-row.tf-toggle-3 { max-width: none; }
/* templates use .selected (not .active) for the chosen state */
#tf-root .tf-toggle-btn.selected {
  background: linear-gradient(135deg, #00449e 0%, #003478 100%);
  color: #fff;
  font-weight: 600;
}
#tf-root .tf-toggle-btn:hover:not(.selected):not(.active) {
  background: var(--tf-bg-disabled);
  color: var(--tf-text-secondary);
}

/* ── Select wrap (suppresses native chevron, shows lucide) ─ */
#tf-root .tf-select-wrap { position: relative; }
#tf-root .tf-select-wrap .tf-select {
  background-image: none;
  padding-right: 36px;
  appearance: none;
  -webkit-appearance: none;
}
#tf-root .tf-select-icon {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  stroke: #9ca3af;
  fill: none;
  pointer-events: none;
}

/* ── Input wrap (calendar / search icon) ───────────────── */
#tf-root .tf-input-wrap { position: relative; }
#tf-root .tf-input-wrap .tf-input-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  stroke: #6b7280;
  fill: none;
  pointer-events: none;
  z-index: 1;
}
#tf-root .tf-input-wrap input,
#tf-root .tf-input-wrap .flatpickr-input { padding-right: 40px; width: 100%; }