/**
 * Bootstrap Fallback Styles for Unthemed Forms
 *
 * These styles apply when no form theme is assigned (gf-no-theme class).
 * Provides Bootstrap-based styling as a sensible default for forms without custom themes.
 *
 * Architecture:
 * - Scoped entirely within .gf-no-theme class
 * - Uses data attributes for element targeting (data-gf-field-type, data-gf-button-type, data-gf-element)
 * - Only loads when form has no theme assigned
 * - Bootstrap 5 color palette used for consistency
 *
 * Note: Most form styles are provided by Bootstrap classes:
 * - Text inputs use .form-control
 * - Textareas use .form-control
 * - Select dropdowns use .form-select
 * - Buttons use .btn, .btn-primary, .btn-secondary
 * - Alerts use .alert, .alert-success
 *
 * This file only provides custom styling not covered by Bootstrap defaults.
 */

/* =========================================================
   Font size hierarchy — no-theme forms only
   Prevents the form from inheriting oversized fonts from
   the site theme. All sizes are capped; themes handle their
   own typography independently.
   ========================================================= */

/* Form title */
.gf-no-theme [data-gf-element="form-title"] {
  font-size: max(clamp(1.25rem, 2.5vw, 1.75rem), 20px) !important;
  line-height: 1.3 !important;
}

/* Form description */
.gf-no-theme [data-gf-element="form-description"] {
  font-size: max(0.9375rem, 15px) !important;
  line-height: 1.6 !important;
}

/* Page heading */
.gf-no-theme [data-gf-element="page-heading"] {
  font-size: max(clamp(1rem, 2vw, 1.25rem), 16px) !important;
  line-height: 1.35 !important;
}

/* Page description */
.gf-no-theme [data-gf-element="page-description"] {
  font-size: max(0.875rem, 14px) !important;
  line-height: 1.6 !important;
}

/* Row heading */
.gf-no-theme [data-gf-element="row-heading"] {
  font-size: max(0.9375rem, 15px) !important;
  line-height: 1.4 !important;
}

/* Row description */
.gf-no-theme [data-gf-element="row-description"] {
  font-size: max(0.8125rem, 13px) !important;
  line-height: 1.5 !important;
}

/* Field labels */
.gf-no-theme [data-gf-element="label"] {
  font-size: max(0.875rem, 14px) !important;
  font-weight: 600 !important;
  line-height: 1.4 !important;
}

/* Field descriptions */
.gf-no-theme [data-gf-element="description"] {
  font-size: max(0.8125rem, 13px) !important;
  line-height: 1.5 !important;
}

/* All text-like inputs, textarea, select */
.gf-no-theme .form-control,
.gf-no-theme .form-select {
  font-size: max(0.9375rem, 15px) !important;
  line-height: 1.5 !important;
}

/* Checkbox and radio labels */
.gf-no-theme .form-check-label,
.gf-no-theme [data-gf-element="checkbox-label"] {
  font-size: max(0.875rem, 14px) !important;
  font-weight: 500 !important;
  line-height: 1.5 !important;
}

/* Button labels (previous, next, submit) */
.gf-no-theme [data-gf-button-type] .action-btn-label,
.gf-no-theme [data-gf-button-type] {
  font-size: max(0.9375rem, 15px) !important;
}

/* No-theme button sizing/rhythm stays GriffinForms-owned while color language stays theme-owned */
.gf-no-theme [data-gf-button-type] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0.625rem 1rem;
  line-height: 1.35 !important;
  font-weight: 600;
  text-decoration: none;
  vertical-align: middle;
}

.gf-no-theme [data-gf-button-type] .action-btn-label {
  line-height: inherit;
}

.gf-no-theme [data-gf-button-type="previous"],
.gf-no-theme [data-gf-button-type="review-back"] {
  font-weight: 500;
}

.gf-no-theme .griffinforms-button-row,
.gf-no-theme .griffinforms-payment-review-actions {
  align-items: center;
  gap: 0.75rem !important;
}

/* Field-level validation errors */
.gf-no-theme [data-gf-element="error"] {
  font-size: max(0.8125rem, 13px) !important;
  line-height: 1.5 !important;
}

.gf-no-theme .griffinforms-alert-required,
.gf-no-theme .griffinforms-alert-pattern,
.gf-no-theme .griffinforms-alert-db-validate,
.gf-no-theme .griffinforms-alert-invalid,
.gf-no-theme .griffinforms-alert-min-char,
.gf-no-theme .griffinforms-alert-max-char,
.gf-no-theme .griffinforms-alert-min-no,
.gf-no-theme .griffinforms-alert-max-no,
.gf-no-theme .griffinforms-payment-inline-error,
.gf-no-theme .griffinforms-payment-group-error {
  margin-top: 0.375rem;
  font-weight: 500;
}

/* Page-level alert (validation summary) */
.gf-no-theme .griffinforms-formpage-alert,
.gf-no-theme .griffinforms-form-alert {
  font-size: max(0.875rem, 14px) !important;
  line-height: 1.5 !important;
  margin: 0 0 1rem;
  padding: 0.75rem 0.875rem;
  border: 1px solid rgba(220, 53, 69, 0.18);
  border-radius: 0.625rem;
  background: rgba(220, 53, 69, 0.08);
  color: #842029;
  font-weight: 500;
}

/* Hydration / warning notices */
.gf-no-theme [data-gf-element="hydration-notice"] {
  font-size: max(0.8125rem, 13px) !important;
  line-height: 1.5 !important;
}

/* Compliance IP notice */
.gf-no-theme [data-gf-element="compliance-ip-notice"] {
  font-size: max(0.8125rem, 13px) !important;
  line-height: 1.5 !important;
}

/* Floating labels (address sub-fields) */
.gf-no-theme .form-floating > label,
.gf-no-theme [data-gf-element="floating-label"] {
  font-size: max(0.875rem, 14px) !important;
  font-weight: 400 !important;
  line-height: 1.25 !important;
}

/* Likert column headers and row labels */
.gf-no-theme .gf-likert-table thead th,
.gf-no-theme .gf-likert-table .gf-likert-row-label {
  font-size: max(0.875rem, 14px) !important;
}

.gf-no-theme .gf-likert-table {
  border: 1px solid #dee2e6;
  border-radius: 0.75rem;
  background: #fff;
}

.gf-no-theme .gf-likert-table thead th {
  background: rgba(0, 0, 0, 0.025);
}

.gf-no-theme .gf-likert-table thead th:first-child {
  border-top-left-radius: 0.75rem;
}

.gf-no-theme .gf-likert-table thead th:last-child {
  border-top-right-radius: 0.75rem;
}

.gf-no-theme .gf-likert-table tbody tr:last-child td:first-child {
  border-bottom-left-radius: 0.75rem;
}

.gf-no-theme .gf-likert-table tbody tr:last-child td:last-child {
  border-bottom-right-radius: 0.75rem;
}

/* Rating step labels */
.gf-no-theme .gf-rating-label {
  font-size: max(0.875rem, 14px) !important;
}

/* Iteration add / delete buttons */
.gf-no-theme [data-gf-element="iteration-add"],
.gf-no-theme [data-gf-element="iteration-delete"] {
  font-size: max(0.875rem, 14px) !important;
  line-height: 1.4;
  font-weight: 500;
  text-underline-offset: 0.18em;
}

/* Payment card typography */
.gf-no-theme .griffinforms-payment-name,
.gf-no-theme .griffinforms-payment-price {
  font-size: max(0.9375rem, 15px) !important;
}

.gf-no-theme .griffinforms-payment-description {
  font-size: max(0.875rem, 14px) !important;
  line-height: 1.55 !important;
}

/* Payment fixed quantity note */
.gf-no-theme .griffinforms-payment-qty-fixed {
  font-size: max(0.8125rem, 13px) !important;
  line-height: 1.5 !important;
}

/* Payment cart empty state */
.gf-no-theme .griffinforms-payment-cart-empty {
  font-size: max(0.8125rem, 13px) !important;
  line-height: 1.5 !important;
}

/* Payment cart summary typography */
.gf-no-theme .griffinforms-payment-cart-item,
.gf-no-theme .griffinforms-payment-summary-row,
.gf-no-theme .griffinforms-payment-summary-label,
.gf-no-theme .griffinforms-payment-summary-amount {
  font-size: max(0.9rem, 14px) !important;
  line-height: 1.5 !important;
}

.gf-no-theme .griffinforms-payment-summary-total,
.gf-no-theme .griffinforms-payment-summary-total .griffinforms-payment-summary-label,
.gf-no-theme .griffinforms-payment-summary-total .griffinforms-payment-summary-amount {
  font-size: max(1rem, 16px) !important;
}

/* Form lock overlay typography */
.gf-no-theme .griffinforms-form-lock-card {
  font-size: max(0.9rem, 14px) !important;
  line-height: 1.4 !important;
}

/* Success message */
.gf-no-theme [data-gf-element="success-message"] {
  font-size: max(0.9375rem, 15px) !important;
  line-height: 1.6 !important;
}

/* =========================================================
   End font size hierarchy
   ========================================================= */

/* Checkbox and Radio Inputs */
.gf-no-theme .griffinforms-frontend-checkbox-input,
.gf-no-theme .griffinforms-frontend-radio-input,
.gf-no-theme .gf-checkbox-radio-input,
.gf-no-theme .griffinforms-payment-toggle,
.gf-no-theme .griffinforms-payment-gateway-radio,
.gf-no-theme .gf-likert-table input[type="radio"] {
  accent-color: inherit;
  cursor: pointer;
}

/* Phone input group sizing for no-theme forms */
.gf-no-theme .griffinforms-phone-input-group .griffinforms-phone-country-select {
  flex: 0 0 28% !important;
  max-width: 28% !important;
  width: 28% !important;
  max-width: 180px !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background-color: rgba(0, 0, 0, 0.05) !important;
  padding-right: 2.25rem !important;
}

.gf-no-theme .griffinforms-phone-input-group .griffinforms-phone-country-select[data-gf-phone-display-mode="flag_code_name"] {
  flex: 0 0 35% !important;
  max-width: 35% !important;
  width: 35% !important;
  min-width: 140px !important;
  max-width: 220px !important;
}

.gf-no-theme .griffinforms-phone-input-group .griffinforms-phone-country-select[data-gf-phone-display-mode="flag_code"] {
  flex: 0 0 28% !important;
  max-width: 28% !important;
  width: 28% !important;
  min-width: 120px !important;
  max-width: 180px !important;
}

.gf-no-theme .griffinforms-phone-input-group .griffinforms-phone-country-select[data-gf-phone-display-mode="code_only"] {
  flex: 0 0 16% !important;
  max-width: 16% !important;
  width: 16% !important;
  min-width: 76px !important;
  max-width: 110px !important;
}

/* No-theme steppers keep the shared logic but tighten state presentation */
.gf-no-theme .griffinforms-progress-bar {
  margin-bottom: 1.25rem;
}

.gf-no-theme .griffinforms-progress-bar__label {
  font-size: max(0.8125rem, 13px);
  line-height: 1.35;
  font-weight: 500;
}

.gf-no-theme .griffinforms-progress-bar__step[data-gf-progress-state="active"] .griffinforms-progress-bar__label,
.gf-no-theme .griffinforms-progress-bar__step[data-gf-progress-state="complete"] .griffinforms-progress-bar__label {
  font-weight: 600;
}

.gf-no-theme .griffinforms-progress-bar[data-gf-progress-style="stepper"] .griffinforms-progress-bar__marker {
  box-shadow: inset 0 0 0 1px rgba(108, 117, 125, 0.22);
}

.gf-no-theme .griffinforms-progress-bar[data-gf-progress-style="stepper"] .griffinforms-progress-bar__step[data-gf-progress-state="upcoming"] .griffinforms-progress-bar__marker {
  background: #fff;
  color: #6c757d;
  box-shadow: inset 0 0 0 1px rgba(108, 117, 125, 0.35);
}

.gf-no-theme .griffinforms-progress-bar[data-gf-progress-style="tabs"] .griffinforms-progress-bar__step {
  border-color: rgba(108, 117, 125, 0.22);
  border-radius: 0.875rem;
  padding: 0.625rem 0.875rem;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.gf-no-theme .griffinforms-progress-bar[data-gf-progress-style="tabs"] .griffinforms-progress-bar__step[data-gf-progress-state="active"] {
  border-color: rgba(13, 110, 253, 0.34);
  background: rgba(13, 110, 253, 0.08);
  box-shadow: 0 0 0 1px rgba(13, 110, 253, 0.08);
}

.gf-no-theme .griffinforms-progress-bar[data-gf-progress-style="tabs"] .griffinforms-progress-bar__step[data-gf-progress-state="complete"] {
  border-color: rgba(13, 110, 253, 0.2);
}

/* Remove the no-theme card-floor so sparse payment cards do not carry blank space */
.gf-no-theme .griffinforms-payment-layout-cards .griffinforms-payment-card {
  min-height: 0;
}

/* Narrow-container responsive helpers for no-theme forms */
.gf-no-theme.gf-xs [data-gf-row="container"],
.gf-no-theme.gf-sm [data-gf-row="container"] {
  flex-direction: column !important;
}

.gf-no-theme.gf-xs .griffinforms-formpage-child,
.gf-no-theme.gf-sm .griffinforms-formpage-child {
  width: 100% !important;
  max-width: 100% !important;
}

.gf-no-theme.gf-xs .griffinforms-button-row,
.gf-no-theme.gf-sm .griffinforms-button-row {
  flex-direction: column !important;
  gap: 12px !important;
}

.gf-no-theme.gf-xs .griffinforms-button-row > *,
.gf-no-theme.gf-sm .griffinforms-button-row > * {
  width: 100% !important;
}

.gf-no-theme.gf-xs .griffinforms-payment-review-actions,
.gf-no-theme.gf-sm .griffinforms-payment-review-actions {
  flex-direction: column !important;
  gap: 12px !important;
}

.gf-no-theme.gf-xs .griffinforms-payment-review-actions > *,
.gf-no-theme.gf-sm .griffinforms-payment-review-actions > * {
  width: 100% !important;
}

.gf-no-theme.gf-xs .gf-address-wrapper .row > [class*="col-"],
.gf-no-theme.gf-sm .gf-address-wrapper .row > [class*="col-"] {
  flex: 0 0 100% !important;
  max-width: 100% !important;
}
