/**
 * ANHP Studio — Fluent Forms integration
 * Editorial form treatment only. Page layout, navigation and animations stay untouched.
 */

/* -------------------------------------------------------------------------
   FORM SHELL
   Keep a form visually attached to ANHP's editorial grid even when the
   Shortcode block was inserted outside a denovr-shell group in Gutenberg.
   ---------------------------------------------------------------------- */
.fluentform {
  width: min(960px, calc(100% - 64px));
  max-width: 960px;
  margin: clamp(56px, 7vw, 96px) auto clamp(72px, 8vw, 112px) !important;
  color: var(--denovr-ink);
  font-family: var(--denovr-sans);
}

.fluentform .frm-fluent-form,
.fluentform form {
  width: 100%;
  max-width: 100%;
  margin: 0;
}

.fluentform .frm-fluent-form {
  padding: clamp(32px, 4.5vw, 58px);
  border: 1px solid var(--denovr-line);
  border-radius: var(--denovr-radius);
  background: color-mix(in srgb, var(--denovr-bone) 62%, var(--denovr-paper));
  box-shadow: 0 18px 55px rgba(29, 30, 27, .035);
}

/* -------------------------------------------------------------------------
   FIELD RHYTHM
   ---------------------------------------------------------------------- */
.fluentform .ff-el-group {
  margin-bottom: 22px;
}

.fluentform .ff-el-input--label {
  margin-bottom: 8px;
}

.fluentform .ff-el-input--label label,
.fluentform label.ff-el-form-check-label,
.fluentform .ff-el-section-break h3,
.fluentform .ff-el-section-break h4 {
  color: var(--denovr-ink);
}

.fluentform .ff-el-input--label label {
  margin: 0;
  font-size: 10px;
  line-height: 1.4;
  font-weight: 650;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.fluentform .ff-el-input--label.ff-el-is-required label::after,
.fluentform .ff-el-input--label label .ff-el-required,
.fluentform .ff-el-required {
  color: var(--denovr-clay) !important;
}

/* Fields are intentionally quiet boxes: enough structure to read as a form,
   but without bringing Fluent Forms' default dashboard styling into the site. */
.fluentform .ff-el-form-control,
.fluentform input[type="text"],
.fluentform input[type="email"],
.fluentform input[type="tel"],
.fluentform input[type="number"],
.fluentform input[type="url"],
.fluentform input[type="date"],
.fluentform input[type="time"],
.fluentform select,
.fluentform textarea {
  width: 100%;
  min-height: 52px;
  padding: 13px 15px !important;
  border: 1px solid rgba(29, 30, 27, .13) !important;
  border-radius: 12px !important;
  outline: 0 !important;
  background: rgba(251, 250, 247, .78) !important;
  color: var(--denovr-ink) !important;
  box-shadow: none !important;
  font-size: 14px;
  line-height: 1.55;
  transition: border-color .22s ease, background-color .22s ease, box-shadow .22s ease;
}

.fluentform textarea.ff-el-form-control,
.fluentform textarea {
  min-height: 150px;
  resize: vertical;
}

.fluentform .ff-el-form-control::placeholder,
.fluentform input::placeholder,
.fluentform textarea::placeholder {
  color: color-mix(in srgb, var(--denovr-muted) 70%, transparent);
  opacity: 1;
}

.fluentform .ff-el-form-control:hover,
.fluentform input:hover,
.fluentform select:hover,
.fluentform textarea:hover {
  border-color: rgba(29, 30, 27, .27) !important;
  background: rgba(251, 250, 247, .94) !important;
}

.fluentform .ff-el-form-control:focus,
.fluentform input:focus,
.fluentform select:focus,
.fluentform textarea:focus {
  border-color: var(--denovr-ink) !important;
  background: var(--denovr-paper) !important;
  box-shadow: 0 0 0 1px var(--denovr-ink) !important;
}

.fluentform select.ff-el-form-control,
.fluentform select {
  cursor: pointer;
}

/* Fluent Forms' two-column field container aligns to the same architectural grid. */
.fluentform .ff-t-container {
  gap: 14px;
}

.fluentform .ff-t-cell .ff-el-group:last-child {
  margin-bottom: 0;
}

/* Choices */
.fluentform input[type="checkbox"],
.fluentform input[type="radio"] {
  accent-color: var(--denovr-ink);
}

.fluentform .ff-el-form-check {
  margin-bottom: 8px;
}

.fluentform .ff-el-form-check-label {
  font-size: 14px;
  line-height: 1.55;
}

/* -------------------------------------------------------------------------
   ACTION
   ---------------------------------------------------------------------- */
.fluentform .ff-btn,
.fluentform .ff-btn-submit,
.fluentform button[type="submit"],
.fluentform input[type="submit"] {
  min-height: 48px;
  margin-top: 6px;
  padding: 14px 25px !important;
  border: 1px solid var(--denovr-ink) !important;
  border-radius: 999px !important;
  background: var(--denovr-ink) !important;
  color: var(--denovr-paper) !important;
  box-shadow: none !important;
  font-size: 11px !important;
  line-height: 1.2;
  font-weight: 650 !important;
  letter-spacing: .11em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform .25s var(--denovr-ease), opacity .2s ease, background-color .2s ease !important;
}

.fluentform .ff-btn::after,
.fluentform .ff-btn-submit::after,
.fluentform button[type="submit"]::after {
  content: "↗";
  margin-left: 9px;
  font-size: 13px;
}

.fluentform .ff-btn:hover,
.fluentform .ff-btn-submit:hover,
.fluentform button[type="submit"]:hover,
.fluentform input[type="submit"]:hover {
  transform: translateY(-2px);
  opacity: .84;
}

.fluentform .ff-btn:focus-visible,
.fluentform .ff-btn-submit:focus-visible,
.fluentform button[type="submit"]:focus-visible,
.fluentform input[type="submit"]:focus-visible {
  outline: 2px solid var(--denovr-ink);
  outline-offset: 3px;
}

/* -------------------------------------------------------------------------
   VALIDATION / STATUS
   ---------------------------------------------------------------------- */
.fluentform .ff-el-is-error .ff-el-form-control,
.fluentform .ff-el-is-error input,
.fluentform .ff-el-is-error textarea,
.fluentform .ff-el-is-error select {
  border-color: var(--denovr-clay) !important;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--denovr-clay) 38%, transparent) !important;
}

.fluentform .error,
.fluentform .ff-el-is-error .text-danger,
.fluentform .ff-el-is-error .error,
.fluentform .ff-el-form-check-label .error {
  color: var(--denovr-clay) !important;
  font-size: 12px;
}

.fluentform .ff-message-success {
  padding: 22px 24px !important;
  border: 1px solid var(--denovr-line) !important;
  border-radius: 14px !important;
  background: rgba(251,250,247,.74) !important;
  color: var(--denovr-ink) !important;
  box-shadow: none !important;
}

.fluentform .ff-el-help-message,
.fluentform .ff-el-input--content small {
  color: var(--denovr-muted);
  font-size: 12px;
}

/* Keep hidden honeypot / internal plugin elements from affecting rhythm. */
.fluentform .ff-el-group:has(input[type="hidden"]) {
  margin-bottom: 0;
}

@media (max-width: 782px) {
  .fluentform {
    width: calc(100% - 32px);
    margin-top: 44px !important;
    margin-bottom: 64px !important;
  }

  .fluentform .frm-fluent-form {
    padding: 24px 18px;
    border-radius: 18px;
  }

  .fluentform .ff-el-group {
    margin-bottom: 18px;
  }

  .fluentform .ff-t-container {
    display: block !important;
  }

  .fluentform .ff-t-cell + .ff-t-cell {
    margin-top: 18px;
  }

  .fluentform .ff-el-form-control,
  .fluentform input[type="text"],
  .fluentform input[type="email"],
  .fluentform input[type="tel"],
  .fluentform input[type="number"],
  .fluentform input[type="url"],
  .fluentform select,
  .fluentform textarea {
    font-size: 16px; /* prevents iOS zoom */
  }

  .fluentform .ff-btn,
  .fluentform .ff-btn-submit,
  .fluentform button[type="submit"],
  .fluentform input[type="submit"] {
    width: 100%;
    justify-content: center;
  }
}
