/* ============================================================
   Meetgle — native Login (and shared auth) modal.
   Surface matches the drawers / menu sheet: #141417, hairline
   border, 24px radius, gold accent. Azar-inspired layout.
   Class prefix `mg-auth-` is shared with the register modal.
   ============================================================ */

.meetgle-modal.mg-auth-modal {
  /* Pull the accent from the active theme (set globally on :root by the
     shortcode + theme CSS), so the login buttons/links match the site theme. */
  --mg-accent: var(--button-color, var(--theme-button-primary, #ff2e68));
  position: fixed;
  inset: 0;
  z-index: 100000;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.62);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  box-sizing: border-box;
}

.mg-auth-card {
  position: relative;
  width: 100%;
  max-width: 420px;
  max-height: calc(100% - 32px);
  margin: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  background: #141417;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: 22px 26px 26px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
  box-sizing: border-box;
}
.mg-auth-card::-webkit-scrollbar { display: none; }

/* Close */
.mg-auth-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 9px !important;
  display: grid !important;
  place-items: center;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.06) !important;
  color: rgba(255, 255, 255, 0.55) !important;
  box-shadow: none !important;
  transition: background 0.15s, color 0.15s;
  z-index: 2;
}
.mg-auth-close:hover { background: rgba(255, 255, 255, 0.12) !important; color: #fff !important; }
.mg-auth-close svg { width: 16px; height: 16px; display: block; }

/* Hero: logo + live count */
.mg-auth-hero { text-align: center; padding: 18px 0 6px; }
.mg-auth-logo { max-width: 150px; max-height: 44px; width: auto; height: auto; margin: 0 auto; display: block; object-fit: contain; }
.mg-auth-logo-text { font-size: 28px; font-weight: 800; letter-spacing: -0.5px; color: #fff; }
.mg-auth-count { font-size: 40px; font-weight: 800; letter-spacing: -1px; margin: 16px 0 2px; line-height: 1; color: #fff; }
.mg-auth-count-sub { font-size: 14px; color: rgba(255, 255, 255, 0.5); }

/* Form */
.mg-auth-form { margin-top: 22px; }
.mg-auth-field { margin-bottom: 14px; }
.mg-auth-label { display: block; font-size: 12px; font-weight: 600; color: rgba(255, 255, 255, 0.55); margin: 0 0 7px 2px; }
.mg-auth-input-wrap { position: relative; }
.mg-auth-input {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  /* !important throughout: the page (Elementor/theme) heavily restyles inputs. */
  border-radius: 18px !important;
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1.5px solid rgba(255, 255, 255, 0.12) !important;
  color: #fff !important;
  font-size: 16px;            /* 16px: avoids iOS zoom-on-focus */
  font-family: inherit;
  outline: none;
  box-shadow: none !important;
  box-sizing: border-box;
  transition: border-color 0.15s, background 0.15s;
}
.mg-auth-input::placeholder { color: rgba(255, 255, 255, 0.32); }
.mg-auth-input:focus { border-color: var(--mg-accent) !important; background: rgba(255, 255, 255, 0.07) !important; }
.mg-auth-input.has-eye { padding-right: 48px; }

.mg-auth-eye {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 38px !important;
  height: 38px !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;   /* Elementor gives buttons a fill — keep it ghost */
  cursor: pointer;
  display: grid !important;
  place-items: center;
  color: rgba(255, 255, 255, 0.45) !important;
  border-radius: 9px !important;
  box-shadow: none !important;
}
.mg-auth-eye:hover { color: #fff !important; background: rgba(255, 255, 255, 0.06) !important; }
.mg-auth-eye svg { width: 19px; height: 19px; display: block; }

/* Error banner */
.mg-auth-error {
  display: none;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 14px;
  padding: 11px 13px;
  border-radius: 12px;
  background: rgba(244, 63, 78, 0.1);
  border: 1px solid rgba(244, 63, 78, 0.25);
  color: #ffb3ba;
  font-size: 13px;
  line-height: 1.45;
}
.mg-auth-error.show { display: flex; }
.mg-auth-error svg { width: 16px; height: 16px; flex: none; margin-top: 1px; color: #f43f4e; }

/* Submit */
.mg-auth-submit {
  position: relative;
  width: 100%;
  height: 54px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  /* !important across states: the page (Elementor/theme) otherwise repaints
     the button color on :hover/:active/:focus. */
  background: var(--mg-accent) !important;
  color: #fff !important;
  border: 0 !important;
  font-size: 16px;
  font-weight: 800;
  font-family: inherit;
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  box-shadow: none !important;
  transition: filter 0.15s, transform 0.1s;
}
.mg-auth-submit:hover,
.mg-auth-submit:focus,
.mg-auth-submit:active {
  background: var(--mg-accent) !important;
  color: #fff !important;
}
.mg-auth-submit:hover { filter: brightness(1.08); }
.mg-auth-submit:active { transform: scale(0.99); }
.mg-auth-submit:disabled { cursor: default; }
.mg-auth-submit.is-loading .mg-auth-submit-label { color: transparent; }
.mg-auth-spinner {
  display: none;
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: mgAuthSpin 0.7s linear infinite;
}
.mg-auth-submit.is-loading .mg-auth-spinner { display: block; }
@keyframes mgAuthSpin { to { transform: rotate(360deg); } }

.mg-auth-forgot {
  display: block;
  text-align: center;
  margin-top: 16px;
  color: var(--mg-accent);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.mg-auth-forgot:hover { text-decoration: underline; color: var(--mg-accent); }

/* Footer */
.mg-auth-foot {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  text-align: center;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.45);
}
.mg-auth-foot a {
  color: var(--mg-accent);
  font-weight: 700;
  text-decoration: none;
  margin-left: 4px;
}
.mg-auth-foot a:hover { text-decoration: underline; }

/* ---- Register: 18+ checkbox ---- */
.mg-auth-check {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin: 6px 0 16px;
  cursor: pointer;
  user-select: none;
}
.mg-auth-check input { position: absolute; opacity: 0; width: 0; height: 0; }
.mg-auth-check-box {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.04);
  display: grid;
  place-items: center;
  color: transparent;
  margin-top: 1px;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.mg-auth-check-box svg { width: 13px; height: 13px; }
.mg-auth-check input:checked + .mg-auth-check-box {
  background: var(--mg-accent);
  border-color: var(--mg-accent);
  color: #fff;
}
.mg-auth-check input:focus-visible + .mg-auth-check-box { outline: 2px solid var(--mg-accent); outline-offset: 2px; }
.mg-auth-check-text { font-size: 12.5px; line-height: 1.45; color: rgba(255, 255, 255, 0.5); }

/* ---- Register: success ("check your email") state ---- */
.mg-auth-success { text-align: center; padding: 18px 6px 6px; }
.mg-auth-success-ic {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.06);
  color: var(--mg-accent);
}
.mg-auth-success-ic svg { width: 28px; height: 28px; }
.mg-auth-success-title { font-size: 20px; font-weight: 800; color: #fff; margin-bottom: 8px; }
.mg-auth-success-body { font-size: 14px; color: rgba(255, 255, 255, 0.55); line-height: 1.5; max-width: 300px; margin: 0 auto 22px; }
.mg-auth-success .mg-auth-submit { margin-top: 0; }

/* ---- Mobile: full-bleed takeover (matches the rest of the Stage) ---- */
@media (max-width: 520px) {
  .meetgle-modal.mg-auth-modal { padding: 0; align-items: stretch; }
  .mg-auth-card {
    max-width: none;
    max-height: none;
    min-height: 100%;
    border: 0;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    padding: 18px 22px calc(26px + env(safe-area-inset-bottom));
  }
  .mg-auth-foot { margin-top: auto; }
}
