/* ==========================================================================
   Texium Solutions — Form widget
   Field rows wrap via flexbox, each field's flex-basis set inline per
   its own Column Width control (so Elementor's column-width selector
   doesn't need a generated class per percentage). Consumes design
   tokens from theme.css only.
   ========================================================================== */

.texium-form__form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.texium-form__row {
  display: flex;
  flex-wrap: wrap;
  row-gap: 20px;
  column-gap: 20px;
}

.texium-form__field {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex-grow: 1;
}

.texium-form__label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--texium-heading);
}

.texium-form__required {
  margin-left: 2px;
  color: var(--texium-primary);
}

.texium-form__control {
  width: 100%;
  height: 48px;
  padding: 10px 14px;
  font: inherit;
  font-size: 0.9375rem;
  color: var(--texium-heading);
  background-color: var(--texium-surface);
  border: 1px solid var(--texium-border);
  border-radius: 10px;
  transition: border-color var(--texium-transition-fast);
}

textarea.texium-form__control {
  height: auto;
  resize: vertical;
}

.texium-form__control:focus {
  outline: none;
  border-color: var(--texium-primary);
}

.texium-form__control.is-invalid {
  border-color: #D64545;
}

select.texium-form__control {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23667892' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  padding-right: 38px;
}

/* ---- Choice groups (radio/checkbox/acceptance) ---- */

.texium-form__choice-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 4px;
}

.texium-form__choice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--texium-text-muted);
  cursor: pointer;
}

.texium-form__choice input {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--texium-primary);
  cursor: pointer;
}

.texium-form__choice--acceptance {
  padding-top: 4px;
}

/* ---- Field error ---- */

.texium-form__field-error {
  display: block;
  margin-top: 6px;
  font-size: 0.8125rem;
  color: #D64545;
}

.texium-form__field-error:empty {
  display: none;
}

/* ---- Honeypot ----
   Off-screen rather than display:none/visibility:hidden, which some
   spam bots are coded to detect and skip; this still passes a visual
   check while remaining unreachable by tab and silent to screen
   readers. */

.texium-form__honeypot {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---- Submit ---- */

.texium-form__submit-row {
  display: flex;
  justify-content: flex-start;
}

.texium-form__submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 28px;
  font: inherit;
  font-weight: 600;
  color: var(--texium-text-inverse);
  background-color: var(--texium-primary);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background-color var(--texium-transition-fast);
}

.texium-form__submit:hover,
.texium-form__submit:focus-visible {
  background-color: var(--texium-primary-dark);
}

.texium-form__submit:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.texium-form__submit-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: currentColor;
  border-radius: 50%;
}

.texium-form.is-submitting .texium-form__submit-spinner {
  display: inline-block;
  animation: texium-form-spin 700ms linear infinite;
}

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

@media (prefers-reduced-motion: reduce) {
  .texium-form.is-submitting .texium-form__submit-spinner {
    animation: none;
  }
}

/* ---- Messages ---- */

.texium-form__message {
  padding: 14px 16px;
  font-size: 0.9375rem;
  border-radius: 10px;
}

.texium-form__message--success {
  color: #1F9D6B;
  background: #E7F7EF;
}

.texium-form__message--error {
  color: #D64545;
  background: #FBEAEA;
}

.texium-form__message:empty {
  display: none;
}

/* ---- Responsive ----
   Elementor's per-field "Column Width" control is itself responsive
   (register_responsive_control), so the widget already emits narrower
   tablet/mobile inline widths automatically — this just makes sure
   fields never shrink below a usable size however small their
   configured width is. */

@media (max-width: 767px) {
  .texium-form__field {
    flex-basis: 100% !important;
    max-width: 100% !important;
  }
}
