/**
 * HB-563 — mobile /login top gap under sticky header.
 * Stamp: hb566a (layout hb563 + hint hb566). Theme-freeze overlay only (never C7/BN2/D1).
 *
 * Causes: (1) #hb357-header-host CLS reserve 245px while iframe opacity:0;
 * (2) login body flex items-center vertically parks the card mid-viewport.
 */

/* Auth chrome: do not keep a tall empty white host before shell ready */
html[data-hb357-auth-chrome="1"] #hb357-header-host,
html.storefront-root body:has(#login-panel) #hb357-header-host,
html.storefront-root body:has(#login-main) #hb357-header-host {
  min-height: 0 !important;
  height: auto !important;
  max-height: none !important;
  background: #ffffff !important;
}

html[data-hb357-auth-chrome="1"] #hb357-header-host:not([data-hb357-ready="1"]),
html.storefront-root body:has(#login-panel) #hb357-header-host:not([data-hb357-ready="1"]) {
  /* Compact reserve on mobile until iframe reports height — avoid 245px white slab */
  min-height: 72px !important;
  height: 72px !important;
}

@media (min-width: 768px) {
  html[data-hb357-auth-chrome="1"] #hb357-header-host:not([data-hb357-ready="1"]),
  html.storefront-root body:has(#login-panel) #hb357-header-host:not([data-hb357-ready="1"]) {
    min-height: 96px !important;
    height: 96px !important;
  }
}

html[data-hb357-auth-chrome="1"] #hb357-header-host[data-hb357-ready="1"],
html.storefront-root body:has(#login-panel) #hb357-header-host[data-hb357-ready="1"] {
  min-height: 0 !important;
  height: auto !important;
}

/* Login form: top-align under header (no mid-viewport white gap) */
html.storefront-root body:has(#login-panel) .public-light-scope > .flex.items-center,
html.storefront-root #login-main > .flex.items-center,
html.storefront-root .public-light-scope .flex.items-center.justify-center:has(#login-panel),
html.storefront-root .public-light-scope .flex.items-center.justify-center:has(#register-panel),
html.storefront-root [data-hb563-login-wrap="1"] {
  align-items: flex-start !important;
  justify-content: center !important;
  min-height: 0 !important;
  padding-top: 0.75rem !important;
  padding-bottom: 1.5rem !important;
}

@media (max-width: 767px) {
  html.storefront-root body:has(#login-panel) .public-light-scope > .flex.items-center,
  html.storefront-root #login-main > .flex.items-center,
  html.storefront-root [data-hb563-login-wrap="1"] {
    padding-top: 0.5rem !important;
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }

  html.storefront-root #login-panel,
  html.storefront-root #register-panel {
    margin-top: 0 !important;
  }
}
