/* The beta's password card (gate.js), on every page of beta.cheapgc.io until it is passed in this browser. The page
   shows blurred and dimmed behind a centred glass card (the home box's glass and glow, app.css .compose and .aura).
   html.bgate-on is set before the first paint, so the veil is there from the first frame; the card joins it once the
   body exists. On the right password the card lifts away and the veil dissolves, bringing the page into focus. */

html.bgate-on { overflow: hidden; }
html.bgate-on::before {
  content: ""; position: fixed; inset: 0; z-index: 2147483600; pointer-events: auto;
  background: linear-gradient(180deg, oklch(30% 0.05 280 / 0.2), oklch(24% 0.06 282 / 0.34));
  backdrop-filter: blur(22px) saturate(1.35); -webkit-backdrop-filter: blur(22px) saturate(1.35);
}
html.bgate-out::before { opacity: 0; transition: opacity 820ms cubic-bezier(0.4, 0, 0.2, 1) 90ms; }

.bgate {
  position: fixed; inset: 0; z-index: 2147483601; display: grid; place-items: center; padding: 16px;
  font: 400 15px/1.5 var(--sans, system-ui, sans-serif); color: var(--ink, #14183a);
}
.bgate-wrap { position: relative; isolation: isolate; width: min(400px, 100%); animation: bgate-in 680ms cubic-bezier(0.2, 0, 0, 1) 60ms both; }
/* the home box's glow, a little closer around the smaller card */
.bgate .aura { inset: -40px -46px -48px; opacity: 0.85; }
.bgate-card {
  position: relative; display: grid; justify-items: center; padding: 34px 28px 26px; text-align: center;
  border-radius: var(--r-box, 26px); background: linear-gradient(180deg, oklch(100% 0 0 / 0.86), oklch(100% 0 0 / 0.72));
  backdrop-filter: blur(24px) saturate(1.7); -webkit-backdrop-filter: blur(24px) saturate(1.7);
  box-shadow: inset 0 1px 0 oklch(100% 0 0 / 0.95), inset 0 -1px 0 oklch(100% 0 0 / 0.5), 0 0 0 1px oklch(52% 0.12 286 / 0.12),
    0 1px 2px oklch(30% 0.08 286 / 0.06), 0 0 32px -4px oklch(70% 0.16 290 / 0.4), 0 30px 70px -26px oklch(30% 0.2 286 / 0.55);
}
.bgate-card::before {   /* the fine light edge, as on the box */
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(140deg, oklch(100% 0 0 / 1), oklch(80% 0.09 287 / 0.55) 38%, oklch(100% 0 0 / 0.4) 62%, oklch(86% 0.07 250 / 0.7));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
}
.bgate .wordmark { font-size: 27px; }
.bgate .wordmark svg { width: 28px; height: 28px; }
.bgate-line { margin: 12px 0 0; font-size: 15px; font-weight: 560; color: var(--muted, #6a6f87); }
.bgate-form { display: grid; width: 100%; margin-top: 24px; gap: 10px; }
.bgate .input { height: 48px; text-align: center; font-size: 16px; letter-spacing: 0.02em; background: oklch(100% 0 0 / 0.9); }
.bgate .btn { height: 48px; width: 100%; font-size: 15.5px; }
/* the error line opens under the field without a jump */
.bgate-err { display: grid; grid-template-rows: 0fr; margin: -10px 0 0; transition: grid-template-rows 260ms cubic-bezier(0.2, 0, 0, 1), margin 260ms cubic-bezier(0.2, 0, 0, 1); }
.bgate-err > span { overflow: hidden; font-size: 14px; font-weight: 560; color: oklch(52% 0.19 22); opacity: 0; transition: opacity 200ms; }
.bgate.is-wrong .bgate-err { grid-template-rows: 1fr; margin: -2px 0 2px; }
.bgate.is-wrong .bgate-err > span { opacity: 1; }
.bgate.is-wrong .input { box-shadow: inset 0 0 0 1px oklch(72% 0.14 22), 0 0 0 4px oklch(95% 0.03 22); }
.bgate-card.is-shake { animation: bgate-shake 420ms cubic-bezier(0.36, 0.07, 0.19, 0.97); }

/* the right password: the card lifts away, then the veil dissolves (html.bgate-out above) */
.bgate.is-out { pointer-events: none; }
.bgate.is-out .bgate-wrap { animation: bgate-away 560ms cubic-bezier(0.4, 0, 0.2, 1) both; }

@keyframes bgate-in { from { opacity: 0; transform: translateY(14px) scale(0.98); } }
@keyframes bgate-away { to { opacity: 0; transform: translateY(-10px) scale(1.035); filter: blur(6px); } }
@keyframes bgate-shake { 15% { translate: -9px 0; } 35% { translate: 7px 0; } 55% { translate: -5px 0; } 75% { translate: 3px 0; } }

@media (max-width: 420px) {
  .bgate-card { padding: 28px 20px 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .bgate-wrap { animation: none; }
  .bgate-card.is-shake { animation: none; }
  .bgate.is-out .bgate-wrap { animation: bgate-fade 200ms linear both; }
  html.bgate-out::before { transition: opacity 240ms linear; }
}
@keyframes bgate-fade { to { opacity: 0; } }
