/* ============================================================
   BearForms – Frontend Stylesheet
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

/* ── Custom properties ─────────────────────────────────────── */
.gfb-form-wrap {
  --gfb-font:    'Inter', system-ui, -apple-system, sans-serif;
  --gfb-label:   #111827;
  --gfb-ibg:     #ffffff;
  --gfb-iborder: #d1d5db;
  --gfb-icolor:  #111827;
  --gfb-btn-bg:  #2563eb;
  --gfb-btn-fg:  #ffffff;
  --gfb-error:   #dc2626;
  --gfb-radius:  8px;
  --gfb-spacing: 18px;
  --gfb-focus:   rgba(37,99,235,.18);
  font-family:   var(--gfb-font);
}

/* ── Progress bar ──────────────────────────────────────────── */
.gfb-progress-bar { margin-bottom: 24px; }

.gfb-progress-track {
  height: 6px; background: #e5e7eb;
  border-radius: 999px; overflow: hidden; margin-bottom: 10px;
}

.gfb-progress-fill {
  height: 100%; background: var(--gfb-btn-bg);
  border-radius: 999px;
  transition: width .4s cubic-bezier(.4,0,.2,1);
}

.gfb-step-indicators {
  display: flex; gap: 8px; align-items: center; margin-bottom: 6px;
}

.gfb-step-indicator {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  background: #e5e7eb; color: #6b7280;
  transition: background .2s, color .2s, transform .2s;
}
.gfb-step-indicator.active    { background: var(--gfb-btn-bg); color: #fff; transform: scale(1.1); }
.gfb-step-indicator.completed { background: #10b981; color: #fff; }

.gfb-step-label { font-size: 13px; color: #6b7280; margin: 0; }

/* ── Step title ────────────────────────────────────────────── */
.gfb-step-title {
  font-size: 18px; font-weight: 700; color: var(--gfb-label);
  margin: 0 0 18px; padding-bottom: 12px;
  border-bottom: 2px solid #e5e7eb;
}

/* ── Fields ────────────────────────────────────────────────── */
.gfb-fields {
  display:grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gfb-spacing);
  align-items:start;
}

.gfb-field-wrap {
  margin-bottom: 0;
  position: relative;
  min-width: 0;
  grid-column: span var(--gfb-field-span, 12);
  box-sizing: border-box;
}

.gfb-conditional-wrap {
  grid-column: span var(--gfb-field-span, 12);
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}
.gfb-conditional-wrap[hidden], .gfb-conditional-wrap[style*="display:none"] { display:none !important; }
.gfb-conditional-wrap > .gfb-field-wrap {
  grid-column: auto;
  width: 100%;
}
.gfb-conditional-wrap .gfb-field-wrap {
  margin-bottom: 0;
}

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

.gfb-required { color: #b45309; margin-left: 2px; }

.gfb-description {
  font-size: 13px; color: #6b7280;
  margin: -2px 0 8px;
}

/* ── Inputs ────────────────────────────────────────────────── */
.gfb-input,
.gfb-field-wrap input[type="text"],
.gfb-field-wrap input[type="email"],
.gfb-field-wrap input[type="number"],
.gfb-field-wrap input[type="tel"],
.gfb-field-wrap input[type="url"],
.gfb-field-wrap input[type="date"],
.gfb-field-wrap input[type="time"],
.gfb-field-wrap input[type="file"],
.gfb-field-wrap input[type="password"],
.gfb-field-wrap input[type="color"],
.gfb-field-wrap select,
.gfb-field-wrap textarea {
  display:      block;
  width:        100%;
  padding:      10px 14px;
  border:       1.5px solid var(--gfb-iborder);
  border-radius: var(--gfb-radius);
  background:   var(--gfb-ibg);
  color:        var(--gfb-icolor);
  font-size:    15px;
  font-family:  var(--gfb-font);
  line-height:  1.5;
  box-sizing:   border-box;
  transition:   border-color .15s, box-shadow .15s;
  -webkit-appearance: none;
}

.gfb-input:focus,
.gfb-field-wrap input:focus,
.gfb-field-wrap select:focus,
.gfb-field-wrap textarea:focus {
  outline:      none;
  border-color: var(--gfb-btn-bg);
  box-shadow:   0 0 0 3px var(--gfb-focus);
}

.gfb-field-wrap textarea { resize: vertical; min-height: 120px; }

.gfb-field-wrap select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat:   no-repeat;
  background-position: right 12px center;
  padding-right:       36px;
  cursor:              pointer;
}

/* ── Multi-select ──────────────────────────────────────────── */
.gfb-multiselect { height: auto; min-height: 120px; }

/* ── Radio / Checkbox ──────────────────────────────────────── */
.gfb-radio-group,
.gfb-checkbox-group {
  display: flex; flex-direction: column; gap: 10px;
}

.gfb-choice-label {
  display:     flex;
  align-items: center;
  gap:         10px;
  font-size:   15px;
  font-weight: 400 !important;
  cursor:      pointer;
  padding:     8px 12px;
  border:      1.5px solid transparent;
  border-radius: var(--gfb-radius);
  transition:  background .12s, border-color .12s;
}
.gfb-choice-label:hover { background: #f9fafb; border-color: var(--gfb-iborder); }
.gfb-choice-label input[type=radio]:checked ~ span,
.gfb-choice-label input[type=checkbox]:checked ~ span {
  color: var(--gfb-btn-bg); font-weight: 600;
}
.gfb-choice-label:has(:checked) { background: #eff6ff; border-color: #bfdbfe; }

.gfb-price { color: #059669; font-weight: 600; font-size: 13px; }

/* ── Name fields ───────────────────────────────────────────── */
.gfb-name-fields { display: flex; gap: 10px; flex-wrap: wrap; }
.gfb-name-part   { flex: 1; min-width: 120px; }
.gfb-sub-label   { font-size: 11px; color: #9ca3af; margin-top: 4px; display: block; }
.gfb-name-prefix { max-width: 90px; }

/* ── Address ───────────────────────────────────────────────── */
.gfb-address-fields { display: flex; flex-direction: column; gap: 10px; }
.gfb-address-row    { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gfb-country-wrap { display:flex; flex-direction:column; gap:8px; }
.gfb-country-search { width:100%; }
.gfb-region-wrap { display:flex; flex-direction:column; gap:8px; }
.gfb-state-manual { display:none; }
.gfb-state-toggle {
  align-self:flex-start;
  padding:0;
  border:0;
  background:none;
  color:var(--gfb-btn-bg);
  font-size:12px;
  font-weight:600;
  cursor:pointer;
  text-decoration:underline;
}
.gfb-state-toggle:hover { color:#1d4ed8; }

/* ── Errors ────────────────────────────────────────────────── */
.gfb-field-error {
  display: block;
  font-size: 12px; font-weight: 500; color: var(--gfb-error);
  margin-top: 5px;
}
.gfb-has-error .gfb-input,
.gfb-has-error input:not([type=radio]):not([type=checkbox]):not([type=hidden]),
.gfb-has-error select,
.gfb-has-error textarea {
  border-color: var(--gfb-error) !important;
  box-shadow:   0 0 0 3px rgba(220,38,38,.12) !important;
}

/* ── Section break ─────────────────────────────────────────── */
.gfb-section-break { margin: 8px 0 18px; }
.gfb-section-title { font-size: 17px; font-weight: 700; margin: 0 0 4px; color: var(--gfb-label); }
.gfb-section-desc  { font-size: 14px; color: #6b7280; margin: 0; }

/* ── Upload ────────────────────────────────────────────────── */
.gfb-upload-wrap { position: relative; }
.gfb-upload-hint { font-size: 12px; color: #9ca3af; margin-top: 4px; }

/* ── Consent ───────────────────────────────────────────────── */
.gfb-consent-label { display: flex; align-items: flex-start; gap: 10px; font-weight: 400 !important; font-size: 14px; cursor: pointer; }
.gfb-consent-label input { margin-top: 3px; flex-shrink: 0; }

/* ── Star rating ───────────────────────────────────────────── */
.gfb-rating {
  display: flex; flex-direction: row-reverse; gap: 4px; justify-content: flex-end;
}
.gfb-rating input { display: none; }
.gfb-rating label {
  font-size: 28px; color: #d1d5db; cursor: pointer;
  transition: color .12s, transform .12s;
}
.gfb-rating input:checked ~ label,
.gfb-rating label:hover,
.gfb-rating label:hover ~ label,
.gfb-rating label.hover { color: #f59e0b; transform: scale(1.15); }

/* ── Signature ─────────────────────────────────────────────── */
.gfb-signature-wrap { border: 1.5px solid var(--gfb-iborder); border-radius: var(--gfb-radius); overflow: hidden; }
.gfb-signature-pad  { display: block; width: 100%; cursor: crosshair; touch-action: none; background: #fdfdfd; }
.gfb-sig-clear {
  display: block; width: 100%; padding: 6px;
  background: #f9fafb; border: none; border-top: 1px solid var(--gfb-iborder);
  font-size: 12px; color: #6b7280; cursor: pointer;
  transition: background .12s;
}
.gfb-sig-clear:hover { background: #fee2e2; color: #dc2626; }

/* ── Slider ────────────────────────────────────────────────── */
.gfb-slider-wrap  { display: flex; align-items: center; gap: 12px; }
.gfb-slider       { flex: 1; accent-color: var(--gfb-btn-bg); cursor: pointer; }
.gfb-slider-value { font-weight: 600; min-width: 36px; text-align: right; }

/* ── Password strength ─────────────────────────────────────── */
.gfb-password-strength { margin-top: 8px; }
.gfb-strength-bar      { height: 4px; border-radius: 999px; background: #e5e7eb; transition: width .3s, background .3s; width: 0; }
.gfb-strength-label    { font-size: 12px; font-weight: 600; margin-top: 4px; display: block; }

/* ── List table ────────────────────────────────────────────── */
.gfb-list-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.gfb-list-table th { padding: 6px 8px; background: #f9fafb; border: 1px solid #e5e7eb; font-weight: 600; }
.gfb-list-table td { padding: 4px 6px; border: 1px solid #e5e7eb; }
.gfb-list-input    { width: 100%; border: none; outline: none; font-size: 14px; padding: 4px; }
.gfb-list-del      { background: none; border: none; color: #dc2626; cursor: pointer; font-size: 14px; }
.gfb-btn-add-row   { margin-top: 8px; font-size: 13px; color: var(--gfb-btn-bg); background: none; border: 1px dashed var(--gfb-iborder); padding: 6px 14px; border-radius: var(--gfb-radius); cursor: pointer; }
.gfb-btn-add-row:hover { background: #eff6ff; }

/* ── Pricing ───────────────────────────────────────────────── */
.gfb-product-field  { display: flex; align-items: center; gap: 12px; }
.gfb-product-price  { font-size: 20px; font-weight: 700; color: #059669; }

.gfb-total-display {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px;
  background: #f0fdf4;
  border: 2px solid #bbf7d0;
  border-radius: var(--gfb-radius);
}
.gfb-total-label { font-size: 15px; font-weight: 600; }
.gfb-total-value { font-size: 22px; font-weight: 800; color: #059669; }

/* ── Coupon ────────────────────────────────────────────────── */
.gfb-coupon-wrap     { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.gfb-coupon-input    { flex: 1; min-width: 160px; }
.gfb-coupon-apply    { padding: 10px 18px; background: var(--gfb-btn-bg); color: var(--gfb-btn-fg); border: none; border-radius: var(--gfb-radius); font-size: 14px; font-weight: 600; cursor: pointer; transition: filter .12s; white-space: nowrap; }
.gfb-coupon-apply:hover { filter: brightness(1.1); }
.gfb-coupon-feedback { font-size: 13px; font-weight: 600; }

/* ── Stripe card ───────────────────────────────────────────── */
.gfb-stripe-mount { margin-bottom: var(--gfb-spacing); }
.gfb-stripe-errors { color: var(--gfb-error); font-size: 13px; margin-top: 4px; }

/* ── HTML block ────────────────────────────────────────────── */
.gfb-html-block { margin-bottom: var(--gfb-spacing); font-size: 15px; line-height: 1.6; }

/* ── Navigation ────────────────────────────────────────────── */
.gfb-step-nav,
.gfb-submit-row {
  display: flex; align-items: center; gap: 10px;
  margin-top: 24px; justify-content: flex-end;
}

.gfb-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 26px;
  border: none; border-radius: var(--gfb-radius);
  font-family: var(--gfb-font);
  font-size: 15px; font-weight: 600;
  cursor: pointer;
  transition: background .15s, filter .15s, transform .1s, box-shadow .15s;
  white-space: nowrap;
}
.gfb-btn:active { transform: scale(.98); }

.gfb-btn-prev {
  background: #f3f4f6; color: #374151; border: 1.5px solid #e5e7eb;
}
.gfb-btn-prev:hover { background: #e5e7eb; }

.gfb-btn-next,
.gfb-btn-submit {
  background: var(--gfb-btn-bg); color: var(--gfb-btn-fg);
  box-shadow: 0 2px 6px rgba(37,99,235,.35);
}
.gfb-btn-next:hover,
.gfb-btn-submit:hover { filter: brightness(1.08); box-shadow: 0 4px 12px rgba(37,99,235,.4); }

.gfb-btn-submit.gfb-loading {
  pointer-events: none; opacity: .75;
}
.gfb-btn-submit.gfb-loading::after {
  content: ''; display: inline-block; width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,.4); border-top-color: #fff;
  border-radius: 50%; animation: gfb-spin .7s linear infinite;
  margin-left: 8px; vertical-align: middle;
}
@keyframes gfb-spin { to { transform: rotate(360deg); } }

/* ── Messages ──────────────────────────────────────────────── */
.gfb-messages { margin-bottom: 16px; }

.gfb-message {
  padding: 14px 18px; border-radius: var(--gfb-radius);
  font-size: 15px; font-weight: 500; line-height: 1.5;
}
.gfb-message-success { background: #f0fdf4; color: #14532d; border: 1px solid #bbf7d0; }
.gfb-message-error   { background: #fef2f2; color: #7f1d1d; border: 1px solid #fecaca; }
.gfb-message-info    { background: #eff6ff; color: #1e3a5f; border: 1px solid #bfdbfe; }

/* ── Elementor / Divi placeholders ─────────────────────────── */
.gfb-elementor-placeholder,
.gfb-divi-placeholder,
.gfb-beaver-placeholder,
.gfb-vc-placeholder,
.gfb-oxygen-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 40px; border: 2px dashed #e5e7eb; border-radius: 12px;
  color: #9ca3af; text-align: center;
}
.gfb-elementor-placeholder-icon { font-size: 40px; margin-bottom: 12px; opacity: .5; }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 600px) {
  .gfb-step-nav, .gfb-submit-row { flex-direction: column-reverse; }
  .gfb-btn-prev, .gfb-btn-next, .gfb-btn-submit { width: 100%; }
  .gfb-address-row   { grid-template-columns: 1fr; }
  .gfb-name-fields   { flex-direction: column; }
  .gfb-name-prefix   { max-width: 100%; }
  .gfb-coupon-wrap   { flex-direction: column; }
  .gfb-coupon-input  { width: 100%; }
  .gfb-coupon-apply  { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .gfb-progress-fill, .gfb-btn-submit.gfb-loading::after { transition: none; animation: none; }
}

@media (max-width: 782px) {
  .gfb-fields { grid-template-columns: 1fr; }
  .gfb-field-wrap { grid-column: 1 / -1 !important; }
}
