/* Shared form fields — floating labels */

.frogmi-float-field {
  position: relative;
  display: block;
  padding-bottom: 0;
}

.frogmi-float-field input,
.frogmi-float-field select,
.frogmi-float-field textarea {
  box-sizing: border-box;
  width: 100%;
  border: 1px solid #d8e0d9;
  border-radius: 12px;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.frogmi-float-field input,
.frogmi-float-field select {
  min-height: 48px;
  height: 48px;
  padding: 18px 14px 6px;
}

.frogmi-float-field textarea {
  min-height: 120px;
  height: 120px;
  padding: 24px 14px 12px;
  resize: vertical;
}

.frogmi-float-field select {
  color: var(--text);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23666' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

/*
 * CF7 renders selects without the HTML `required` attribute, so `:invalid`
 * never matches and the blank option would print over the floating label.
 * `is-filled` (set from JS) is the reliable signal for both form flavors.
 */
.frogmi-float-field select:invalid,
.frogmi-float-field:not(.is-filled) select {
  color: transparent;
}

.frogmi-float-field.is-filled select {
  color: var(--text);
}

.frogmi-float-field select option {
  color: var(--text);
}

.frogmi-float-field input::placeholder,
.frogmi-float-field textarea::placeholder {
  color: transparent;
}

.frogmi-float-field > label {
  position: absolute;
  left: 14px;
  top: 24px;
  transform: translateY(-50%);
  font-size: 14px;
  font-weight: 400;
  color: #8a8a8a;
  pointer-events: none;
  transition: top 0.2s ease, transform 0.2s ease, font-size 0.2s ease, color 0.2s ease;
  z-index: 1;
}

.frogmi-float-field--textarea > label {
  top: 18px;
  transform: none;
}

.frogmi-float-field input:focus,
.frogmi-float-field select:focus,
.frogmi-float-field textarea:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(81, 186, 92, 0.15);
}

.frogmi-float-field input:focus ~ label,
.frogmi-float-field select:focus ~ label,
.frogmi-float-field textarea:focus ~ label,
.frogmi-float-field:focus-within > label,
.frogmi-float-field.is-filled > label,
.frogmi-float-field input:not(:placeholder-shown) ~ label,
.frogmi-float-field textarea:not(:placeholder-shown) ~ label {
  top: 0;
  transform: translateY(-50%);
  font-size: 12px;
  font-weight: 500;
  color: var(--green);
  background: #fff;
  padding: 0 4px;
}

.frogmi-float-field.is-invalid input,
.frogmi-float-field.is-invalid select,
.frogmi-float-field.is-invalid textarea {
  border-color: #d64545;
  box-shadow: 0 0 0 3px rgba(214, 69, 69, 0.12);
}

.frogmi-float-field.is-invalid > label {
  color: #d64545;
}

.frogmi-field-error {
  position: absolute;
  left: 0;
  bottom: 0;
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  color: #d64545;
  font-weight: 500;
}

.frogmi-field-error[hidden] {
  display: none;
}

.frogmi-combobox .frogmi-combobox__list {
  position: absolute;
  z-index: 20;
  top: calc(100% - 18px);
  left: 0;
  right: 0;
  max-height: 220px;
  overflow-y: auto;
  margin: 0;
  padding: 6px 0;
  list-style: none;
  background: #fff;
  border: 1px solid #d8e0d9;
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(33, 68, 99, 0.1);
}

.frogmi-combobox .frogmi-combobox__list li {
  padding: 10px 14px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
}

.frogmi-combobox .frogmi-combobox__list li:hover,
.frogmi-combobox .frogmi-combobox__list li.is-active {
  background: #f5fbf6;
  color: var(--green-dark);
}

@media (max-width: 768px) {
  .frogmi-float-field input,
  .frogmi-float-field select {
    min-height: 52px;
    height: 52px;
    padding: 20px 14px 8px;
    font-size: 16px;
  }

  .frogmi-float-field textarea {
    min-height: 132px;
    height: 132px;
    padding: 26px 14px 12px;
    font-size: 16px;
  }

  .frogmi-float-field > label {
    font-size: 15px;
  }

  .frogmi-combobox .frogmi-combobox__list {
    max-height: 180px;
  }
}

@media (max-width: 640px) {
  .frogmi-float-field input,
  .frogmi-float-field select,
  .frogmi-float-field textarea {
    border-radius: 10px;
  }

  .frogmi-float-field > label {
    left: 12px;
  }

  .frogmi-field-error {
    font-size: 11px;
  }

  .frogmi-combobox .frogmi-combobox__list li {
    padding: 12px 14px;
    font-size: 15px;
  }
}

/* Contact Form 7 — inherit Frogmi form styling */
.wpcf7 .screen-reader-response {
  position: absolute;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  width: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  white-space: nowrap;
}

.wpcf7 .hidden-fields-container {
  display: none;
  border: 0;
  margin: 0;
  padding: 0;
}

.wpcf7 form {
  margin: 0;
}

.wpcf7 .wpcf7-form-control-wrap {
  display: block;
  position: relative;
  width: 100%;
}

.wpcf7 input.wpcf7-form-control,
.wpcf7 select.wpcf7-form-control,
.wpcf7 textarea.wpcf7-form-control {
  width: 100%;
}

.wpcf7 .wpcf7-not-valid {
  border-color: #d64545 !important;
  box-shadow: 0 0 0 3px rgba(214, 69, 69, 0.12) !important;
}

.wpcf7 .frogmi-float-field:has(.wpcf7-not-valid) {
  border-color: transparent;
}

.wpcf7 .frogmi-float-field:has(.wpcf7-not-valid) > label {
  color: #d64545;
}

.wpcf7-response-output:empty {
  display: none;
  margin: 0;
  padding: 0;
  border: 0;
}

.wpcf7 form.init .wpcf7-response-output,
.wpcf7 form.resetting .wpcf7-response-output,
.wpcf7 form.submitting .wpcf7-response-output {
  display: none;
}

.wpcf7-response-output {
  margin: 16px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.45;
  border: 1px solid #d8e0d9;
}

.wpcf7 form.sent .wpcf7-response-output {
  border-color: #b8e0bc;
  background: #f5fbf6;
  color: #2f6b36;
}

.wpcf7 form.invalid .wpcf7-response-output,
.wpcf7 form.failed .wpcf7-response-output {
  border-color: #efb4b4;
  background: #fff5f5;
  color: #a33030;
}

/* CF7 ships its own spinner styles, but wpcf7_load_css is disabled in this
   theme, so the whole submitting state has to be defined here. */
.wpcf7-spinner {
  display: none;
  flex: 0 0 auto;
  align-self: center;
  box-sizing: border-box;
  width: 18px;
  height: 18px;
  margin-left: 10px;
  vertical-align: middle;
  border: 2px solid rgba(47, 107, 54, 0.25);
  border-top-color: #2f6b36;
  border-radius: 50%;
}

.wpcf7 form.submitting .wpcf7-spinner {
  display: inline-block;
  animation: frogmi-spinner 0.7s linear infinite;
}

@keyframes frogmi-spinner {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .wpcf7 form.submitting .wpcf7-spinner {
    animation-duration: 2.4s;
  }
}

.wpcf7 form.submitting .wpcf7-submit,
.wpcf7 .wpcf7-submit[data-frogmi-locked] {
  opacity: 0.6;
  cursor: progress;
  pointer-events: none;
}

.wpcf7 .frogmi-blog-page__newsletter-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.wpcf7 .frogmi-blog-page__newsletter-check input {
  margin-top: 4px;
}

.wpcf7 .frogmi-blog-page__newsletter-actions {
  margin-top: 8px;
}

.wpcf7 input[type="file"].frogmi-file-input__native {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.frogmi-file-input__control {
  position: relative;
}

.frogmi-file-input__control > .wpcf7-form-control-wrap {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.frogmi-file-input__control > .wpcf7-form-control-wrap input[type="file"].wpcf7-form-control {
  width: 1px !important;
  height: 1px !important;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  box-shadow: none !important;
}

.frogmi-file-input__button,
.frogmi-file-input__name {
  position: relative;
  z-index: 1;
}

.wpcf7 .wpcf7-form-control-wrap .wpcf7-not-valid-tip {
  position: absolute;
  left: 0;
  top: calc(100% + 2px);
  margin: 0;
  font-size: 11px;
  line-height: 1.35;
  font-weight: 500;
  color: #d64545;
}

.wpcf7 .frogmi-float-field input.wpcf7-form-control:focus,
.wpcf7 .frogmi-float-field select.wpcf7-form-control:focus,
.wpcf7 .frogmi-float-field textarea.wpcf7-form-control:focus {
  outline: none;
  border-color: var(--green, #51ba5c);
  box-shadow: 0 0 0 3px rgba(81, 186, 92, 0.15);
}

/* Product solution pages — compact form on colored card */
[class*="-page-wrap"] .frogmi-product-contact-form {
  margin-top: 32px;
}

[class*="-page-wrap"] .frogmi-product-contact-form .frogmi-float-field:focus-within > label,
[class*="-page-wrap"] .frogmi-product-contact-form .frogmi-float-field.is-filled > label,
[class*="-page-wrap"] .frogmi-product-contact-form .frogmi-float-field.is-invalid > label {
  top: 7px;
  transform: none;
  background: transparent;
  padding: 0;
  font-size: 10px;
  line-height: 1;
}

[class*="-page-wrap"] .frogmi-product-contact-form .frogmi-float-field--textarea:focus-within > label,
[class*="-page-wrap"] .frogmi-product-contact-form .frogmi-float-field--textarea.is-filled > label,
[class*="-page-wrap"] .frogmi-product-contact-form .frogmi-float-field--textarea.is-invalid > label {
  top: 10px;
}

[class*="-page-wrap"] .frogmi-product-contact-form .frogmi-contact-page__form-actions {
  display: block;
  width: 25%;
  margin: auto;
  margin-top: 8px;
}

[class*="-page-wrap"] .frogmi-product-contact-form .frogmi-contact-page__submit {
  display: flex;
  width: 100%;
  justify-content: center;
}
