/*
 * Real Estate Moguls: The Moguls Brief signup modal (shell only).
 * The fields, consent and confirmation are drawn by the provider inside its frame.
 * Layer: below the privacy notice (10050), level with the earlier popup (10000).
 * Widths checked: 320, 390, 768, 1280. Also 200% zoom (640 by 400).
 */

.rem-brief-overlay {
  position: fixed; inset: 0; z-index: 10000;
  display: flex; align-items: center; justify-content: center;
  padding: 24px 16px;
  background: rgba(3, 9, 16, 0.78);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.rem-brief-overlay[hidden] { display: none; }
body.rem-brief-open { overflow: hidden; }

.rem-brief {
  --b-ink: #071B29;
  --b-raised: #0D2436;
  --b-line: #24405A;
  --b-cyan: #29ABE2;
  --b-cyan-hover: #4DBBEA;
  --b-gold: #C9A84C;
  --b-text: #FFFFFF;
  --b-muted: #C5CCD6;
  position: relative;
  width: 100%; max-width: 520px;
  margin: auto;
  background: linear-gradient(180deg, #0B2233 0%, var(--b-ink) 42%);
  color: var(--b-text);
  border: 1px solid var(--b-line);
  border-top: 3px solid var(--b-gold);
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
  font-family: var(--font-body, "Avenir Next", "Avenir", "Helvetica Neue", Helvetica, Arial, sans-serif);
  line-height: 1.5;
}
.rem-brief:focus { outline: none; }
.rem-brief *, .rem-brief *::before, .rem-brief *::after { box-sizing: border-box; }
.rem-brief :focus-visible { outline: 2px solid var(--b-cyan); outline-offset: 3px; border-radius: 6px; }
.rem-brief .screen-reader-text {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0, 0, 0, 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}

.rem-brief__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 14px 0 24px; }
.rem-brief__mark { display: block; max-height: 30px; width: auto; max-width: 70%; white-space: nowrap; }
.rem-brief__mark--text {
  font-family: var(--font-display, "Afacad", "Avenir Next", system-ui, sans-serif);
  font-size: 15px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--b-text);
}
.rem-brief__close {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 44px; height: 44px; padding: 0;
  background: transparent; color: var(--b-text);
  border: 1px solid transparent; border-radius: 8px; cursor: pointer;
}
.rem-brief__close:hover { border-color: var(--b-line); background: rgba(255, 255, 255, 0.08); }

.rem-brief__body { padding: 6px 24px 20px; }
.rem-brief__eye {
  margin: 0 0 6px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--b-gold);
}
.rem-brief__title {
  margin: 0 0 10px;
  font-family: var(--font-display, "Afacad", "Avenir Next", system-ui, sans-serif);
  font-size: clamp(1.75rem, 6vw, 2.375rem); font-weight: 600; line-height: 1.08; letter-spacing: -0.01em;
  color: var(--b-text);
}
.rem-brief__lead { margin: 0 0 14px; font-size: 16px; line-height: 1.55; color: var(--b-text); }
.rem-brief__points { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; color: var(--b-muted); }
.rem-brief__points li { display: inline-flex; align-items: center; gap: 8px; }
.rem-brief__points li::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--b-cyan); flex: none; }

.rem-brief__btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 10px 24px;
  background: var(--b-cyan); color: var(--b-ink) !important;
  border: 1px solid var(--b-cyan); border-radius: 8px;
  font-family: var(--font-display, "Afacad", "Avenir Next", system-ui, sans-serif);
  font-size: 17px; font-weight: 600; letter-spacing: 0.02em; line-height: 1.2; text-align: center; text-decoration: none;
  cursor: pointer;
}
.rem-brief__btn:hover { background: var(--b-cyan-hover); border-color: var(--b-cyan-hover); }
.rem-brief__btn--quiet { background: transparent; color: var(--b-text) !important; border-color: rgba(255, 255, 255, 0.5); }
.rem-brief__btn--quiet:hover { background: rgba(255, 255, 255, 0.1); border-color: #fff; }
.rem-brief__pitch .rem-brief__btn { width: 100%; }

/* The provider's form. It paints its own background and text; this box only holds its place. */
.rem-brief__form { position: relative; }
.rem-brief__status {
  position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap;
}
.rem-brief[data-state="loading"] .rem-brief__status {
  position: static; width: auto; height: auto; margin: 0 0 12px; overflow: visible; clip: auto; white-space: normal;
  font-size: 14px; color: var(--b-muted);
}
.rem-brief__frame { border-radius: 10px; overflow: hidden; min-height: 0; }
.rem-brief__iframe { display: block; width: 100%; min-height: 300px; border: 0; background: transparent; }
/* The provider's script sets the height. Without it (script blocked, or a frame made on "Try again") the frame keeps a set height and scrolls inside. */
.rem-brief--fixed-height .rem-brief__iframe,
.rem-brief[data-state="unconfirmed"] .rem-brief__iframe { height: 400px; } /* the embed's own stated height */
/* While loading, the frame is laid out in place but not seen. Once the provider has answered it is measured where it will sit. */
.rem-brief[data-state="loading"] .rem-brief__frame { position: absolute; left: 0; right: 0; top: 0; opacity: 0; pointer-events: none; }
.rem-brief__skeleton { display: none; }
.rem-brief[data-state="loading"] .rem-brief__skeleton { display: grid; gap: 14px; min-height: 300px; align-content: start; }
.rem-brief__skeleton span { display: block; height: 48px; border-radius: 8px; background: linear-gradient(90deg, #12304A 0%, #1B4263 50%, #12304A 100%); background-size: 200% 100%; animation: rem-brief-wait 1.4s linear infinite; }
.rem-brief__skeleton span:nth-child(3) { height: 64px; }
.rem-brief__skeleton span:nth-child(4) { width: 55%; }
@keyframes rem-brief-wait { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.rem-brief__slow { margin: 12px 0 0; font-size: 14px; color: var(--b-muted); }
.rem-brief__link { display: inline-block; min-height: 24px; margin-left: 8px; padding: 2px 0; background: none; border: 0; color: var(--b-text); font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.rem-brief__slow a, .rem-brief__foot a { color: var(--b-text); text-decoration: underline; text-underline-offset: 3px; }
.rem-brief__error { padding: 18px; border: 1px solid var(--b-line); border-left: 3px solid var(--b-gold); border-radius: 10px; background: var(--b-raised); }
.rem-brief__error-text { margin: 0 0 14px; font-size: 16px; color: var(--b-text); }
.rem-brief__error-text:focus { outline: none; }
.rem-brief__error-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.rem-brief__foot { margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--b-line); font-size: 13px; line-height: 1.6; color: var(--b-muted); }
.rem-brief__links { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-top: 4px; }
.rem-brief__links a { display: inline-block; padding: 5px 0; }

@media (max-width: 560px) {
  .rem-brief--fixed-height .rem-brief__iframe,
  .rem-brief[data-state="unconfirmed"] .rem-brief__iframe { height: 440px; } /* the consent sentence wraps to more lines */
  .rem-brief-overlay { padding: 0; align-items: stretch; }
  .rem-brief { max-width: none; min-height: 100%; margin: 0; border-radius: 0; border-left: 0; border-right: 0; border-bottom: 0; }
  /* The short invitation sits at the foot of the screen as a sheet; the form uses the whole screen. */
  .rem-brief[data-state="pitch"] { min-height: 0; margin-top: auto; border-radius: 14px 14px 0 0; }
  .rem-brief__bar { padding: max(12px, env(safe-area-inset-top, 0px)) 10px 0 18px; }
  .rem-brief__body { padding: 8px 18px max(22px, env(safe-area-inset-bottom, 0px)); }
  .rem-brief__error-actions .rem-brief__btn { width: 100%; }
}
@media (max-height: 520px) {
  .rem-brief-overlay { align-items: flex-start; }
  .rem-brief__points { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .rem-brief__skeleton span { animation: none; }
}
