/* Modal overlay */
.wrb-modal-overlay {
  position: fixed !important;
  inset: 0 !important;
  z-index: 2147483647 !important;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.wrb-modal-content {
  position: relative;
  background: #fff;
  border-radius: 12px;
  width: 100%;
  max-width: 620px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: wrb-modal-in 0.2s ease;
  font-family: var(--font-body-family, var(--body-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif));
  /* Isolate form fields from theme section CSS variables (e.g. dark footer backgrounds) */
  --section-background-color: #ffffff;
  --section-text-color: #1a1a1a;
}

@keyframes wrb-modal-in {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.wrb-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: none;
  background: #f5f5f5;
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  transition: background 0.15s;
  z-index: 1;
}

.wrb-modal-close:hover {
  background: #e5e5e5;
  color: #333;
}

/* Form container */
.wrb-form-container {
  padding: 32px;
  font-family: inherit;
}

.wrb-form-container h2 {
  margin: 0 0 8px;
  font-size: 24px;
}

.wrb-form-container .wrb-subtitle {
  color: #666;
  margin: 0 0 24px;
  font-size: 16px;
}

/* Fields */
.wrb-field {
  margin-bottom: 16px;
}

.wrb-field label {
  display: block;
  font-weight: 600;
  margin-bottom: 4px;
  font-size: 14px;
}

.wrb-field label .wrb-optional {
  font-weight: 400;
  color: #888;
  font-size: 14px;
}

.wrb-field input,
.wrb-field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 16px;
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color 0.15s;
}

.wrb-modal-content .wrb-field input,
.wrb-modal-content .wrb-field textarea {
  background-color: #ffffff !important;
  color: #1a1a1a !important;
  border-width: 1px;
}

.wrb-field input:focus,
.wrb-field textarea:focus {
  outline: none;
  border-color: #333;
}

.wrb-field--error input,
.wrb-field--error textarea {
  border-color: #d72c0d;
}

.wrb-field--error > label {
  color: #d72c0d;
}

.wrb-field-error-msg {
  font-size: 12px;
  color: #d72c0d;
  margin-top: 4px;
}

.wrb-field textarea {
  resize: vertical;
  min-height: 60px;
}

/* Validation hint */
.wrb-hint {
  font-size: 14px;
  margin-top: 4px;
  min-height: 1.2em;
}

.wrb-hint--loading {
  color: #888;
}

.wrb-hint--success {
  color: #1a7a2e;
}

.wrb-hint--warning {
  color: #a16207;
}

.wrb-hint--error {
  color: #d72c0d;
}

/* Step indicator */
.wrb-step-indicator {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  font-size: 14px;
}

.wrb-step-indicator span {
  padding: 4px 12px;
  border-radius: 99px;
  background: #eee;
  color: #666;
}

.wrb-step-indicator span.wrb-step-active {
  background: #333;
  color: #fff;
}

/* Summary table */
.wrb-summary-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
}

.wrb-summary-table th,
.wrb-summary-table td {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid #eee;
  font-size: 16px;
}

.wrb-summary-table th {
  color: #666;
  font-weight: 600;
  width: 40%;
}

/* Actions */
.wrb-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.wrb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.15s;
}

.wrb-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.wrb-btn-primary {
  background: #000;
  color: #fff;
}

.wrb-btn-primary:hover:not(:disabled) {
  opacity: 0.85;
}

.wrb-btn-secondary {
  background: #eee;
  color: #333;
}

.wrb-btn-secondary:hover {
  background: #ddd;
}

/* Notes */
.wrb-privacy-note {
  font-size: 13px;
  color: #888;
  margin-top: 16px;
  line-height: 1.4;
}

.wrb-privacy-note a {
  color: #555;
  text-decoration: underline;
}

.wrb-legal-note {
  font-size: 13px;
  color: #666;
  margin-top: 12px;
  font-style: italic;
}

/* Success / Error boxes */
.wrb-success-box,
.wrb-error-box {
  padding: 24px;
  border-radius: 8px;
  margin-top: 8px;
}

.wrb-success-box {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
}

.wrb-success-box h3 {
  color: #166534;
  margin: 0 0 12px;
}

.wrb-error-box {
  background: #fef2f2;
  border: 1px solid #fecaca;
}

.wrb-error-box h3 {
  color: #991b1b;
  margin: 0 0 12px;
}

/* Branding footer */
.wrb-branding {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  padding: 14px 0 4px;
  font-size: 13px;
  color: #aaa;
  border-top: 1px solid #f0f0f0;
  margin-top: 16px;
}

.wrb-branding__link {
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: #888;
  font-weight: 600;
}

.wrb-branding__link:hover {
  color: #555;
}

.wrb-branding__logo {
  height: 20px;
  width: auto;
  display: block;
}

.wrb-branding__app {
  font-weight: 600;
  color: #888;
}

.wrb-branding__sep {
  color: #bbb;
  font-size: 12px;
}

.wrb-branding__visionz {
  color: #888;
  text-decoration: none;
  font-weight: 600;
}

.wrb-branding__visionz:hover {
  color: #555;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .wrb-modal-overlay {
    padding: 0;
    align-items: flex-end;
  }

  .wrb-modal-content {
    max-width: 100%;
    max-height: 87vh;
    border-radius: 12px 12px 0 0;
    animation: wrb-modal-in-mobile 0.25s ease;
  }

  @keyframes wrb-modal-in-mobile {
    from {
      transform: translateY(100%);
    }
    to {
      transform: translateY(0);
    }
  }

  .wrb-form-container {
    padding: 24px 20px;
  }

  .wrb-actions {
    flex-direction: column;
  }
}

.wrb-partial-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}

.wrb-partial-checkbox-label input[type="checkbox"] {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

/* Floating button */
.wrb-floating-btn {
  position: fixed;
  bottom: 24px;
  z-index: 9998;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 20px;
  background-color: var(--wrb-brand-color, #000000);
  color: var(--wrb-button-text-color, #ffffff);
  border: var(--wrb-button-border, none);
  border-radius: var(--wrb-button-border-radius, 6px);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  white-space: nowrap;
}

.wrb-floating-btn::before {
  content: "↩";
  font-size: 16px;
  line-height: 1;
}

.wrb-floating-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  opacity: 0.92;
}

.wrb-floating-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.wrb-floating-btn--bottom-right {
  right: 24px;
}

.wrb-floating-btn--bottom-left {
  left: 24px;
}

@media (max-width: 768px) {
  .wrb-floating-btn {
    bottom: 16px;
    padding: 12px 16px;
    font-size: 13px;
  }
  .wrb-floating-btn--bottom-right { right: 16px; }
  .wrb-floating-btn--bottom-left { left: 16px; }
}

/* Merchant logo (Enterprise branding) */
#wrb-merchant-logo-wrap {
  text-align: center;
  margin-bottom: 12px;
}

#wrb-merchant-logo {
  max-width: 120px;
  max-height: 60px;
  height: auto;
  display: inline-block;
  object-fit: contain;
}
