/* ============================================
   CF7 WIZARD FORM — Custom Styles
   Guided multi-step contact form
   ============================================ */

/* --- CSS Custom Properties (Color Palette) --- */
:root {
  --wz-primary: #8B6F47;
  /* Earthy brown */
  --wz-primary-dark: #6B5535;
  /* Darker brown */
  --wz-primary-light: #A8906C;
  /* Light brown */
  --wz-accent: #C4A265;
  /* Gold accent */
  --wz-bg: #FAF7F2;
  /* Warm off-white */
  --wz-bg-card: #FFFFFF;
  /* Card background */
  --wz-text: #2D2A26;
  /* Dark text */
  --wz-text-muted: #7A746B;
  /* Muted text */
  --wz-border: #E5DDD0;
  /* Light border */
  --wz-success: #5A8F5A;
  /* Green for completed */
  --wz-shadow: 0 4px 24px rgba(139, 111, 71, 0.10);
  --wz-shadow-hover: 0 8px 32px rgba(139, 111, 71, 0.18);
  --wz-radius: 16px;
  --wz-radius-sm: 10px;
  --wz-transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Container --- */
.cf7-wizard-container {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 24px;
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: var(--wz-text);
}

/* --- Progress Bar --- */
.wizard-progress {
  margin-bottom: 48px;
}

.wizard-progress-bar {
  width: 100%;
  height: 6px;
  background: var(--wz-border);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 16px;
}

.wizard-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--wz-primary), var(--wz-accent));
  border-radius: 99px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.wizard-steps-indicator {
  display: flex;
  justify-content: space-between;
  padding: 0 4px;
}

.wizard-step-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  background: var(--wz-bg);
  color: var(--wz-text-muted);
  border: 2px solid var(--wz-border);
  transition: all var(--wz-transition);
  cursor: default;
}

.wizard-step-dot.active {
  background: var(--wz-primary);
  color: #fff;
  border-color: var(--wz-primary);
  box-shadow: 0 0 0 4px rgba(139, 111, 71, 0.15);
}

.wizard-step-dot.completed {
  background: var(--wz-success);
  color: #fff;
  border-color: var(--wz-success);
}

/* --- Steps --- */
.wizard-step {
  display: none;
  animation: wizardFadeIn 0.4s ease-out;
}

.wizard-step.active {
  display: block;
}

@keyframes wizardFadeIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Question Typography --- */
.wizard-question {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--wz-text);
  text-align: center;
  margin: 0 0 8px 0;
}

.wizard-subtitle {
  font-size: 15px;
  color: var(--wz-text-muted);
  text-align: center;
  margin: 0 0 36px 0;
  font-weight: 400;
}

/* --- Card-Style Radio Buttons --- */
.wizard-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-top: 24px;
  margin-bottom: 24px;
}

/* Hide default CF7 radio structure */
.wizard-cards .wpcf7-radio {
  display: contents;
}

.wizard-cards .wpcf7-list-item {
  display: block;
  margin: 0 !important;
}

/* Full-width last card when there's an odd number */
.wizard-cards .wpcf7-list-item:last-child:nth-child(odd) {
  grid-column: 1 / -1;
  width: 100% !important;
  min-width: 100% !important;
}

/* Hide native radio input */
.wizard-cards .wpcf7-list-item input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

/* Style label as card */
.wizard-cards .wpcf7-list-item label {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 100px;
  padding: 20px 16px;
  background: var(--wz-bg-card);
  border: 2px solid var(--wz-border);
  border-radius: var(--wz-radius);
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--wz-text);
  transition: all var(--wz-transition);
  box-shadow: var(--wz-shadow);
  user-select: none;
  position: relative;
  overflow: hidden;
}

.wizard-cards .wpcf7-list-item label::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(139, 111, 71, 0.05), transparent);
  opacity: 0;
  transition: opacity var(--wz-transition);
}

/* Hover state */
.wizard-cards .wpcf7-list-item label:hover {
  border-color: var(--wz-primary-light);
  box-shadow: var(--wz-shadow-hover);
  transform: translateY(-2px);
}

.wizard-cards .wpcf7-list-item label:hover::before {
  opacity: 1;
}

/* Selected state */
.wizard-cards .wpcf7-list-item input[type="radio"]:checked+.wpcf7-list-item-label,
.wizard-cards .wpcf7-list-item.selected label {
  border-color: var(--wz-primary);
  background: linear-gradient(135deg, rgba(139, 111, 71, 0.08), rgba(196, 162, 101, 0.06));
  color: var(--wz-primary-dark);
  box-shadow: 0 0 0 3px rgba(139, 111, 71, 0.12), var(--wz-shadow);
}

/* Checkmark on selected */
.wizard-cards .wpcf7-list-item.selected label::after {
  content: '✓';
  position: absolute;
  top: 8px;
  right: 10px;
  width: 22px;
  height: 22px;
  background: var(--wz-primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  animation: wizardCheckPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes wizardCheckPop {
  from {
    transform: scale(0);
  }

  to {
    transform: scale(1);
  }
}

/* --- Contact Info Fields (Step 6) --- */
.wizard-contact-fields {
  display: flex;
  flex-direction: column;
  gap: 0px;
  max-width: 480px;
  margin: 24px auto;
}

.wizard-field label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--wz-text);
  margin-bottom: 6px;
}

.wizard-field .wpcf7-form-control.wizard-input {
  width: 100%;
  padding: 14px 18px;
  font-size: 15px;
  border: 2px solid var(--wz-border);
  border-radius: var(--wz-radius-sm);
  background: var(--wz-bg-card);
  color: var(--wz-text);
  transition: all var(--wz-transition);
  font-family: inherit;
  box-sizing: border-box;
}

/* Textarea variant */
.wizard-field textarea.wizard-input {
  min-height: 120px;
  resize: vertical;
}

/* Consent checkbox */
.wizard-consent .wpcf7-acceptance {
  font-size: 13px;
  color: var(--wz-text-muted);
}

.wizard-field .wpcf7-form-control.wizard-input::placeholder {
  color: var(--wz-text-muted);
}

.wizard-field .wpcf7-form-control.wizard-input:focus {
  outline: none;
  border-color: var(--wz-primary);
  box-shadow: 0 0 0 4px rgba(139, 111, 71, 0.1);
}

/* CF7 validation error styling */
.wizard-field .wpcf7-not-valid {
  border-color: #c0392b !important;
}

.wizard-field .wpcf7-not-valid-tip {
  color: #c0392b;
  font-size: 12px;
  margin-top: 4px;
}

/* --- Navigation Buttons --- */
.wizard-nav {
  display: flex;
  justify-content: center;
  gap: 12px;
}

/* Base button style — forced over theme */
.cf7-wizard-container .wizard-btn,
.cf7-wizard-container button.wizard-btn {
  padding: 14px 32px !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  border-radius: var(--wz-radius-sm) !important;
  cursor: pointer !important;
  transition: all var(--wz-transition) !important;
  font-family: inherit !important;
  border: none !important;
  letter-spacing: 0.3px !important;
  text-transform: none !important;
  line-height: 1.4 !important;
  box-shadow: none !important;
  background: var(--wz-primary) !important;
  color: #fff !important;
}

.cf7-wizard-container .wizard-btn:hover,
.cf7-wizard-container button.wizard-btn:hover {
  background: var(--wz-primary-dark) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 16px rgba(139, 111, 71, 0.25) !important;
}

/* Back button variant */
.cf7-wizard-container .wizard-btn-prev,
.cf7-wizard-container button.wizard-btn-prev {
  background: transparent !important;
  color: var(--wz-text-muted) !important;
  border: 2px solid var(--wz-border) !important;
}

.cf7-wizard-container .wizard-btn-prev:hover,
.cf7-wizard-container button.wizard-btn-prev:hover {
  background: var(--wz-bg) !important;
  color: var(--wz-text) !important;
  border-color: var(--wz-primary-light) !important;
  transform: none !important;
  box-shadow: none !important;
}

/* Submit button — forced over theme */
.cf7-wizard-container .wpcf7-submit,
.cf7-wizard-container input[type="submit"],
.cf7-wizard-container .wizard-btn-submit {
  background: linear-gradient(135deg, var(--wz-primary), var(--wz-accent)) !important;
  color: #fff !important;
  padding: 16px 40px !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  border: none !important;
  border-radius: var(--wz-radius-sm) !important;
  cursor: pointer !important;
  transition: transform 0.3s ease, box-shadow 0.3s ease !important;
  letter-spacing: 0.5px !important;
  text-transform: uppercase !important;
  line-height: 1.4 !important;
  box-shadow: none !important;
}

.cf7-wizard-container .wpcf7-submit:hover,
.cf7-wizard-container input[type="submit"]:hover {
  background: linear-gradient(135deg, var(--wz-primary-dark), var(--wz-primary)) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 24px rgba(139, 111, 71, 0.3) !important;
}

/* --- CF7 Response Messages --- */
.cf7-wizard-container .wpcf7-response-output {
  text-align: center;
  border-radius: var(--wz-radius-sm);
  margin-top: 24px;
  font-size: 14px;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .cf7-wizard-container {
    padding: 24px 16px;
  }

  .wizard-question {
    font-size: 20px;
  }

  .wizard-cards {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .wizard-cards .wpcf7-list-item label {
    min-height: 64px;
    padding: 16px;
  }

  .wizard-step-dot {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }

  .wizard-nav {
    flex-direction: column-reverse;
    gap: 8px;
  }

  .wizard-btn {
    width: 100%;
    text-align: center;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .wizard-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ============================================
   THEME OVERRIDES — Hub / Elementor Kit
   These use !important to beat the theme's
   .elementor-kit-* styles on cards/radios
   ============================================ */

/* --- Radio Buttons: Force hide circles --- */
.cf7-wizard-container .wizard-cards input[type="radio"],
.cf7-wizard-container .wizard-cards .wpcf7-list-item input[type="radio"] {
  position: absolute !important;
  opacity: 0 !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  pointer-events: none !important;
  appearance: none !important;
  -webkit-appearance: none !important;
}

/* Kill the radio circle pseudo-elements from the theme (on the label span) */
.cf7-wizard-container .wizard-cards .wpcf7-list-item-label::before,
.cf7-wizard-container .wizard-cards .wpcf7-list-item-label::after {
  display: none !important;
  content: none !important;
}

/* Remove left padding reserved for theme radio circles */
.cf7-wizard-container .wizard-cards .wpcf7-list-item-label {
  padding-left: 0 !important;
  margin-left: 0 !important;
}

/* --- Cards: Force grid layout --- */
.cf7-wizard-container .wizard-cards {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 12px !important;
}

/* CF7 wraps radios in extra spans — make them transparent to grid */
.cf7-wizard-container .wizard-cards>span,
.cf7-wizard-container .wizard-cards .wpcf7-form-control-wrap {
  display: contents !important;
}

.cf7-wizard-container .wizard-cards .wpcf7-radio {
  display: contents !important;
}

.cf7-wizard-container .wizard-cards .wpcf7-list-item {
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

.cf7-wizard-container .wizard-cards .wpcf7-list-item label {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  min-height: 70px !important;
  padding: 16px 12px !important;
  background: var(--wz-bg-card) !important;
  border: 2px solid var(--wz-border) !important;
  border-radius: var(--wz-radius) !important;
  cursor: pointer !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  box-shadow: var(--wz-shadow) !important;
}

.cf7-wizard-container .wizard-cards .wpcf7-list-item label:hover {
  border-color: var(--wz-primary-light) !important;
  box-shadow: var(--wz-shadow-hover) !important;
  transform: translateY(-2px) !important;
}

.cf7-wizard-container .wizard-cards .wpcf7-list-item.selected label {
  border-color: var(--wz-primary) !important;
  background: linear-gradient(135deg, rgba(139, 111, 71, 0.08), rgba(196, 162, 101, 0.06)) !important;
  color: var(--wz-primary-dark) !important;
  box-shadow: 0 0 0 3px rgba(139, 111, 71, 0.12), var(--wz-shadow) !important;
}

/* --- Progress bar override --- */
.cf7-wizard-container .wizard-steps-indicator {
  display: flex !important;
  flex-direction: row !important;
  justify-content: space-between !important;
}

/* --- Text inputs override --- */
.cf7-wizard-container .wizard-input,
.cf7-wizard-container input.wizard-input[type="text"],
.cf7-wizard-container input.wizard-input[type="email"],
.cf7-wizard-container input.wizard-input[type="tel"] {
  width: 100% !important;
  padding: 14px 18px !important;
  font-size: 15px !important;
  border: 2px solid var(--wz-border) !important;
  border-radius: var(--wz-radius-sm) !important;
  background: var(--wz-bg-card) !important;
  color: var(--wz-text) !important;
  box-sizing: border-box !important;
  box-shadow: none !important;
  min-height: unset !important;
}

.cf7-wizard-container .wizard-input:focus,
.cf7-wizard-container input.wizard-input:focus {
  outline: none !important;
  border-color: var(--wz-primary) !important;
  box-shadow: 0 0 0 4px rgba(139, 111, 71, 0.1) !important;
}

/* --- Kill any residual WP auto-p formatting --- */
.cf7-wizard-container p {
  margin: 0 !important;
  padding: 0 !important;
}

.cf7-wizard-container br {
  display: none !important;
}

/* --- Fix submit button width on desktop/tablet (step 6) --- */
@media (min-width: 769px) {
  .cf7-wizard-container .wizard-nav {
    flex-wrap: nowrap !important;
  }

  .cf7-wizard-container .wizard-nav .wpcf7-submit,
  .cf7-wizard-container .wizard-nav input[type="submit"] {
    width: auto !important;
  }
}