/**
 * Megasafe Forms — front-end styling.
 *
 * Deliberately neutral: inherits the theme's font stack and sits comfortably
 * inside an Elementor page without fighting it. Uses CSS custom properties so
 * the accent colour can be retuned in one place.
 */

.msf-form-wrap {
  --msf-accent: #f0cc5a;
  --msf-accent-ink: #3d2610;
  --msf-border: #cbcbcb;
  --msf-border-focus: #1f2933;
  --msf-error: #dc2626;
  --msf-radius: 10px;

  font-family: inherit;
  color: inherit;
  max-width: 860px;
  margin: 0 auto;
}

/* Themes frequently ship broad rules like `div { display: block }` that override
   the HTML `hidden` attribute. Without this, the success panel and error box
   render on page load — which looks like a form that already submitted. */
.msf-form-wrap [hidden],
.msf-form-wrap [hidden="hidden"] {
  display: none !important;
}

.msf-form__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 18px;
}

.msf-field {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.msf-field--wide {
  grid-column: 1 / -1;
}

.msf-field label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  margin-bottom: 6px;
  opacity: 0.85;
}

.msf-field input,
.msf-field select,
.msf-field textarea {
  width: 100%;
  box-sizing: border-box;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  padding: 13px 14px;
  border: 1px solid var(--msf-border);
  border-radius: var(--msf-radius);
  background: #fff;
  color: #1f2933;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.msf-field textarea {
  resize: vertical;
  min-height: 130px;
}

.msf-field select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23808080' d='M1.41 0 6 4.59 10.59 0 12 1.42 6 7.42 0 1.42z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 15px center;
}

.msf-field input:focus,
.msf-field select:focus,
.msf-field textarea:focus {
  outline: none;
  border-color: var(--msf-border-focus);
  box-shadow: 0 0 0 3px rgba(31, 41, 51, 0.08);
}

.msf-field--invalid input,
.msf-field--invalid select,
.msf-field--invalid textarea {
  border-color: var(--msf-error);
  background: #fff7f7;
}

/* Error banner */
.msf-form__error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  border-radius: var(--msf-radius);
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
}

/* Honeypot: positioned off-screen rather than display:none, because some bots
   skip hidden inputs but happily fill positioned ones. */
.msf-hp {
  position: absolute !important;
  left: -9999px !important;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.msf-turnstile {
  margin: 18px 0 4px;
}

.msf-form__submit {
  margin-top: 18px;
  display: inline-block;
  width: 100%;
  padding: 16px 24px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--msf-accent-ink);
  background: var(--msf-accent);
  border: none;
  border-radius: var(--msf-radius);
  cursor: pointer;
  transition: filter 0.15s ease, opacity 0.15s ease;
}

.msf-form__submit:hover:not(:disabled) {
  filter: brightness(0.95);
}

.msf-form__submit:disabled,
.msf-form__submit.is-busy {
  opacity: 0.6;
  cursor: not-allowed;
}

.msf-form__spinner {
  margin: 12px auto 0;
  width: 22px;
  height: 22px;
  border: 3px solid rgba(0, 0, 0, 0.12);
  border-top-color: var(--msf-border-focus);
  border-radius: 50%;
  animation: msf-spin 0.7s linear infinite;
}

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

@media (prefers-reduced-motion: reduce) {
  .msf-form__spinner { animation: none; }
}

/* Success panel */
.msf-form__success {
  text-align: center;
  padding: 40px 24px;
  border: 1px solid #e3e8ee;
  border-radius: 18px;
  background: #fbfcfd;
}

.msf-form__success h3 {
  margin: 0 0 10px;
  font-size: 22px;
  line-height: 1.3;
}

.msf-form__success p {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  opacity: 0.8;
}

@media (max-width: 767px) {
  .msf-form__grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
