/* Golden Gateway V8: progressive enhancement of the original V7 composition.
   Without the controller's state attribute, the original form stays visible. */
body { --brooke-gateway-css: ready; }
[data-gateway-enter][hidden], [data-gateway-entry][hidden],
[data-gateway-return][hidden], [data-gateway-discover][hidden] { display: none !important; }
.brooke-gateway-trails { pointer-events: none; }
.brooke-christmas[data-brooke-gateway-state] .christmas-greeting { pointer-events: auto; }
.brooke-gateway-art-trigger {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 22px;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.brooke-gateway-art-trigger:focus-visible {
  outline: 2px solid #f4d377;
  outline-offset: 8px;
  background: #fff2b803;
}
.brooke-gateway-entry {
  position: absolute;
  top: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: 100%;
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 3px;
  z-index: 3;
}
.brooke-gateway-enter, .brooke-gateway-discover {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 11px 22px;
  border: 1px solid #d8a54fa6;
  border-radius: 30px;
  color: #fff5dc;
  background: linear-gradient(130deg, #17396ae8, #061b46ee);
  box-shadow: inset 0 1px 0 #fff2b814, 0 5px 22px #04112b40;
  font: 500 13px/1.4 Arial, sans-serif;
  letter-spacing: .2px;
  cursor: pointer;
  transition: border-color .22s, background-color .22s, box-shadow .22s;
}
.brooke-gateway-enter > span { color: #f4d377; }
.brooke-gateway-enter:hover, .brooke-gateway-enter:focus-visible,
.christmas-greeting:has(.brooke-gateway-art-trigger:is(:hover, :focus-visible)) .brooke-gateway-enter,
.brooke-gateway-discover:hover {
  border-color: #fff2b8;
  box-shadow: inset 0 1px 0 #fff2b82a, 0 0 25px #d8a54f25;
}
.brooke-gateway-direct {
  min-height: 44px;
  padding: 8px 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #e4eaf3;
  font: 400 12px/1.4 Arial, sans-serif;
  text-decoration: underline;
  text-decoration-color: #d8a54f85;
  text-underline-offset: 4px;
  cursor: pointer;
}
.brooke-gateway-direct:hover { color: #fff2b8; }
.brooke-christmas .brooke-login-controls .brooke-gateway-return {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 35px;
  padding: 7px 12px;
  color: #ffe8b3;
  background: #0a234ae8;
  border: 1px solid #d8a54f60;
  border-radius: 8px;
  font: 400 11px/1.4 Arial, sans-serif;
  cursor: pointer;
}
.brooke-christmas .brooke-gateway-return:hover { border-color: #f4d377; }
.brooke-christmas[data-brooke-gateway-state="intro"] :is(.brooke-auth-card, .brooke-auth-story__content) {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.brooke-christmas[data-brooke-gateway-state] [inert],
.brooke-christmas[data-brooke-gateway-state] .brooke-auth-card[aria-hidden="true"] { pointer-events: none; }
.brooke-gateway-trails {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 4;
  overflow: visible;
}
.brooke-christmas[data-brooke-gateway-state] .brooke-auth-sectors a {
  transition: border-color .2s, background-color .2s, color .2s, transform .2s;
}
.brooke-christmas[data-brooke-gateway-state] .brooke-auth-sectors a:is(:hover, :focus-visible) {
  border-color: #d8a54f;
  background: #18436b;
  color: #fffdf2;
  transform: translateY(-2px);
}
.brooke-christmas[data-brooke-gateway-state] .brooke-auth-input:focus-within {
  border-color: #e4bd70;
  box-shadow: 0 0 0 3px #f4d3771a;
}
.brooke-christmas[data-brooke-gateway-state] .brooke-auth-input:focus-within > i { color: #fff2b8; }
.brooke-christmas[data-brooke-gateway-state] .brooke-auth-input .form-control:focus {
  border-color: #e4bd70 !important;
  box-shadow: 0 0 0 2px #d8a54f22 !important;
}
.brooke-christmas[data-brooke-gateway-state] #login > span:last-child { transition: transform .2s; }
.brooke-christmas[data-brooke-gateway-state] #login:hover > span:last-child { transform: translateX(3px); }
.brooke-christmas .brooke-auth-card[data-gateway-submitting] #login { cursor: progress; }
.brooke-christmas .brooke-auth-card[data-gateway-submitting] #login::after {
  content: "";
  width: 13px;
  height: 13px;
  margin-left: 9px;
  border: 2px solid #13243e40;
  border-top-color: #13243e;
  border-radius: 50%;
  animation: brooke-gateway-spinner .8s linear infinite;
}
.brooke-christmas[data-brooke-gateway-state] .brooke-sector-dialog[open] { animation: brooke-gateway-dialog .22s ease-out; }
.brooke-christmas[data-brooke-gateway-state] .brooke-sector-dialog::backdrop { background: #020c20b8; }
.brooke-gateway-discover { display: none; }
@keyframes brooke-gateway-dialog { from { opacity: 0; transform: translateY(6px) scale(.99); } to { opacity: 1; transform: none; } }
@keyframes brooke-gateway-spinner { to { transform: rotate(360deg); } }
@media (min-width: 651px) and (max-height: 600px) {
  /* At high zoom / short landscape heights, a fixed toolbar could cover Sign In.
     Give it document space after the card so every field stays reachable. */
  .brooke-christmas[data-brooke-gateway-state] .brooke-auth-panel { display: flex; flex-direction: column; }
  .brooke-christmas[data-brooke-gateway-state] .brooke-login-controls {
    position: static;
    order: 2;
    margin-top: 16px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 35px;
    grid-template-rows: 44px 44px;
    gap: 8px;
  }
  .brooke-christmas[data-brooke-gateway-state] .brooke-login-controls > button { min-width: 0; min-height: 44px; padding-inline: 5px; }
  .brooke-christmas[data-brooke-gateway-state] .brooke-login-controls .brooke-settings-button { grid-area: 1 / 1; }
  .brooke-christmas[data-brooke-gateway-state] .brooke-login-controls .brooke-login-motion { grid-area: 1 / 2; }
  .brooke-christmas[data-brooke-gateway-state] .brooke-login-controls .brooke-theme-toggle--auth { grid-area: 1 / 3; }
  .brooke-christmas[data-brooke-gateway-state] .brooke-login-controls .brooke-gateway-return { grid-area: 2 / 1 / 3 / 4; justify-content: center; }
}
@media (max-width: 650px) {
  /* Keep the greeting and the original form in document flow. The story uses
     the existing content once, behind a native-button disclosure. */
  .brooke-christmas[data-brooke-gateway-state="intro"] .christmas-greeting,
  .brooke-christmas[data-brooke-gateway-state="returning"] .christmas-greeting { margin-bottom: 108px; }
  .brooke-christmas[data-brooke-gateway-state="intro"] .brooke-auth-card { display: none; }
  .brooke-christmas[data-brooke-gateway-state="intro"] .brooke-auth-story,
  .brooke-christmas[data-brooke-gateway-state="returning"] .brooke-auth-story { margin: 0; }
  .brooke-christmas[data-brooke-gateway-state] .brooke-auth-story__content[aria-hidden="true"] { display: none; }
  .brooke-christmas[data-brooke-gateway-state] .brooke-gateway-discover:not([hidden]) { display: inline-flex; margin-bottom: 20px; }
  .brooke-christmas[data-brooke-gateway-state] .brooke-login-controls > button { min-height: 44px; }
  .brooke-christmas[data-brooke-gateway-state] .brooke-auth-card { scroll-margin-top: 20px; }
}
.brooke-christmas.christmas-motion-paused[data-brooke-gateway-state] :is(.brooke-auth-sectors a, #login > span:last-child) { transform: none; transition: none; }
.brooke-christmas.christmas-motion-paused[data-brooke-gateway-state] .brooke-sector-dialog[open],
.brooke-christmas.christmas-motion-paused .brooke-auth-card[data-gateway-submitting] #login::after { animation: none; }
@media (prefers-reduced-motion: reduce) {
  .brooke-christmas[data-brooke-gateway-state] :is(.brooke-auth-sectors a, #login > span:last-child) { transform: none; transition: none; }
  .brooke-christmas[data-brooke-gateway-state] .brooke-sector-dialog[open],
  .brooke-christmas .brooke-auth-card[data-gateway-submitting] #login::after { animation: none; }
}
