.isxf-form-container {
  margin: 0 auto;
  font-family: inherit;
  color: #1f2937;
}

.isxf-form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px 24px;
}

.isxf-col-100 {
  grid-column: span 2;
}

.isxf-col-50 {
  grid-column: span 1;
}

@media (max-width: 650px) {
  .isxf-col-50 {
    grid-column: span 2;
  }
}

.isxf-form-heading {
  margin: 32px 0 8px 0;
  font-size: 18px;
  font-weight: 700;
  color: #111827;
}

.isxf-col-100:first-child .isxf-form-heading {
  margin-top: 0;
}

.isxf-field-wrapper {
  position: relative;
  box-sizing: border-box;
}

.isxf-form-container label.isxf-field-label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 14px;
  color: #1f2937;
}

.isxf-req-mark {
  color: #ef4444;
  font-weight: bold;
  margin-left: 2px;
}

/* Radio/checkbox groups use fieldset/legend semantics (Phase 2.6); reset
   the UA fieldset chrome so the layout matches the old plain div. */
.isxf-choice-fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}

.isxf-form-container legend.isxf-field-label {
  display: block;
  margin-bottom: 6px;
  padding: 0;
  font-weight: 600;
  font-size: 14px;
  color: #1f2937;
}

/* Inline per-field error message (filled by JS, linked via
   aria-describedby). */
.isxf-field-error {
  margin: 6px 0 0;
  font-size: 13px;
  font-weight: 500;
  color: #ef4444;
}

.isxf-field-error[hidden],
.isxf-submit-hint[hidden] {
  display: none;
}

.isxf-form-container .isxf-field-has-error input:not([type="radio"]):not([type="checkbox"]),
.isxf-form-container .isxf-field-has-error select,
.isxf-form-container .isxf-field-has-error textarea {
  border-color: #ef4444;
}

.isxf-form-container .isxf-field-has-error input:focus,
.isxf-form-container .isxf-field-has-error select:focus,
.isxf-form-container .isxf-field-has-error textarea:focus {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

/* Visible explanation for the disabled submit button; JS hides it once
   all required fields are filled. */
.isxf-submit-hint {
  margin: 16px 0 0;
  font-size: 13px;
  color: #6b7280;
  text-align: center;
}

.isxf-checkbox-group,
.isxf-radio-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
  min-height: 40px;
}

.isxf-radio-group label,
.isxf-checkbox-group label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 14px;
}

.isxf-radio-group input[type="radio"] {
  -webkit-appearance: radio;
  appearance: radio;
  width: 16px;
  height: 16px;
  margin: 0;
}

.isxf-form-container input:not([type="radio"]):not([type="checkbox"]),
.isxf-form-container select,
.isxf-form-container textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  box-sizing: border-box;
  transition: all 0.2s ease;
  background: #fff;
  font-size: 15px;
  color: #374151;
  box-shadow: none;
}

.isxf-form-container input::placeholder,
.isxf-form-container textarea::placeholder {
  color: #9ca3af;
  font-weight: 400;
}

.isxf-form-container input:focus,
.isxf-form-container select:focus,
.isxf-form-container textarea:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.15);
  outline: none;
}

.isxf-modern-date {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" fill="%239ca3af" viewBox="0 0 16 16"><path d="M3.5 0a.5.5 0 0 1 .5.5V1h8V.5a.5.5 0 0 1 1 0V1h1a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h1V.5a.5.5 0 0 1 .5-.5zM1 4v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V4H1z"/></svg>');
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px !important;
  cursor: pointer;
}

/* .isxf-form-container prefix: beat theme/page-builder button rules
   (e.g. Elementor's .elementor-kit-N button at 0-1-1). */
.isxf-form-container .isxf-submit-btn {
  background: var(--isxf-btn-bg, #0f172a);
  color: var(--isxf-btn-color, #fff);
  padding: 14px 24px;
  border: none;
  border-radius: var(--isxf-btn-radius, 6px);
  cursor: pointer;
  font-size: var(--isxf-btn-font-size, 16px);
  font-weight: 600;
  width: 100%;
  transition: background 0.3s;
  margin-top: 30px;
}

/* 'form' in the selector lifts specificity past page-builder hover rules
   (e.g. Elementor's .elementor-kit-N button:hover at 0-2-1). */
.isxf-form-container form .isxf-submit-btn:hover {
  background: var(--isxf-btn-bg-hover, #1e293b);
  border: none;
  border-radius: var(--isxf-btn-radius, 6px);
}

.isxf-form-container .isxf-submit-btn:disabled {
  background: var(--isxf-btn-bg, #9ca3af) !important;
  cursor: not-allowed;
  opacity: 0.55;
}

.isxf-toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  width: max-content;
  max-width: calc(100vw - 32px);
  pointer-events: none;
}

.isxf-toast {
  /* Same colours as the "connected" pill badge: soft tint, light border,
     dark text of the same hue. */
  --isxf-toast-accent: #16a34a;
  --isxf-toast-soft: #e6f7ec;
  --isxf-toast-line: #a7f3d0;
  --isxf-toast-ink: #067a56;
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 380px;
  max-width: 100%;
  padding: 14px 14px 16px 16px;
  overflow: hidden;
  border: 1px solid var(--isxf-toast-line);
  border-radius: 14px;
  background: var(--isxf-toast-soft);
  color: var(--isxf-toast-ink);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.05),
    0 12px 32px -8px rgba(15, 23, 42, 0.22);
  opacity: 0;
  transform: translateY(16px) scale(0.98);
  transition:
    opacity 0.3s ease,
    transform 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.2);
  pointer-events: auto;
}

.isxf-toast.error {
  --isxf-toast-accent: #db0000;
  --isxf-toast-soft: #ffe8e8;
  --isxf-toast-line: #f0b8b8;
  --isxf-toast-ink: #b00000;
}

.isxf-toast.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.isxf-toast.hide {
  opacity: 0;
  transform: translateY(8px) scale(0.98);
}

.isxf-toast-icon {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--isxf-toast-accent);
  color: #fff;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--isxf-toast-accent) 18%, transparent);
}

.isxf-toast-icon svg {
  width: 18px;
  height: 18px;
}

.isxf-toast-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 5px;
}

.isxf-toast-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--isxf-toast-ink);
}

.isxf-toast-text {
  color: var(--isxf-toast-ink);
  opacity: 0.85;
  overflow-wrap: anywhere;
}

.isxf-toast-close {
  flex: none;
  width: 28px;
  height: 28px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--isxf-toast-ink);
  opacity: 0.6;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.isxf-toast-close:hover {
  background: color-mix(in srgb, var(--isxf-toast-accent) 12%, transparent);
  opacity: 1;
}

.isxf-toast-close:focus-visible {
  outline: 2px solid var(--isxf-toast-accent);
  outline-offset: 1px;
}

/* Countdown until the toast closes itself; pauses on hover / focus. */
.isxf-toast-bar {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 100%;
  background: var(--isxf-toast-accent);
  opacity: 0.85;
  transform-origin: left;
  animation: isxf-toast-countdown var(--isxf-toast-duration, 4500ms) linear forwards;
}

.isxf-toast.paused .isxf-toast-bar {
  animation-play-state: paused;
}

@keyframes isxf-toast-countdown {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

@media (max-width: 480px) {
  .isxf-toast-container {
    left: 16px;
    right: 16px;
    bottom: 16px;
    transform: none;
    width: auto;
    max-width: none;
  }

  .isxf-toast {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .isxf-toast,
  .isxf-toast.show,
  .isxf-toast.hide {
    transition: opacity 0.2s ease;
    transform: none;
  }

  .isxf-toast-bar {
    animation: none;
    display: none;
  }
}

.isxf-spinner {
  display: none;
  width: 18px;
  height: 18px;
  margin-right: 10px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: isxf-spin 0.8s linear infinite;
  vertical-align: middle;
}

@keyframes isxf-spin {
  to {
    transform: rotate(360deg);
  }
}

.isxf-submit-btn.is-loading .isxf-spinner {
  display: inline-block;
}
