.assembly {
    --navy-950: #02022d;
    --navy-990: #010115;
    --navy-900: #0a0a3a;
    --sky-500: #3295eb;
    --sky-400: #5aaaf0;
    --logo-cyan: #1eb9e5;
    --white: #ffffff;
    --grey-450: #b7b7b7;
    --line-night: #23234f;
    --red-heart: #eb3238;
    --danger-on-navy: #ff8a80;
    --delay: 1000ms;
    --control-line: rgba(183, 183, 183, .55);   /* 3.9:1 on the panel: control borders */
    --font-sans: "Encode Sans", "Helvetica Neue", Arial, sans-serif;
    --ease-out: cubic-bezier(.2, .7, .1, 1);
    --ease-expo: cubic-bezier(.16, 1, .3, 1);

    position: relative;
    isolation: isolate;
    min-height: 100svh;
    color: var(--white);
    font: 400 16px/1.55 var(--font-sans);
    -webkit-font-smoothing: antialiased;
    background: radial-gradient(90% 80% at 70% 45%, var(--navy-950) 0%, var(--navy-990) 72%);
}

/* ==========================================================================
   Assembly: the sign-in pages (login and 2FA) and the arrival after sign-in.
   Scoped to .assembly (sign-in pages), .arrive and html.is-arriving, so it is
   safe to load on every page. Colours are the Diytify design-system tokens.
   ========================================================================== */
.page-login turbo-frame { display: block; }
.assembly *, .assembly *::before, .assembly *::after { box-sizing: border-box; }

/* The scene sits behind everything and never scrolls. */
.assembly__canvas { position: fixed; inset: 0; z-index: -2; width: 100%; height: 100%; display: block; }
.assembly__grain {
  position: fixed; inset: -50%; z-index: -1; pointer-events: none; opacity: .06; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: assembly-grain 1.2s steps(6) infinite;
}
@keyframes assembly-grain { 0%, 100% { transform: translate(0, 0) } 25% { transform: translate(-3%, 2%) } 50% { transform: translate(2%, -4%) } 75% { transform: translate(3%, 3%) } }
.assembly.no-webgl .assembly__canvas { display: none; }

/* ---------- layout: panel on the left, the D on the right ---------- */
.assembly__stage {
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 460px) 1fr;
  grid-template-rows: 1fr auto;
  align-items: center;
  gap: 24px clamp(24px, 6vw, 96px);
  padding: calc(env(safe-area-inset-top, 0px) + 28px) clamp(16px, 6vw, 96px) calc(env(safe-area-inset-bottom, 0px) + 20px);
}

/* ---------- the glass panel ---------- */
.assembly__panel {
  position: relative;
  padding: 40px clamp(24px, 3vw, 40px) 32px;
  background: linear-gradient(160deg, rgba(10, 10, 58, .72), rgba(2, 2, 45, .62));
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 4px;
  box-shadow: 0 30px 80px rgba(1, 1, 21, .55), inset 0 1px 0 rgba(255, 255, 255, .06);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  backdrop-filter: blur(18px) saturate(1.2);
  animation: assembly-rise .9s var(--ease-expo) both .15s;
}

.assembly__panel.is-shaking { animation: assembly-shake .5s var(--ease-out) both; }
@keyframes assembly-rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes assembly-shake {
  0%, 100% { transform: none; }
  20% { transform: translateX(-10px); } 40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); } 80% { transform: translateX(3px); }
}

.assembly__logo { display: block; width: 132px; height: auto; margin: 0 0 32px; }
.assembly__eyebrow {
  margin: 0 0 12px; font-size: 12px; font-weight: 700; font-stretch: 125%;
  letter-spacing: .2em; text-transform: uppercase; color: var(--sky-500);
}
.assembly__title { margin: 0; font-size: clamp(32px, 3.4vw, 44px); font-weight: 900; line-height: 1; letter-spacing: -0.03em; color: var(--white); }
.assembly__lead { margin: 12px 0 0; font-size: 16px; color: var(--grey-450); }

.assembly__error {
  display: flex; gap: 10px; align-items: flex-start;
  margin: 24px 0 0; padding: 12px 14px;
  border: 1px solid rgba(244, 67, 54, .55); border-radius: 4px;
  background: rgba(244, 67, 54, .1);
  color: var(--danger-on-navy); font-size: 14px; font-weight: 600; line-height: 1.4;
}
.assembly__error::before { flex: none; width: 8px; height: 8px; margin-top: 5px; background: currentColor; }

/* ---------- form ---------- */
.assembly__form { display: grid; gap: 20px; margin: 28px 0 0; }
.assembly__field { display: grid; gap: 8px; }
.assembly__label-row { display: flex; justify-content: space-between; align-items: baseline; }
.assembly__field label, .assembly__label {
  margin: 0; font-size: 13px; font-weight: 600; letter-spacing: .04em; color: var(--grey-450);
}
.assembly__input {
  display: block; width: 100%; height: 52px; padding: 0 16px;
  font: 500 16px var(--font-sans); /* 16px stops iOS zooming into the field */
  color: var(--white);
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--control-line);
  border-radius: 4px;
  transition: border-color .2s linear, box-shadow .2s linear, background-color .2s linear;
}
.assembly__input::placeholder { color: rgba(183, 183, 183, .6); }
.assembly__input:hover { border-color: rgba(183, 183, 183, .8); }
.assembly__input:focus { outline: 0; border-color: var(--sky-500); background: rgba(50, 149, 235, .06); box-shadow: 0 0 0 3px rgba(50, 149, 235, .25); }
.assembly__input:-webkit-autofill,
.assembly__input:-webkit-autofill:hover,
.assembly__input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--white);
  -webkit-box-shadow: 0 0 0 1000px #0b0b3d inset;
  caret-color: var(--white);
  transition: background-color 9999s;
}
.assembly__reveal {
  padding: 0; border: 0; background: none; cursor: pointer;
  font: 600 13px var(--font-sans); letter-spacing: .04em; color: var(--sky-500);
}
.assembly__reveal:hover { color: var(--sky-400); }

.assembly .assembly__links { display: flex; justify-content: flex-end; margin-top: -6px; }
.assembly .assembly__links a:link, .assembly .assembly__links a:visited { color: var(--sky-500); font-size: 14px; font-weight: 600; text-decoration: none; }
.assembly .assembly__links a:hover { color: var(--sky-400); text-decoration: underline; }

.assembly__submit {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; height: 54px; margin-top: 4px;
  font: 700 16px var(--font-sans); color: var(--navy-950);
  background: var(--sky-500); border: 0; border-radius: 1000px; cursor: pointer;
  transition: background-color .2s linear, transform .2s var(--ease-out);
}
.assembly__submit:hover { background: var(--sky-400); }
.assembly__submit:active { transform: translateY(1px); }
.assembly__submit.is-busy { cursor: progress; }
.assembly__submit.is-busy .assembly__submit-label::after { content: "…"; }
.assembly__submit-dot { display: none; width: 8px; height: 8px; background: var(--navy-950); animation: assembly-dot .8s linear infinite; }
.assembly__submit.is-busy .assembly__submit-dot { display: block; }
@keyframes assembly-dot { to { transform: rotate(360deg); } }

.assembly__note { margin: 20px 0 0; font-size: 14px; color: var(--grey-450); text-align: center; }

/*.assembly :focus-visible { outline: 2px solid var(--sky-500); outline-offset: 3px; }*/

/* ---------- 2FA: six pixel slots ---------- */
.assembly__digits { display: flex; justify-content: space-between; gap: 8px; }
.assembly__digits label { flex: 1; margin: 0; }
.assembly__digit {
  display: block; width: 100%; max-width: 56px; height: 60px; margin: 0 auto; padding: 0;
  font: 800 24px var(--font-sans); text-align: center; color: var(--white);
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--control-line); border-radius: 4px;
  transition: border-color .2s linear, box-shadow .2s linear, background-color .2s linear;
}
.assembly__digit:focus { outline: 0; border-color: var(--sky-500); box-shadow: 0 0 0 3px rgba(50, 149, 235, .25); }
.assembly__digit:not(:placeholder-shown) { border-color: var(--logo-cyan); background: rgba(30, 185, 229, .12); }
.assembly__trusted { display: flex; gap: 10px; align-items: center; margin: 0; font-size: 14px; color: var(--grey-450); }
.assembly__trusted input { width: 18px; height: 18px; accent-color: var(--sky-500); }

/* ---------- footer ---------- */
.assembly__footer {
  grid-column: 1 / -1; align-self: end;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 20px;
  font-size: 12px; letter-spacing: 1px; color: var(--grey-450);
}
.assembly__footer .fa-heart, .assembly__footer svg { color: var(--red-heart); }

/* ---------- narrow screens: the D above, the panel below ---------- */
@media (max-width: 859px), (max-aspect-ratio: 11/10) {
  .assembly__stage {
    grid-template-columns: minmax(0, 1fr);
    align-items: end;
    padding-top: calc(env(safe-area-inset-top, 0px) + 34vh);
  }
  .assembly__panel { width: 100%; max-width: 460px; justify-self: center; }
  .assembly__footer { justify-content: center; text-align: center; }
  .assembly.no-webgl .assembly__stage { padding-top: calc(env(safe-area-inset-top, 0px) + 28px); align-items: center; }
}
@media (max-width: 420px) {
  .assembly__panel { padding: 32px 20px 24px; }
  .assembly__logo { width: 116px; margin-bottom: 24px; }
  .assembly__digits { gap: 6px; }
  .assembly__digit { height: 54px; font-size: 22px; }
}

/* ---------- calm mode (prefers-reduced-motion) ---------- */
@media (prefers-reduced-motion: reduce) {
  .assembly__grain, .assembly__submit-dot { animation: none !important; }
  .assembly__panel { animation: assembly-fade .6s linear both; }
  .assembly__panel.is-shaking { animation: none; border-color: rgba(244, 67, 54, .7); }
}
@keyframes assembly-fade { from { opacity: 0; } to { opacity: 1; } }

/* ==========================================================================
   Arrival after sign-in (arrive controller)
   ========================================================================== */
/* Set by an inline script in <head> before first paint: cover the page in navy. */
html.is-arriving body::before {
  content: ""; position: fixed; inset: 0; z-index: 2147483000; background: #02022d;
  animation: arrive-safety 0s linear 3s forwards; /* never trap the page if scripts fail */
}
@keyframes arrive-safety { to { opacity: 0; visibility: hidden; } }

.arrive {
  position: fixed; inset: 0; z-index: 2147483001; pointer-events: none;
  display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(60% 60% at 50% 50%, #0a0a3a 0%, #02022d 60%, #010115 100%);
}
.arrive__mark { width: 120px; height: auto; filter: drop-shadow(0 20px 60px rgba(50, 149, 235, .5)); }
.arrive__px {
  position: absolute; left: 50%; top: 50%;
  width: var(--size); height: var(--size); margin: calc(var(--size) / -2) 0 0 calc(var(--size) / -2);
  background: #3295eb; opacity: 0;
}
.arrive__px:nth-child(3n) { background: #1eb9e5; }
.arrive__px:nth-child(4n) { background: #ffffff; }
.arrive.is-playing { animation: arrive-open 1.25s cubic-bezier(.7, 0, .2, 1) forwards; }
.arrive.is-playing .arrive__mark { animation: arrive-mark 1.25s cubic-bezier(.7, 0, .2, 1) forwards; }
.arrive.is-playing .arrive__px { animation: arrive-px 1.1s cubic-bezier(.2, .7, .1, 1) var(--delay) forwards; }
@keyframes arrive-open {
  0%, 35% { background-color: #02022d; opacity: 1; }
  100% { opacity: 0; }
}
@keyframes arrive-mark {
  0% { transform: scale(1) rotate(0); opacity: 1; }
  30% { transform: scale(.82) rotate(-6deg); }
  70% { opacity: 1; }
  100% { transform: scale(26) rotate(8deg); opacity: 0; }
}
@keyframes arrive-px {
  0% { transform: translate(0, 0) scale(.4); opacity: 0; }
  15% { opacity: 1; }
  100% { transform: translate(var(0), var(0)) scale(1) rotate(180deg); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .arrive.is-playing { animation: arrive-open .7s linear forwards; }
  .arrive.is-playing .arrive__mark { animation: arrive-fade .7s linear forwards; }
  .arrive__px { display: none; }
}
@keyframes arrive-fade { to { opacity: 0; } }
