/* ============================================================
   Hani Len — Join-the-club modal (global, triggered by [data-open-join]
   from the header CTA, footer member-bar, or any in-page button)
   Prefix: mb-
   ============================================================ */

.mb-modal[hidden] { display: none; }
.mb-modal {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.mb-modal__scrim {
  position: absolute; inset: 0;
  background: rgba(0,36,49,.62); backdrop-filter: blur(3px);
  animation: mb-fade .3s var(--ease-out);
}
.mb-modal__panel {
  position: relative; z-index: 2;
  width: 100%; max-width: 480px;
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(242,184,97,.16) 0%, rgba(242,184,97,0) 55%),
    var(--navy);
  border: 1px solid rgba(242,184,97,.28);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-float);
  padding: clamp(34px, 4vw, 48px);
  animation: mb-pop .38s var(--ease-out);
  /* Only the field list scrolls (.mb-fields-scroll below) — the panel
     itself is a fixed-height flex column so the title and the submit
     button stay put while the fields scroll between them. */
  max-height: 90vh; overflow: hidden;
  display: flex; flex-direction: column;
}
.mb-modal__panel::before {
  content: ""; position: absolute; top: 0; inset-inline: 0; height: 3px;
  background: var(--gold-gradient);
  border-radius: var(--radius-card) var(--radius-card) 0 0;
}
@keyframes mb-fade { from { opacity: 0; } }
@keyframes mb-pop { from { opacity: 0; transform: translateY(16px) scale(.98); } }

.mb-modal__close {
  position: absolute; top: 16px; inset-inline-end: 16px;
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.22); background: rgba(255,255,255,.06); cursor: pointer;
  display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.85);
  transition: color .2s var(--ease-out), border-color .2s var(--ease-out);
}
.mb-modal__close:hover { color: var(--gold); border-color: var(--gold); }
.mb-modal__close svg { width: 18px; height: 18px; }

.mb-modal h2 {
  font-family: var(--font-display); font-weight: 400; font-size: 2rem;
  color: #fff; margin: 0; line-height: 1.1;
}
.mb-modal__intro { flex: none; }
.mb-modal__sub { font-family: var(--font-body); font-size: 1rem; color: rgba(255,255,255,.7);
  margin: 10px 0 26px; line-height: 1.5; }

/* CF7 wraps the form in this div — it needs to flex/shrink too so its
   child (.mb-form) can actually hand height down to .mb-fields-scroll. */
.mb-modal__panel > .wpcf7 { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.mb-form { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; gap: 3px; }
/* This is the ONLY scrolling region in the modal — the title above and the
   fine-print/submit button below stay fixed in place while the fields
   scroll between them, so the button is always visible without needing
   real position:sticky (which can't work here: it was the form's last
   child, i.e. already at the bottom of the one scrolling block, so there
   was no room left for it to visually "stick"). */
.mb-fields-scroll {
  display: flex; flex-direction: column; gap: 3px;
  flex: 1 1 auto; min-height: 0; overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: var(--gold-deep) transparent;
}
.mb-fields-scroll::-webkit-scrollbar { width: 6px; }
.mb-fields-scroll::-webkit-scrollbar-track { background: transparent; }
.mb-fields-scroll::-webkit-scrollbar-thumb { background: var(--gold-deep); border-radius: 999px; }
/* Label lives inside the field's own box now (a small pinned caption at
   the top) instead of a separate row above it — position:relative here,
   position:absolute on the label, and the field's own top padding leaves
   room for it. Removes label as its "own" line, textarea etc. */
.mb-field { position: relative; flex: none; }
.mb-field label {
  position: absolute; top: 8px; inset-inline-start: 15px; z-index: 1;
  font-family: var(--font-body); font-size: .68rem; font-weight: 600;
  letter-spacing: .04em; color: #fff; pointer-events: none;
}
.mb-field input, .mb-field select, .mb-field textarea {
  font-family: var(--font-body); font-size: 1rem; color: #fff;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.18);
  border-radius: 10px; padding: 21px 15px 7px; width: 100%; box-sizing: border-box;
  transition: border-color .2s var(--ease-out), box-shadow .2s var(--ease-out), background .2s var(--ease-out);
  /* Hints the browser to draw native chrome (date-picker icon, etc.) in a
     light-on-dark style instead of the near-invisible default dark-on-dark. */
  color-scheme: dark;
}
/* height (not min-height) — CF7's textarea tag defaults to rows="10" when
   no rows option is given, and that attribute's implied height otherwise
   wins over min-height regardless of how small we set it. */
.mb-field textarea { height: 110px; padding-top: 26px; resize: vertical; font-family: var(--font-body); }
.mb-field input::placeholder, .mb-field textarea::placeholder { color: rgba(255,255,255,.4); }
.mb-field select option { color: var(--ink); }
.mb-field input:focus, .mb-field select:focus, .mb-field textarea:focus {
  outline: none; border-color: var(--gold); background: rgba(255,255,255,.1);
  box-shadow: 0 0 0 3px rgba(242,184,97,.2);
}
.mb-form .hl-btn {
  flex: none;
  width: 100%; margin-top: 8px; justify-content: center; border: none; cursor: pointer;
}
.mb-form__fine { flex: none; font-family: var(--font-body); font-size: .8rem; color: rgba(255,255,255,.55);
  text-align: center; margin: 4px 0 0; line-height: 1.5; }

/* ---- Contact Form 7 theming (fields/actions styled above already cover
   the inputs themselves via .mb-field — this themes CF7's own validation/
   response markup, which ships with light-admin-theme colors by default). ---- */
.mb-form .wpcf7-form-control-wrap { display: block; }
.mb-form .wpcf7-not-valid-tip { font-family: var(--font-body); font-size: .82rem; color: #ff8a8a; margin-top: 6px; }
.mb-form input.wpcf7-not-valid, .mb-form select.wpcf7-not-valid, .mb-form textarea.wpcf7-not-valid { border-color: #ff8a8a; }
.mb-form .wpcf7-response-output {
  flex: none;
  font-family: var(--font-body); font-size: .85rem; text-align: center; line-height: 1.5;
  margin: 0 0 4px; padding: 10px 14px; border-radius: 10px;
  border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.06); color: rgba(255,255,255,.85);
}
.mb-form.sent .wpcf7-response-output { display: none; } /* .mb-success replaces it on real send */
.mb-form.failed .wpcf7-response-output, .mb-form.aborted .wpcf7-response-output { border-color: #ff8a8a; color: #ff8a8a; }
.mb-form.spam .wpcf7-response-output { border-color: var(--gold); color: var(--gold); }
.mb-form .wpcf7-spinner { background-color: var(--gold); }
.mb-form .wpcf7-spinner::before { background-color: var(--navy); }

.mb-success { text-align: center; padding: 10px 0; }
.mb-success__ic { width: 60px; height: 60px; border-radius: 50%;
  background: var(--gold-gradient); color: var(--navy); display: inline-flex;
  align-items: center; justify-content: center; margin-bottom: 18px; }
.mb-success__ic svg { width: 30px; height: 30px; }
