/**
 * Frontend form styles - BEM, Bootstrap grid compatible.
 *
 * @package TWB_Forms
 * @author  The Web Bakery
 */
/**
 * Breakpoint mixins - Bootstrap 5 compatible.
 * Synced with starter-thema breakpoints.
 *
 * @package TWB_Forms
 * @author  The Web Bakery
 */
.twb-form__fields {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.twb-form__row {
  margin-bottom: 0;
}
.twb-form__col {
  margin-bottom: 0;
}
.twb-form__field--required .twb-form__label::after {
  content: "";
}
.twb-form__label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: #0f172a;
}
.twb-form__required {
  color: #dc2626;
}
.twb-form__input {
  width: 100%;
  max-width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 1rem;
  line-height: 1.5;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.twb-form__input:focus {
  border-color: #0f766e;
  outline: none;
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.2);
}
.twb-form__input::placeholder {
  color: #64748b;
}
.twb-form__textarea {
  min-height: 120px;
  resize: vertical;
}
.twb-form__select {
  appearance: auto;
  cursor: pointer;
}
.twb-form__choices {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}
.twb-form__choice {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}
.twb-form__file {
  padding: 0.25rem 0;
}
span.twb-form__verror {
  display: block;
  margin-top: 0.375rem;
  font-size: 0.875rem;
  color: #dc2626;
  line-height: 1.4;
}
.twb-form__section {
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e2e8f0;
}
.twb-form__section-title {
  margin: 0 0 0.5rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: #0f172a;
}
.twb-form__section-desc {
  margin: 0;
  color: #64748b;
}
.twb-form__submit {
  padding: 0.75rem 1.5rem;
  background: #0f766e;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}
.twb-form__submit:hover:not(:disabled) {
  background: #0d9488;
  transform: translateY(-1px);
}
.twb-form__submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.twb-form__submit--has-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.twb-form__submit-icon {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}
.twb-form__submit-icon svg {
  width: 1.125em;
  height: 1.125em;
  fill: currentColor;
}
.twb-form__submit--outline {
  background: transparent;
  color: #0f766e;
  border: 2px solid #0f766e;
}
.twb-form__submit--outline:hover:not(:disabled) {
  background: #0f766e;
  color: #fff;
}
.twb-form__submit--flat {
  background: transparent;
  color: #0f766e;
  border: none;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.twb-form__submit--flat:hover:not(:disabled) {
  color: #0d9488;
  background: transparent;
}
.twb-form__submit--sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}
.twb-form__submit--lg {
  padding: 1rem 2rem;
  font-size: 1.125rem;
}
.twb-form__submit--full {
  width: 100%;
  justify-content: center;
}
.twb-form__submit--loading {
  pointer-events: none;
  position: relative;
}
.twb-form__submit--loading::after {
  content: '';
  display: inline-block;
  width: 1em;
  height: 1em;
  margin-left: 0.5rem;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: twb-spin 0.6s linear infinite;
}
@keyframes twb-spin {
  to { transform: rotate(360deg); }
}
.twb-form__field--invalid .twb-form__input,
.twb-form__field--invalid .twb-form__select,
.twb-form__field--invalid .twb-form__textarea {
  border-color: #dc2626;
}
.twb-form__field--invalid .twb-form__input:focus,
.twb-form__field--invalid .twb-form__select:focus,
.twb-form__field--invalid .twb-form__textarea:focus {
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.2);
}
.twb-form__field--valid .twb-form__input,
.twb-form__field--valid .twb-form__select,
.twb-form__field--valid .twb-form__textarea {
  border-color: #059669;
}
.twb-form__field--valid .twb-form__input:focus,
.twb-form__field--valid .twb-form__select:focus,
.twb-form__field--valid .twb-form__textarea:focus {
  box-shadow: 0 0 0 2px rgba(5, 150, 105, 0.2);
}
.twb-form__messages {
  display: none;
  margin-top: 1.25rem;
  padding: 1rem 1.25rem;
  border-radius: 6px;
  font-size: 0.9375rem;
  line-height: 1.5;
}
.twb-form__messages--error {
  display: block;
  background: #fef2f2;
  border: 1px solid #dc2626;
  color: #dc2626;
}
.twb-form__messages--success {
  display: block;
  background: #f0fdf4;
  border: 1px solid #059669;
  color: #059669;
}

/* Hide labels */
.twb-form--hide-labels .twb-form__label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Floating labels */
.twb-form__field--floating .twb-form__input-wrap {
  position: relative;
}
.twb-form__field--floating .twb-form__label {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  transform-origin: left top;
  margin: 0;
  padding: 0;
  font-weight: 500;
  color: #64748b;
  pointer-events: none;
  transition: transform 0.2s, color 0.2s;
}
.twb-form__field--floating .twb-form__input,
.twb-form__field--floating .twb-form__select {
  padding-top: 1.25rem;
}
.twb-form__field--floating .twb-form__input:focus ~ .twb-form__label,
.twb-form__field--floating .twb-form__input:not(:placeholder-shown) ~ .twb-form__label,
.twb-form__field--floating .twb-form__select:focus ~ .twb-form__label,
.twb-form__field--floating .twb-form__select:valid ~ .twb-form__label {
  transform: translateY(-1.5rem) scale(0.85);
  color: #0f766e;
}
.twb-form__field--floating .twb-form__textarea ~ .twb-form__label {
  top: 1.25rem;
  transform: none;
}
.twb-form__field--floating .twb-form__textarea:focus ~ .twb-form__label,
.twb-form__field--floating .twb-form__textarea:not(:placeholder-shown) ~ .twb-form__label {
  transform: translateY(-1.5rem) scale(0.85);
  color: #0f766e;
}
.twb-form__field--floating .twb-form__input::placeholder {
  color: transparent;
}

/* Honeypot anti-spam */
.twb-form__hp {
  position: absolute;
  left: -9999px;
  top: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  z-index: -1;
}

@media (max-width: 991.98px) {
  .twb-form__fields {
    gap: 1rem;
  }
  .twb-form__field {
    margin-bottom: 0.5rem;
  }
}
