/**
 * Header login popup shell (assets/js/auth-modal.js, parts/auth_modal.php).
 *
 * The overlay/centering/close-button chrome, the 50/50 split
 * (`.auth_visual` image+logo panel / `.auth_card` form panel) and their
 * shared card frame (background, radius, shadow) live here. Every
 * visual detail *inside* the form panel (fields, password toggle,
 * checkbox, links, notices) is still auth.css's `.auth_card` rules,
 * reused verbatim so the popup's form and the full-page /account/ login
 * screen look identical. Modeled on `.download_modal`
 * (assets/css/downloads.css).
 */
.auth_modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(12, 12, 12, 0.88);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  padding: 3rem;
}
.auth_modal.active {
  opacity: 1;
  visibility: visible;
}
.auth_modal_inner {
  width: 100%;
  max-width: 92rem;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  transform: translateY(1.6rem) scale(0.97);
  transition: transform 0.35s ease, opacity 0.3s ease;
  opacity: 0;
}
.auth_modal.active .auth_modal_inner {
  transform: translateY(0) scale(1);
  opacity: 1;
}
.auth_modal_close {
  position: absolute;
  top: 1.8rem;
  right: 1.8rem;
  width: 3.6rem;
  height: 3.6rem;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 2;
}
.auth_modal_close::before,
.auth_modal_close::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 2rem;
  height: 2px;
  /* Sits over `.auth_card`'s white background (top-right of the popup,
     i.e. the form half — `.auth_visual` is the left half), same color
     as the full-page login screen's close-adjacent chrome. */
  background-color: var(--text, #333);
  transition: background-color 0.2s ease;
}
.auth_modal_close::before { transform: translate(-50%, -50%) rotate(45deg); }
.auth_modal_close::after { transform: translate(-50%, -50%) rotate(-45deg); }
.auth_modal_close:hover::before,
.auth_modal_close:hover::after { background-color: var(--primary); }

/**
 * `.auth_card_split` is the frame the full-page login screen doesn't
 * need (that one wraps `.auth_card` directly in `.auth_card_wrap`, see
 * wp_theme_agent_auth_shell_open()): it owns the rounded corners/shadow
 * for the whole popup so `.auth_visual` and `.auth_card` can sit
 * flush side by side and still read as one card.
 */
.auth_card_split {
  display: flex;
  align-items: stretch;
  width: 100%;
  min-height: 56rem;
  background-color: #fff;
  border-radius: 1.6rem;
  box-shadow: var(--shadow2);
  overflow: hidden;
}

/* ---- Left half: background image/video + logo ---------------------------- */
.auth_visual {
  position: relative;
  width: 50%;
  flex-shrink: 0;
  overflow: hidden;
  background-color: #06231c;
}
.auth_visual_bg,
.auth_visual_video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/**
 * The still image is always in the DOM (cheap, loads immediately). The
 * video is `preload="none"` with its real URL parked in `data-src` —
 * assets/js/auth-modal.js only points `src` at it and calls `.play()`
 * the first time the popup opens, then adds `.is-ready` once it can
 * actually play, crossfading it in on top of (and thereby replacing)
 * the still image rather than popping in abruptly or blocking on a
 * ~3MB download for every visitor who never opens this popup.
 */
.auth_visual_video {
  opacity: 0;
  transition: opacity 0.6s ease;
}
.auth_visual_video.is-ready {
  opacity: 1;
}
.auth_visual_logo {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3.6rem;
  width: 100%;
  height: 100%;
  padding: 4rem;
}
.auth_visual_logo > img {
  width: 100%;
  max-width: 22rem;
  height: auto;
  filter: drop-shadow(0 0.4rem 1.6rem rgba(0, 0, 0, 0.35));
}

/**
 * `.btn_google` — design only for now: no `wp_ajax_` endpoint / OAuth
 * flow wired up behind it yet, it just sits under the logo visually.
 * White pill so it reads clearly over the dark video/image background,
 * with Google's own multi-color "G" mark (inline SVG, no icon font).
 */
.btn_google {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  width: 100%;
  max-width: 27rem;
  height: 5.2rem;
  padding: 0 2rem;
  background-color: #fff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 1rem;
  box-shadow: 0 0.6rem 1.8rem rgba(0, 0, 0, 0.22);
  font-size: 1.5rem;
  font-weight: 600;
  color: #3c4043;
  cursor: pointer;
  transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.btn_google:hover {
  background-color: #f8f9fa;
  box-shadow: 0 0.8rem 2.2rem rgba(0, 0, 0, 0.28);
  transform: translateY(-1px);
}
.btn_google_icon {
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
}

/* ---- Right half: form ----------------------------------------------------- */
.auth_modal .auth_card {
  width: 50%;
  flex-shrink: 0;
  max-width: none;
  margin: 0;
  background-color: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow-y: auto;
}

/**
 * The full-page login/register screen switches panels via
 * `.auth_card[data-active-tab]` (auth.css). The popup only ever shows
 * "login" or "lost" and never "register" (registration stays closed —
 * see form-login.php), so it keys off its own `[data-active-panel]`
 * attribute instead, scoped to `.auth_modal` so the two mechanisms never
 * collide on a page that also has the real login form in its DOM.
 */
.auth_modal .auth_panel { display: none; }
.auth_modal .auth_card[data-active-panel="login"] .auth_panel[data-panel="login"],
.auth_modal .auth_card[data-active-panel="lost"] .auth_panel[data-panel="lost"] {
  display: block;
}

.auth_modal .btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

@media screen and (max-width: 900px) {
  .auth_card_split {
    min-height: 0;
  }
  .auth_visual {
    display: none;
  }
  .auth_modal .auth_card {
    width: 100%;
  }
}

@media screen and (max-width: 576px) {
  .auth_modal {
    padding: 16px;
  }
}
