/* Theme buttons set their own display, which would override the hidden attribute. */
.hq [hidden] {
  display: none !important;
}

.hq {
  max-width: 820px;
  margin: 8px auto 0;
  padding: 32px;
  border: 1px solid var(--line, #e4e9ec);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(20, 33, 43, 0.12);
  scroll-margin-top: 96px;
}

.hq-top {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  color: var(--muted, #5b6b76);
  font-size: 14px;
  font-weight: 700;
}

.hq-progress {
  height: 8px;
  margin-bottom: 28px;
  border-radius: 999px;
  background: #eef2f4;
  overflow: hidden;
}

.hq-progress-bar {
  display: block;
  width: 20%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand, #0e7c66), var(--accent, #f2a541));
  transition: width 0.35s ease;
}

.hq-step {
  display: none;
  margin: 0;
  padding: 0;
  border: 0;
}

.hq-step.is-active {
  display: block;
  animation: hq-in 0.3s ease;
}

@keyframes hq-in {
  from {
    opacity: 0;
    transform: translateX(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.hq-step legend {
  margin-bottom: 18px;
  font-size: 24px;
  font-weight: 800;
}

.hq-step .hq-sub {
  margin-top: 28px;
  font-size: 19px;
}

.hq-note {
  margin: -8px 0 18px;
  color: var(--muted, #5b6b76);
}

.hq-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.hq-option {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border: 2px solid var(--line, #e4e9ec);
  border-radius: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.hq-option input {
  accent-color: var(--brand, #0e7c66);
  width: 18px;
  height: 18px;
}

.hq-option:hover {
  border-color: var(--brand, #0e7c66);
  transform: translateY(-1px);
}

.hq-option:has(input:checked) {
  border-color: var(--brand, #0e7c66);
  background: var(--brand-tint, #e3f2ed);
}

.hq-area {
  display: flex;
  align-items: center;
  gap: 18px;
}

.hq-area input[type="range"] {
  --fill: 18%;
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand, #0e7c66) var(--fill), #e4e9ec var(--fill));
  appearance: none;
  outline-offset: 6px;
}

.hq-area input[type="range"]::-webkit-slider-thumb {
  width: 26px;
  height: 26px;
  border: 4px solid #fff;
  border-radius: 50%;
  background: var(--brand, #0e7c66);
  box-shadow: 0 2px 10px rgba(20, 33, 43, 0.25);
  appearance: none;
  cursor: grab;
}

.hq-area input[type="range"]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border: 4px solid #fff;
  border-radius: 50%;
  background: var(--brand, #0e7c66);
  cursor: grab;
}

.hq-area-value {
  min-width: 86px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--soft, #f1f6f4);
  font-weight: 800;
  font-size: 20px;
  text-align: center;
}

.hq-days {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x mandatory;
}

.hq-day {
  display: grid;
  flex: 0 0 auto;
  gap: 2px;
  min-width: 68px;
  padding: 10px 8px;
  border: 2px solid var(--line, #e4e9ec);
  border-radius: 14px;
  background: #fff;
  font-family: inherit;
  text-align: center;
  cursor: pointer;
  scroll-snap-align: start;
}

.hq-day small {
  color: var(--muted, #5b6b76);
  font-size: 12px;
  text-transform: uppercase;
}

.hq-day strong {
  font-size: 22px;
}

.hq-day.is-active {
  border-color: var(--brand, #0e7c66);
  background: var(--brand-tint, #e3f2ed);
}

.hq-day:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.hq-slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.hq-slot {
  padding: 12px;
  border: 2px solid var(--line, #e4e9ec);
  border-radius: 12px;
  background: #fff;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
}

.hq-slot:hover:not(:disabled) {
  border-color: var(--brand, #0e7c66);
}

.hq-slot.is-active {
  border-color: var(--brand, #0e7c66);
  background: var(--brand, #0e7c66);
  color: #fff;
}

.hq-slot:disabled {
  color: #a7b2b9;
  background: repeating-linear-gradient(-45deg, #f6f8f9, #f6f8f9 6px, #eef2f4 6px, #eef2f4 12px);
  text-decoration: line-through;
  cursor: not-allowed;
}

.hq-loading {
  color: var(--muted, #5b6b76);
}

.hq-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}

.hq-fields label {
  display: grid;
  gap: 6px;
  font-weight: 700;
  font-size: 15px;
}

.hq-fields .hq-wide {
  grid-column: 1 / -1;
}

.hq-fields input,
.hq-fields textarea {
  padding: 13px 14px;
  border: 1px solid var(--line, #e4e9ec);
  border-radius: 12px;
  font: inherit;
  font-weight: 400;
}

.hq-fields input:focus,
.hq-fields textarea:focus {
  outline: 3px solid var(--brand-tint, #e3f2ed);
  border-color: var(--brand, #0e7c66);
}

.hq-estimate {
  display: grid;
  gap: 4px;
  margin-top: 28px;
  padding: 20px 22px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent-tint, #fdf1de) 0%, #fff7ea 100%);
}

.hq-estimate span {
  font-weight: 700;
}

.hq-estimate strong {
  font-size: 30px;
  font-variant-numeric: tabular-nums;
}

.hq-estimate small {
  color: var(--muted, #5b6b76);
}

.hq-error {
  margin: 16px 0 0;
  color: var(--danger, #b42318);
  font-weight: 700;
}

.hq-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
}

.hq-nav .hq-next,
.hq-nav .hq-submit {
  margin-left: auto;
}

/* Timeline: thank-you page and order tracking */
.hf-timeline {
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
  text-align: left;
}

.hf-timeline li {
  position: relative;
  padding: 0 0 22px 44px;
}

.hf-timeline li::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 26px;
  bottom: 0;
  width: 2px;
  background: var(--line, #e4e9ec);
}

.hf-timeline li:last-child::before {
  display: none;
}

.hf-timeline li::after {
  content: "";
  position: absolute;
  left: 0;
  top: 2px;
  width: 24px;
  height: 24px;
  border: 2px solid var(--line, #e4e9ec);
  border-radius: 50%;
  background: #fff;
}

.hf-timeline li.is-done::after {
  content: "✓";
  display: grid;
  place-items: center;
  border-color: var(--brand, #0e7c66);
  background: var(--brand, #0e7c66);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.hf-timeline li.is-done::before {
  background: var(--brand, #0e7c66);
}

.hf-timeline li.is-current::after {
  border-color: var(--accent, #f2a541);
  box-shadow: 0 0 0 6px var(--accent-tint, #fdf1de);
}

.hf-timeline strong {
  display: block;
}

.hf-timeline span {
  color: var(--muted, #5b6b76);
}

.hf-timeline li.is-next {
  opacity: 0.6;
}

.hf-thankyou .woocommerce-notice--success.woocommerce-thankyou-order-received {
  display: none;
}

.hf-thankyou .woocommerce-order-overview {
  margin: 0 auto 32px;
  padding: 16px 20px;
  border-radius: 16px;
  background: var(--soft, #f1f6f4);
}

.hf-thanks {
  max-width: 640px;
  margin: 8px auto 40px;
  padding: 36px;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(20, 33, 43, 0.12);
  text-align: center;
}

.hf-thanks-icon {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--brand, #0e7c66);
  color: #fff;
  font-size: 36px;
  font-weight: 800;
  animation: hf-pop 0.5s ease;
}

@keyframes hf-pop {
  0% {
    transform: scale(0.4);
    opacity: 0;
  }
  70% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.hf-thanks h2 {
  margin: 0 0 8px;
}

.hf-thanks-slot {
  display: inline-block;
  margin: 8px 0;
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--brand-tint, #e3f2ed);
  color: var(--brand-dark, #0a5e4d);
  font-weight: 800;
}

.hf-thanks-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 12px;
}

.hf-track {
  max-width: 760px;
}

.hf-track-form {
  display: grid;
  grid-template-columns: 1fr 1.4fr auto;
  align-items: end;
  gap: 12px;
  padding: 24px;
  border-radius: 20px;
  background: var(--soft, #f1f6f4);
}

.hf-track-form label {
  display: grid;
  gap: 6px;
  font-weight: 700;
  font-size: 15px;
}

.hf-track-form input {
  padding: 13px 14px;
  border: 1px solid var(--line, #e4e9ec);
  border-radius: 12px;
  font: inherit;
}

.hf-track-card {
  margin-top: 24px;
  padding: 28px;
  border: 1px solid var(--line, #e4e9ec);
  border-radius: 20px;
  background: #fff;
}

.hf-track-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.hf-track-head h2 {
  margin: 0;
}

.hf-badge {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--accent-tint, #fdf1de);
  font-weight: 700;
  font-size: 14px;
}

/* Demo card form */
.hf-card {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 24px;
  align-items: start;
  margin-top: 8px;
}

.hf-card-preview {
  position: relative;
  aspect-ratio: 1.586;
  padding: 20px;
  border-radius: 16px;
  background: linear-gradient(135deg, #24384a 0%, #14212b 100%);
  color: #fff;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  box-shadow: 0 16px 40px rgba(20, 33, 43, 0.3);
  transition: transform 0.4s ease, background 0.3s ease;
}

.hf-card-preview[data-brand="visa"] {
  background: linear-gradient(135deg, #1a1f71 0%, #2b3fd6 100%);
}

.hf-card-preview[data-brand="mastercard"] {
  background: linear-gradient(135deg, #e5512d 0%, #f2a541 100%);
}

.hf-card-preview.is-flipped {
  transform: rotateY(12deg) scale(0.98);
}

.hf-card-chip {
  display: block;
  width: 40px;
  height: 30px;
  border-radius: 6px;
  background: linear-gradient(135deg, #f6d38a, #c99b45);
}

.hf-card-brand {
  position: absolute;
  top: 18px;
  right: 20px;
  font-family: var(--font, sans-serif);
  font-weight: 800;
  font-style: italic;
}

.hf-card-number {
  position: absolute;
  left: 20px;
  right: 20px;
  top: 52%;
  font-size: 18px;
  letter-spacing: 0.08em;
}

.hf-card-name,
.hf-card-exp {
  position: absolute;
  bottom: 18px;
  font-size: 12px;
  opacity: 0.85;
}

.hf-card-name {
  left: 20px;
}

.hf-card-exp {
  right: 20px;
}

.hf-card-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.hf-card-fields label {
  display: grid;
  gap: 6px;
  font-weight: 700;
  font-size: 14px;
}

.hf-card-fields .hf-wide {
  grid-column: 1 / -1;
}

.hf-card-fields input {
  padding: 12px 14px;
  border: 1px solid var(--line, #e4e9ec);
  border-radius: 10px;
  font: inherit;
  font-size: 16px;
}

.hf-card-hint {
  grid-column: 1 / -1;
  margin: 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--accent-tint, #fdf1de);
  font-size: 14px;
}

@media (max-width: 720px) {
  .hq {
    padding: 22px 16px;
    border-radius: 18px;
  }

  .hq-nav .btn {
    flex: 1;
  }

  .hf-card,
  .hf-track-form {
    grid-template-columns: 1fr;
  }

  .hf-card-preview {
    max-width: 320px;
  }

  .hf-thanks {
    padding: 28px 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hq-step.is-active,
  .hf-thanks-icon {
    animation: none;
  }
}
