.bmews-form-wrap {
  --bmews-accent: #31b1ec;
  --bmews-border: #d0d5dd;
  --bmews-text: #1d2939;
  --bmews-muted: #667085;
  --bmews-error: #b42318;
  --bmews-success: #067647;
  box-sizing: border-box;
  color: var(--bmews-text);
  max-width: 100%;
  width: 100%;
}

.elementor-form {
  --bmews-border: #d0d5dd;
  --bmews-text: #1d2939;
}

.bmews-form-wrap *,
.bmews-form-wrap *::before,
.bmews-form-wrap *::after {
  box-sizing: border-box;
}

.bmews-form {
  display: grid;
  gap: 14px;
  width: 100%;
}

.bmews-field {
  display: grid;
  min-width: 0;
}

/* Keep semantic labels for screen readers while using translated placeholders visually. */
.bmews-field > label {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.bmews-field input[type="text"],
.bmews-field input[type="tel"] {
  background: #fff;
  border: 1px solid var(--bmews-border);
  border-radius: 999px;
  color: var(--bmews-text);
  font: inherit;
  line-height: 1.4;
  min-height: 52px;
  padding: 12px 18px;
  width: 100%;
}

.bmews-field input::placeholder {
  color: var(--bmews-muted);
  opacity: 1;
}

.bmews-field input:focus {
  border-color: var(--bmews-accent);
  box-shadow: 0 0 0 3px rgba(49, 177, 236, 0.18);
  outline: 0;
}

.bmews-field input[aria-invalid="true"] {
  border-color: var(--bmews-error);
}

.bmews-field .iti,
.elementor-form .iti {
  min-width: 0;
  width: 100%;
}

.bmews-field .iti__country-selector,
.elementor-form .iti__country-selector {
  z-index: 100000;
}

/* Neutralise theme button styling: selector stays a plain flag, dial code and arrow. */
.bmews-form .iti__selected-country,
.elementor-form .iti__selected-country {
  appearance: none !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  color: var(--bmews-text) !important;
  cursor: pointer;
  min-height: 0 !important;
  padding: 0 15px 0 0 !important;
}

.bmews-form .iti__selected-country::after,
.elementor-form .iti__selected-country::after {
  background: var(--bmews-border);
  content: "";
  height: 24px;
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
}

.bmews-form .iti__selected-country-primary,
.elementor-form .iti__selected-country-primary {
  background: transparent !important;
  padding-left: 16px;
  padding-right: 13px;
}

.bmews-form .iti__selected-country-primary:hover,
.bmews-form .iti__selected-country[aria-expanded="true"] .iti__selected-country-primary,
.elementor-form .iti__selected-country-primary:hover,
.elementor-form .iti__selected-country[aria-expanded="true"] .iti__selected-country-primary {
  background: transparent !important;
}

.bmews-form .iti__selected-dial-code,
.elementor-form .iti__selected-dial-code {
  color: var(--bmews-text);
  font-weight: 500;
}

.bmews-form .iti__arrow,
.elementor-form .iti__arrow {
  margin-left: 8px;
}

.bmews-submit {
  align-items: center;
  appearance: none;
  background: radial-gradient(107.08% 85.59% at 86.3% 87.5%, rgba(0, 0, 0, 0.23) 0%, rgba(0, 0, 0, 0) 86.18%), radial-gradient(83.94% 83.94% at 26.39% 20.83%, rgba(255, 255, 255, 0.41) 0%, rgba(255, 255, 255, 0) 69.79%, rgba(255, 255, 255, 0) 100%), #31b1ec !important;
  border: 0;
  border-radius: 999px;
  box-shadow: -1.667px -2.222px 3.1px 0 rgba(255, 255, 255, 0.15) inset, 2.222px 10px 30.8px 0 rgba(56, 39, 26, 0.2);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: 700;
  justify-content: center;
  min-height: 52px;
  padding: 12px 24px;
  transition: filter 0.15s ease, opacity 0.15s ease, transform 0.15s ease;
  width: 100%;
}

.bmews-submit:hover {
  filter: brightness(1.04);
  transform: translateY(-1px);
}

.bmews-submit:focus-visible {
  outline: 3px solid rgba(49, 177, 236, 0.35);
  outline-offset: 3px;
}

.bmews-submit:disabled {
  cursor: wait;
  opacity: 0.68;
  transform: none;
}

.bmews-consent {
  color: var(--bmews-muted);
  font: inherit;
  font-size: 13px;
  line-height: 1.45;
}

.bmews-consent label {
  align-items: flex-start;
  cursor: pointer;
  display: flex;
  gap: 9px;
}

.bmews-consent input[type="checkbox"] {
  accent-color: var(--bmews-accent);
  flex: 0 0 auto;
  height: 17px;
  margin: 2px 0 0;
  width: 17px;
}

.bmews-consent input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--bmews-accent);
  outline-offset: 2px;
}

.bmews-consent input[type="checkbox"][aria-invalid="true"] {
  outline: 2px solid var(--bmews-error);
  outline-offset: 2px;
}

.bmews-consent a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.bmews-message {
  font: inherit;
  line-height: 1.45;
  min-height: 1.45em;
}

.bmews-message-error {
  color: var(--bmews-error);
}

.bmews-message-success {
  color: var(--bmews-success);
  font-weight: 600;
}

.bmews-hp {
  height: 1px !important;
  left: -10000px !important;
  overflow: hidden !important;
  position: absolute !important;
  top: auto !important;
  width: 1px !important;
}

.bmews-config-error {
  color: var(--bmews-error, #b42318);
}

/* Tablet: fields share a row; button, consent and feedback remain comfortably wide. */
@media (min-width: 768px) and (max-width: 1023px) {
  .bmews-form {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  }

  .bmews-submit,
  .bmews-consent,
  .bmews-message {
    grid-column: 1 / -1;
  }
}

/* Desktop: both fields and the button stay on row one; consent sits below. */
@media (min-width: 1024px) {
  .bmews-form {
    align-items: center;
    column-gap: 12px;
    grid-template-columns: minmax(160px, 1fr) minmax(260px, 1.35fr) auto;
    row-gap: 10px;
  }

  .bmews-submit {
    grid-column: 3;
    grid-row: 1;
    min-width: 150px;
    width: auto;
  }

  .bmews-consent {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .bmews-message {
    grid-column: 1 / -1;
    grid-row: 3;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bmews-submit {
    transition: none;
  }
}
