:root {
  --tq-bg: #ffffff;
  --tq-surface: #f0f7ff;
  --tq-ink: #1d1b19;
  --tq-muted: #6f6760;
  --tq-accent: #002B72;
  --tq-accent-dark: #001A45;
  --tq-line: #dbeafe;
}

/* ── Wrapper ─────────────────────────────────────────────── */
.tembase-quote {
  border: 1px solid #dbeafe;
  padding: 40px !important;
  border-radius: 24px !important;
  background: linear-gradient(180deg, #ffffff 0%, #f4f8fc 100%);
  box-shadow: 0 10px 30px rgba(29, 27, 25, 0.08);
  color: var(--tq-ink);
}
.tembase-quote h3 {
  font-size: 18px;
  margin: 6px 0 10px;
}
.tembase-quote h2.tembase-quote__main-title {
  font-size: 32px !important;
  font-weight: 700 !important;
  color: var(--tq-accent) !important;
  margin: 0 0 20px 0 !important;
  text-align: start !important;
  text-transform: uppercase !important;
}
.tembase-quote__form {
  display: grid;
  gap: 10px;
}
.tembase-quote__form .tembase-quote__btn {
  width: 100%;
}

/* ── Item list ───────────────────────────────────────────── */
.tembase-quote__list {
  display: flex;
  flex-direction: column;
  gap: 28px;
  margin: 12px 0 24px;
}
.tembase-quote__group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tembase-quote__group-title {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  color: var(--tq-accent);
  background: var(--tq-surface);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 12px;
  padding: 6px 14px;
  border-radius: 6px;
  border-left: 3px solid var(--tq-accent);
}
.tembase-quote__group-items {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

/* ── Fields (name / phone / email) ──────────────────────── */
.tembase-quote__fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 6px;
}
.tembase-quote__field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  color: var(--tq-muted);
}
.tembase-quote__required {
  color: #ef4444;
  margin-left: 2px;
}
.tembase-quote__field input {
  /* font-size >= 16px prevents iOS auto-zoom on focus */
  font-size: 16px !important;
  padding: 12px 16px !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 99px !important;
  background: #f8fafc !important;
  color: var(--tq-ink) !important;
  transition: box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  box-shadow: none !important;
  /* Better tap target */
  min-height: 48px;
  -webkit-appearance: none;
  appearance: none;
}
.tembase-quote__field input:focus {
  outline: none !important;
  background: #fff !important;
  border-color: var(--tq-accent) !important;
  box-shadow: 0 0 0 3px rgba(27, 92, 185, 0.15) !important;
}
.tembase-quote__field input.is-invalid {
  border-color: #ef4444 !important;
  background: #fef2f2 !important;
}
.tembase-quote__field input.is-invalid:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2) !important;
}

/* ── Package type selector ───────────────────────────────── */
.tembase-quote__type {
  margin: 2px 0 6px;
  padding: 12px;
  border: 1px dashed var(--tq-line);
  border-radius: 12px;
  background: var(--tq-surface);
  transition: all 0.3s ease;
}
@keyframes tq-pulse-border {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}
.tembase-quote__type.tq-needs-selection {
  animation: tq-pulse-border 2s infinite;
  border-style: dashed !important;
  border-color: #ef4444 !important;
  background: #fef2f2 !important;
}
.tembase-quote__type-title {
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--tq-ink);
  line-height: 1.4;
}
.tembase-quote__type-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tembase-quote__type-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--tq-line);
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
  font-size: 14px;
  /* Good tap target on mobile */
  min-height: 40px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.tembase-quote__type-btn:hover {
  border-color: #d9cfc4;
}
.tembase-quote__type-btn.active {
  background: var(--tq-accent);
  color: #fff;
  border-color: var(--tq-accent);
}
.tembase-quote__type-note {
  font-size: 12px;
  color: var(--tq-muted);
  margin-top: 8px;
}

/* ── Group Title ─────────────────────────────────────────── */
.tembase-quote h4.tembase-quote__group-title {
  font-size: 15px !important;
  font-weight: 700 !important;
  color: var(--tq-accent) !important;
  margin: 16px 0 24px 0 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  text-align: left !important;
}

/* ── Checklist items ─────────────────────────────────────── */
.tembase-quote__item {
  display: flex;
  gap: 10px;
  align-items: center;
  background: #fff;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--tq-line);
  position: relative;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  min-height: 48px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.tembase-quote__item:hover {
  border-color: #d9cfc4;
  box-shadow: 0 6px 16px rgba(29, 27, 25, 0.08);
}
.tembase-quote__item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  accent-color: var(--tq-accent);
  cursor: pointer;
}
.tembase-quote__item-text {
  flex-grow: 1;
  font-size: 14px;
  line-height: 1.4;
}

/* ── Tooltip / Detail Modal Button ───────────────────────── */
.tembase-quote__detail-btn {
  font-size: 13px;
  color: var(--tq-accent);
  background: #f0f6fc;
  padding: 4px 12px;
  border-radius: 99px;
  cursor: pointer;
  margin-left: auto;
  font-weight: 600;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
  z-index: 2;
  border: 1px solid transparent;
}
.tembase-quote__detail-btn:hover {
  background: var(--tq-accent);
  color: #fff;
}

/* ── Submit button ───────────────────────────────────────── */
.tembase-quote__btn {
  background: var(--tq-accent) !important;
  color: #fff !important;
  border: none !important;
  padding: 16px 20px !important;
  border-radius: 99px !important;
  cursor: pointer;
  font-weight: 700 !important;
  font-size: 16px !important;
  letter-spacing: 0.5px !important;
  box-shadow: 0 8px 20px rgba(27, 92, 185, 0.3) !important;
  transition: all 0.2s ease;
  text-transform: uppercase !important;
  width: 100% !important;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.tembase-quote__btn:hover { transform: translateY(-2px); box-shadow: 0 12px 24px rgba(27, 92, 185, 0.35); }
.tembase-quote__btn:active { transform: translateY(0); }
.tembase-quote__btn:disabled,
.tembase-quote__btn.is-loading { opacity: 0.7; cursor: not-allowed; transform: none; box-shadow: none; }
.tembase-quote__btn:visited,
.tembase-quote__btn:focus { color: #fff !important; }
.tembase-quote__btn.is-locked {
  background: #10b981 !important;
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3) !important;
}
.tembase-quote__btn.is-locked:hover {
  background: #059669 !important;
  box-shadow: 0 12px 24px rgba(16, 185, 129, 0.35) !important;
}

/* ── Modal ───────────────────────────────────────────────── */
.tembase-quote__modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  /* Safe area for notch phones */
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.tembase-quote__modal-overlay.is-active { opacity: 1; visibility: visible; }
.tembase-quote__modal {
  background: #fff;
  width: 92%;
  max-width: 420px;
  border-radius: 20px;
  padding: 28px 24px;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0,0,0,0.15);
  transform: scale(0.95);
  transition: all 0.3s ease;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.tembase-quote__modal-overlay.is-active .tembase-quote__modal { transform: scale(1); }
.tembase-quote__modal-icon {
  width: 60px; height: 60px;
  background: #f1f5f9; color: var(--tq-accent);
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: bold;
  margin: 0 auto 16px;
}
.tembase-quote__modal-icon.success { background: #dcfce7; color: #16a34a; }
.tembase-quote__modal h3 { margin: 0 0 10px; font-size: 20px; color: #1e293b; }
.tembase-quote__modal p  { margin: 0 0 20px; color: #64748b; font-size: 15px; line-height: 1.5; }
.tembase-quote__modal-actions { display: flex; gap: 10px; }
.tembase-quote__btn-cancel,
.tembase-quote__btn-close {
  flex: 1; padding: 12px; border-radius: 99px !important;
  background: #f1f5f9 !important; color: #475569 !important;
  border: none !important; font-weight: 600; cursor: pointer;
  transition: background 0.2s; min-height: 48px;
}
.tembase-quote__btn-cancel:hover, .tembase-quote__btn-close:hover { background: #e2e8f0 !important; }
.tembase-quote__btn-confirm {
  flex: 1; padding: 12px; border-radius: 99px !important;
  background: var(--tq-accent) !important; color: #fff !important;
  border: none !important; font-weight: 600; cursor: pointer;
  box-shadow: 0 4px 12px rgba(27, 92, 185, 0.2) !important;
  transition: opacity 0.2s; min-height: 48px;
}
.tembase-quote__btn-confirm:hover { opacity: 0.9; }
.tembase-quote__btn-download {
  display: block; width: 100%; padding: 14px; border-radius: 99px !important;
  background: var(--tq-accent) !important; color: #fff !important;
  text-decoration: none !important; font-weight: 600; margin-bottom: 12px;
  box-shadow: 0 4px 12px rgba(27, 92, 185, 0.2) !important;
  min-height: 48px; display: flex; align-items: center; justify-content: center;
}
.tembase-quote__btn-download:hover { opacity: 0.9; }
.tembase-quote__spinner {
  width: 40px; height: 40px; border: 4px solid #f1f5f9;
  border-top-color: var(--tq-accent); border-radius: 50%;
  animation: tq-spin 1s linear infinite;
  margin: 0 auto 16px;
}
@keyframes tq-spin { to { transform: rotate(360deg); } }
.tembase-quote__summary {
  background: #f8fafc; border-radius: 12px;
  padding: 16px; margin-bottom: 20px;
}
.tembase-quote__price { font-size: 22px; font-weight: 700; margin-bottom: 4px; color: var(--tq-ink); }
.tembase-quote__time  { font-weight: 600; color: var(--tq-muted); }

/* ── Contact Buttons ─────────────────────────────────────── */
.tembase-quote__contact-btns {
  display: flex; gap: 10px; margin-bottom: 12px; flex-wrap: wrap;
}
.tembase-quote__btn-zalo,
.tembase-quote__btn-hotline {
  flex: 1;
  display: inline-flex !important; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 16px; border-radius: 99px !important;
  font-weight: 600; font-size: 14px;
  text-decoration: none !important;
  transition: opacity 0.2s, transform 0.2s;
  cursor: pointer; min-height: 48px;
  touch-action: manipulation;
}
.tembase-quote__btn-zalo    { background: #0068ff !important; color: #fff !important; box-shadow: 0 4px 12px rgba(0,104,255,0.25) !important; }
.tembase-quote__btn-hotline { background: #10b981 !important; color: #fff !important; box-shadow: 0 4px 12px rgba(16,185,129,0.25) !important; }
.tembase-quote__btn-zalo:hover,
.tembase-quote__btn-hotline:hover { opacity: 0.88; transform: translateY(-1px); }

/* ════════════════════════════════════════════════════════════
   MOBILE RESPONSIVE  ≤ 640px
   ════════════════════════════════════════════════════════════ */
@media (max-width: 640px) {

  /* Compact padding on mobile */
  .tembase-quote {
    padding: 20px 16px !important;
    border-radius: 16px !important;
  }

  /* Smaller title */
  .tembase-quote h2.tembase-quote__main-title {
    font-size: 32px !important;
    margin-bottom: 14px !important;
    text-align: center !important;
  }

  .tembase-quote__type-title,
  .tembase-quote__type-note {
    text-align: center !important;
  }

  .tembase-quote h3 {
    font-size: 15px;
  }

  /* Stack fields to single column */
  .tembase-quote__fields {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  /* 1-column checklist on small phones */
  .tembase-quote__group-items {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  /* Package type buttons: even full-width on tiny screens */
  .tembase-quote__type {
    padding: 12px 10px;
  }
  .tembase-quote__type-selector {
    gap: 8px;
  }
  .tembase-quote__type-btn {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
    text-align: center;
    font-size: 13px;
    padding: 9px 10px;
  }

  /* Smaller inputs on mobile */
  .tembase-quote__field input {
    padding: 10px 14px !important;
    min-height: 40px !important;
  }

  /* Bigger tap targets for checkboxes */
  .tembase-quote__item {
    padding: 12px 12px;
  }

  /* Modal: full-width on mobile */
  .tembase-quote__modal {
    width: 96%;
    padding: 22px 18px;
    border-radius: 16px;
  }
  .tembase-quote__modal-actions {
    flex-direction: column;
    gap: 8px;
  }
  .tembase-quote__btn-cancel,
  .tembase-quote__btn-confirm {
    width: 100%;
  }

  /* Contact buttons stacked if too narrow */
  .tembase-quote__contact-btns {
    flex-direction: column;
  }

  /* Tooltip: show as fixed popup on mobile */
  .tembase-quote__tooltip-icon:hover::after,
  .tembase-quote__tooltip-icon:focus::after {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    width: auto;
    max-width: none;
    z-index: 99999;
    padding: 16px;
    border-radius: 12px;
    font-size: 14px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
  }
  .tembase-quote__tooltip-icon:hover::before,
  .tembase-quote__tooltip-icon:focus::before {
    display: none;
  }
}

/* Very small phones (≤ 380px) */
@media (max-width: 380px) {
  .tembase-quote__type-btn {
    flex: 1 1 100%;
  }
}
.tembase-quote .tembase-quote__wizard-steps {
  display: flex;
  gap: 6px;
  margin-bottom: 32px;
  justify-content: flex-start;
  align-items: center;
}
.tembase-quote .tq-wizard-step-dot {
  flex: 1;
  max-width: 45px;
  height: 8px;
  border-radius: 4px;
  background: #f1f5f9;
  transition: 0.3s;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
}
.tembase-quote .tq-form-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  background: rgba(248, 250, 252, 0.8); /* Smooth light gray wash without blur */
  cursor: pointer;
  border-radius: 12px;
}

.tembase-quote .tq-wizard-step-dot.active {
  background-color: var(--tq-accent) !important;
  box-shadow: none;
}
.tembase-quote .tq-wizard-panel {
  display: none;
  animation: fadeIn 0.4s ease;
}
.tembase-quote .tq-wizard-panel.active {
  display: block;
}
.tembase-quote .tq-wizard-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px dashed #cbd5e1;
}
.tembase-quote button.tq-btn-prev, 
.tembase-quote button.tq-btn-next {
  padding: 12px 24px !important;
  border-radius: 99px !important;
  font-weight: 600 !important;
  font-size: 15px !important;
  cursor: pointer !important;
  transition: all 0.2s !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  text-decoration: none !important;
  background-image: none !important;
  line-height: 1.5 !important;
  display: inline-block !important;
  margin: 0 !important;
}
.tembase-quote button.tq-btn-prev {
  background-color: #f1f5f9 !important;
  color: #475569 !important;
}
.tembase-quote button.tq-btn-prev:hover {
  background-color: #e2e8f0 !important;
  color: #475569 !important;
}
.tembase-quote button.tq-btn-next {
  background-color: var(--tq-accent) !important;
  color: #ffffff !important;
}
.tembase-quote button.tq-btn-next:hover {
  background-color: #001f55 !important;
  color: #ffffff !important;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
