/**
 * Heritage & Castle Dental Care — Franchise Enquiry Form Styles
 * 
 * Scoped strictly to .hfef-wrapper
 * Color palette:
 *   --hfef-primary: #293823 (Deep British Green)
 *   --hfef-navy: #0f172a
 *   --hfef-gold: #c5a059
 *   --hfef-bg: #ffffff
 *   --hfef-input-bg: #f8fafc
 */

.hfef-wrapper {
  --hfef-primary: #293823;
  --hfef-primary-hover: #1f2c1b;
  --hfef-primary-light: #eef2ec;
  --hfef-navy: #0f172a;
  --hfef-slate: #475569;
  --hfef-gold: #c5a059;
  --hfef-gold-light: #fbf7ee;
  --hfef-border: #e2e8f0;
  --hfef-border-focus: #293823;
  --hfef-input-bg: #f8fafc;
  --hfef-input-bg-focus: #ffffff;
  --hfef-error: #dc2626;
  --hfef-error-bg: #fef2f2;
  --hfef-radius: 10px;
  --hfef-card-radius: 16px;
  --hfef-pill-radius: 50px;
  --hfef-shadow: 0 16px 40px -10px rgba(15, 23, 42, 0.09), 0 0 0 1px rgba(226, 232, 240, 0.7);

  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--hfef-navy);
  text-align: left;
}

.hfef-wrapper *,
.hfef-wrapper *::before,
.hfef-wrapper *::after {
  box-sizing: border-box;
}

/* Card Container */
.hfef-card {
  background: #ffffff !important;
  border: 1px solid rgba(226, 232, 240, 0.9) !important;
  border-radius: var(--hfef-card-radius) !important;
  padding: 30px 32px 26px !important;
  box-shadow: var(--hfef-shadow) !important;
}

@media (max-width: 640px) {
  .hfef-card {
    padding: 20px 18px 18px !important;
    border-radius: 14px !important;
  }
}

/* Header (Hidden if empty or suppressed) */
.hfef-header {
  margin-bottom: 20px;
}

.hfef-header:empty {
  display: none !important;
  margin: 0 !important;
}

.hfef-title {
  font-family: inherit;
  font-size: 1.65rem;
  font-weight: 800;
  line-height: 1.25;
  color: var(--hfef-navy);
  margin: 0 0 6px 0;
  letter-spacing: -0.02em;
}

.hfef-subtitle {
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--hfef-slate);
  margin: 0;
}

/* Segmented Progress Bar */
.hfef-progress-bar-wrap {
  margin-bottom: 22px !important;
}

.hfef-progress-segments {
  display: flex !important;
  gap: 8px !important;
  margin-bottom: 8px !important;
}

.hfef-segment {
  flex: 1 !important;
  height: 5px !important;
  background-color: #e2e8f0 !important;
  border-radius: 4px !important;
  transition: background-color 0.3s ease !important;
}

.hfef-segment.is-active {
  background-color: var(--hfef-primary) !important;
}

.hfef-step-indicator,
.hcd-shortcode-container .hfef-step-indicator {
  font-size: 13px !important;
  font-weight: 650 !important;
  color: #475569 !important;
}

/* Form Panes */
.hfef-step-pane {
  display: none;
}

.hfef-step-pane.is-active {
  display: block;
  animation: hfefFadeIn 0.25s ease-out;
}

@keyframes hfefFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Field Groups & Labels (Guaranteed High Contrast & Readability) */
.hfef-field-group {
  margin-bottom: 16px !important;
}

.hfef-wrapper label,
.hfef-wrapper .hfef-label,
.hcd-shortcode-container .hfef-wrapper label,
.hcd-shortcode-container .hfef-wrapper .hfef-label,
.hcd-shortcode-container label.hfef-label,
div#franchise-enquiry-form label,
div#franchise-enquiry-form .hfef-label {
  display: block !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  color: #0f172a !important; /* Deep dark charcoal - 100% visible */
  margin-bottom: 6px !important;
  letter-spacing: -0.01em !important;
  opacity: 1 !important;
  visibility: visible !important;
  text-shadow: none !important;
}

.hfef-req {
  color: #dc2626 !important;
  font-weight: 700 !important;
  margin-left: 2px !important;
}

.hfef-opt {
  font-size: 11.5px !important;
  font-weight: 400 !important;
  color: #64748b !important;
}

/* Inputs, Selects & Textarea (Crisp Contrast & Visibility) */
.hfef-wrapper input[type="text"],
.hfef-wrapper input[type="tel"],
.hfef-wrapper input[type="email"],
.hfef-wrapper select,
.hfef-wrapper textarea,
.hcd-shortcode-container .hfef-wrapper input[type="text"],
.hcd-shortcode-container .hfef-wrapper input[type="tel"],
.hcd-shortcode-container .hfef-wrapper input[type="email"],
.hcd-shortcode-container .hfef-wrapper select,
.hcd-shortcode-container .hfef-wrapper textarea,
div#franchise-enquiry-form input[type="text"],
div#franchise-enquiry-form input[type="tel"],
div#franchise-enquiry-form input[type="email"],
div#franchise-enquiry-form select,
div#franchise-enquiry-form textarea {
  width: 100% !important;
  min-height: 48px !important;
  background: #f8fafc !important;
  border: 1.5px solid #cbd5e1 !important;
  border-radius: 10px !important;
  padding: 0 14px !important;
  font-size: 14px !important;
  font-family: inherit !important;
  font-weight: 500 !important;
  color: #0f172a !important; /* Crystal clear readable text */
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04) !important;
  transition: all 0.2s ease !important;
  box-sizing: border-box !important;
  margin-bottom: 0 !important;
}

.hfef-wrapper textarea,
.hcd-shortcode-container .hfef-wrapper textarea,
div#franchise-enquiry-form textarea {
  min-height: 80px !important;
  padding: 12px 14px !important;
  resize: vertical !important;
  line-height: 1.45 !important;
}

.hfef-wrapper input:hover,
.hfef-wrapper select:hover,
.hfef-wrapper textarea:hover {
  border-color: #94a3b8 !important;
}

.hfef-wrapper input:focus,
.hfef-wrapper select:focus,
.hfef-wrapper textarea:focus,
.hcd-shortcode-container .hfef-wrapper input:focus,
.hcd-shortcode-container .hfef-wrapper select:focus,
.hcd-shortcode-container .hfef-wrapper textarea:focus,
div#franchise-enquiry-form input:focus,
div#franchise-enquiry-form select:focus,
div#franchise-enquiry-form textarea:focus {
  outline: none !important;
  background: #ffffff !important;
  border-color: #293823 !important;
  box-shadow: 0 0 0 3px rgba(41, 56, 35, 0.15) !important;
  color: #0f172a !important;
}

.hfef-wrapper input::placeholder,
.hfef-wrapper textarea::placeholder,
.hcd-shortcode-container .hfef-wrapper input::placeholder,
.hcd-shortcode-container .hfef-wrapper textarea::placeholder,
div#franchise-enquiry-form input::placeholder,
div#franchise-enquiry-form textarea::placeholder {
  color: #94a3b8 !important;
  font-size: 13.5px !important;
  font-weight: 400 !important;
}

/* Select Dropdown Styling with SVG Arrow */
.hfef-select-wrap {
  position: relative !important;
  width: 100% !important;
}

.hfef-wrapper select.hfef-select,
.hcd-shortcode-container .hfef-wrapper select.hfef-select {
  appearance: none !important;
  -webkit-appearance: none !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 14px center !important;
  background-size: 16px !important;
  padding-right: 40px !important;
  cursor: pointer !important;
}

/* 2-Column Grid */
.hfef-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 600px) {
  .hfef-grid-2col {
    grid-template-columns: 1fr !important;
    gap: 0 !important;
  }
}

/* Step 2: Practice Model Radio Cards */
.hfef-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

@media (max-width: 600px) {
  .hfef-cards-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
}

.hfef-card-choice {
  cursor: pointer;
  display: block;
  position: relative;
}

.hfef-radio-card-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.hfef-choice-box {
  background: #f8fafc !important;
  border: 1.5px solid #e2e8f0 !important;
  border-radius: 12px !important;
  padding: 16px 14px !important;
  min-height: 95px;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease !important;
}

.hfef-choice-title {
  font-size: 15px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  margin-bottom: 4px;
}

.hfef-choice-desc {
  font-size: 12px !important;
  line-height: 1.4 !important;
  color: #64748b !important;
}

.hfef-card-choice:hover .hfef-choice-box {
  border-color: #cbd5e1 !important;
  background: #ffffff !important;
}

/* Active Radio Card */
.hfef-radio-card-input:checked + .hfef-choice-box {
  border-color: var(--hfef-primary) !important;
  background: #ffffff !important;
  box-shadow: 0 4px 14px rgba(41, 56, 35, 0.12) !important;
}

.hfef-radio-card-input:focus + .hfef-choice-box {
  outline: 2px solid var(--hfef-primary);
  outline-offset: 2px;
}

/* Simple Radio (Below cards: "I'm not sure yet") */
.hfef-single-radio-wrap {
  margin-top: 6px;
}

.hfef-simple-radio {
  display: inline-flex !important;
  align-items: center !important;
  gap: 10px !important;
  cursor: pointer !important;
  font-size: 13.5px !important;
  color: var(--hfef-slate) !important;
}

.hfef-simple-radio input[type="radio"] {
  width: 18px !important;
  height: 18px !important;
  accent-color: var(--hfef-primary) !important;
  cursor: pointer !important;
}

/* Pill Radios (Step 2 & 3: GDC Registered & Premises) */
.hfef-pills-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hfef-pill-choice {
  cursor: pointer;
  position: relative;
}

.hfef-pill-choice input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.hfef-pill-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 46px !important;
  padding: 10px 20px !important;
  background: #f1f5f9 !important;
  border: 1.5px solid transparent !important;
  border-radius: var(--hfef-pill-radius) !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  color: #0f172a !important;
  transition: all 0.2s ease !important;
  user-select: none;
}

.hfef-pill-choice:hover .hfef-pill-btn {
  background: #e2e8f0 !important;
}

.hfef-pill-choice input[type="radio"]:checked + .hfef-pill-btn {
  background: #eef2ec !important;
  border-color: var(--hfef-primary) !important;
  color: var(--hfef-primary) !important;
  font-weight: 700 !important;
}

.hfef-pill-choice input[type="radio"]:focus + .hfef-pill-btn {
  outline: 2px solid var(--hfef-primary);
  outline-offset: 2px;
}

/* Consent Checkbox */
.hfef-consent-wrap {
  margin-top: 20px;
}

.hfef-checkbox-label {
  display: flex !important;
  align-items: flex-start !important;
  gap: 10px !important;
  cursor: pointer !important;
  font-size: 12.5px !important;
  line-height: 1.45 !important;
  color: var(--hfef-slate) !important;
}

.hfef-checkbox-label input[type="checkbox"] {
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  accent-color: var(--hfef-primary) !important;
  margin-top: 2px !important;
  cursor: pointer !important;
}

.hfef-checkbox-text {
  color: #475569 !important;
}

.hfef-checkbox-text a {
  color: var(--hfef-primary) !important;
  text-decoration: underline !important;
  font-weight: 600 !important;
}

.hfef-checkbox-text a:hover {
  color: var(--hfef-primary-hover) !important;
}

/* Inline Validation Errors */
.hfef-field-error {
  display: none;
  font-size: 11.5px !important;
  color: var(--hfef-error) !important;
  font-weight: 600 !important;
  margin-top: 5px !important;
}

.hfef-field-group.has-error .hfef-input,
.hfef-field-group.has-error .hfef-select,
.hfef-field-group.has-error .hfef-textarea {
  border-color: var(--hfef-error) !important;
  background: var(--hfef-error-bg) !important;
}

.hfef-field-group.has-error .hfef-field-error {
  display: block;
}

/* Global Alert */
.hfef-alert {
  padding: 12px 16px;
  border-radius: var(--hfef-radius);
  font-size: 13px;
  margin-bottom: 18px;
  line-height: 1.45;
}

.hfef-alert-error {
  background: var(--hfef-error-bg);
  color: var(--hfef-error);
  border: 1px solid #fecaca;
}

/* Navigation Buttons */
.hfef-actions {
  margin-top: 22px !important;
}

.hfef-actions-split {
  display: flex !important;
  gap: 12px !important;
  align-items: center !important;
}

.hfef-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 50px !important;
  padding: 12px 24px !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  font-family: inherit !important;
  border-radius: 10px !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  border: none !important;
  text-decoration: none !important;
}

.hfef-btn-primary,
.hcd-shortcode-container .hfef-wrapper .hfef-btn-primary,
.hcd-shortcode-container button.hfef-btn-primary,
div#franchise-enquiry-form button.hfef-btn-primary {
  background: var(--hfef-primary) !important;
  background-image: linear-gradient(135deg, #293823 0%, #1a2616 100%) !important;
  color: #ffffff !important;
  width: 100% !important;
  box-shadow: 0 4px 14px rgba(41, 56, 35, 0.25) !important;
}

.hfef-btn-primary:hover,
.hcd-shortcode-container .hfef-wrapper .hfef-btn-primary:hover,
.hcd-shortcode-container button.hfef-btn-primary:hover,
div#franchise-enquiry-form button.hfef-btn-primary:hover {
  background-image: linear-gradient(135deg, #34482c 0%, #202e1b 100%) !important;
  transform: translateY(-1.5px) !important;
  box-shadow: 0 6px 18px rgba(41, 56, 35, 0.35) !important;
  color: #ffffff !important;
}

.hfef-actions-split .hfef-btn-secondary {
  flex: 0 0 100px !important;
  background: #ffffff !important;
  color: var(--hfef-navy) !important;
  border: 1.5px solid #cbd5e1 !important;
}

.hfef-actions-split .hfef-btn-secondary:hover {
  background: #f8fafc !important;
  border-color: #94a3b8 !important;
}

.hfef-actions-split .hfef-btn-primary {
  flex: 1 !important;
}

.hfef-btn:focus {
  outline: 2px solid var(--hfef-primary);
  outline-offset: 3px;
}

.hfef-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

/* Spinner */
.hfef-spin {
  animation: hfefRotate 1s linear infinite;
  display: inline-block;
  vertical-align: middle;
}

@keyframes hfefRotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* CAPTCHA box */
.hfef-captcha-box {
  margin: 16px 0;
}

/* Success Screen */
.hfef-success-pane {
  text-align: center;
  padding: 24px 10px;
  animation: hfefFadeIn 0.35s ease-out;
}

.hfef-success-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--hfef-primary-light);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}

.hfef-success-title {
  font-family: inherit;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--hfef-navy);
  margin: 0 0 8px 0;
  letter-spacing: -0.02em;
}

.hfef-success-desc {
  font-size: 1.05rem;
  color: var(--hfef-slate);
  margin: 0 0 28px 0;
  line-height: 1.5;
}

.hfef-success-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 380px;
  margin: 0 auto;
}

.hfef-btn-booking {
  background: var(--hfef-primary);
  color: #ffffff !important;
}

.hfef-btn-call {
  background: #ffffff;
  color: var(--hfef-navy) !important;
  border: 1.5px solid var(--hfef-border);
}

.hfef-btn-call:hover {
  border-color: var(--hfef-primary);
  color: var(--hfef-primary) !important;
}

/* Mobile Screens Optimization */
@media (max-width: 640px) {
  .hfef-card {
    padding: 20px 18px 18px !important;
    border-radius: 14px !important;
  }

  .hfef-grid-2col {
    grid-template-columns: 1fr !important;
    gap: 0 !important;
  }

  .hfef-cards-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .hfef-pills-group {
    gap: 8px !important;
  }

  .hfef-pill-btn {
    padding: 8px 16px !important;
    font-size: 13px !important;
    min-height: 42px !important;
  }

  .hfef-actions-split .hfef-btn-secondary {
    flex: 0 0 85px !important;
    min-height: 46px !important;
  }

  .hfef-btn {
    min-height: 46px !important;
    font-size: 14px !important;
  }
}
