/* ══ Molecular Bento 2.0 — the sign-in pages (step 1 of the new look; the rest of the platform follows later).
   Three bento columns: the hero card (Dr. Maher among the scientists, orbits, the gradient), the form
   card, and three small cards (the atom, the subjects, the other sign-in). Day: lavender air and white
   cards. Night: deep plum and violet light. Loaded only by the sign-in layout (views/layouts/bare.php). ══ */

:root {
  --font-display: "Alexandria", "IBM Plex Sans Arabic", "Segoe UI", sans-serif;
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --ease: cubic-bezier(.16, 1, .3, 1);
  --r-xl: 32px; --r-lg: 26px; --r-md: 18px;
  --primary: #ffd21f; --on-primary: #1b1233; --primary-hover: #ffdb4d; --primary-edge: #c9a000;
  --hero: linear-gradient(150deg, #3b0f8a 0%, #6d28d9 34%, #9333ea 62%, #db2777 100%);
  --hero-text-shade: linear-gradient(to top, rgba(26, 6, 58, .55), transparent 46%);

  color-scheme: light;
  --bg: #f4f0ff; --surface: #ffffff; --surface-2: #f4f0ff; --text: #1b1233; --muted: #5f5680; --border: #e7e0fb;
  --input-bg: #f3effd; --input-border: transparent; --brand: #6d28d9; --link: #6d28d9; --brand-soft: #efe8ff;
  --card: rgba(255, 255, 255, .82); --card-line: rgba(255, 255, 255, .9);
  --card-shadow: inset 0 1px 0 #fff, 0 2px 6px rgba(60, 30, 140, .04), 0 28px 60px -28px rgba(76, 29, 149, .28);
  --tile: #ffffff;
  --ring: 0 0 0 4px rgba(124, 58, 237, .16);
  --amb1: rgba(167, 139, 250, .5); --amb2: rgba(244, 114, 182, .26); --amb3: rgba(255, 210, 31, .18);
  --orbit-line: rgba(124, 58, 237, .28); --chip-bg: #f1ebff;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a0514; --surface: #160d2a; --surface-2: #1d1236; --text: #f6f2ff; --muted: #b3a7d6; --border: #2a1f47;
  --input-bg: #1d1236; --input-border: transparent; --brand: #c4b0ff; --link: #c9b6ff; --brand-soft: #2a1b4d;
  --card: rgba(24, 14, 46, .78); --card-line: rgba(255, 255, 255, .07);
  --card-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), 0 30px 70px -30px rgba(0, 0, 0, .85);
  --tile: #170e2c;
  --ring: 0 0 0 4px rgba(183, 156, 255, .24);
  --amb1: rgba(124, 58, 237, .42); --amb2: rgba(219, 39, 119, .2); --amb3: rgba(255, 210, 31, .07);
  --orbit-line: rgba(196, 176, 255, .3); --chip-bg: #241843;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) {
    color-scheme: dark;
    --bg: #0a0514; --surface: #160d2a; --surface-2: #1d1236; --text: #f6f2ff; --muted: #b3a7d6; --border: #2a1f47;
    --input-bg: #1d1236; --input-border: transparent; --brand: #c4b0ff; --link: #c9b6ff; --brand-soft: #2a1b4d;
    --card: rgba(24, 14, 46, .78); --card-line: rgba(255, 255, 255, .07);
    --card-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), 0 30px 70px -30px rgba(0, 0, 0, .85);
    --tile: #170e2c;
    --ring: 0 0 0 4px rgba(183, 156, 255, .24);
    --amb1: rgba(124, 58, 237, .42); --amb2: rgba(219, 39, 119, .2); --amb3: rgba(255, 210, 31, .07);
    --orbit-line: rgba(196, 176, 255, .3); --chip-bg: #241843;
  }
}

/* ── the air: lavender (day) or plum (night) light drifting slowly; the old DNA only at night, faintly ── */
body:not(.site):has(> .auth), body:not(.site):has(> .dna-bg) { background: var(--bg); color: var(--text); }
body:has(> .auth)::before {
  content: ""; position: fixed; inset: 0; transform: scale(1.2); z-index: 0; pointer-events: none;
  background: radial-gradient(36% 32% at 86% 6%, var(--amb1), transparent 70%), radial-gradient(32% 30% at 6% 94%, var(--amb2), transparent 70%), radial-gradient(24% 22% at 44% 58%, var(--amb3), transparent 70%);
  animation: sAmb 44s ease-in-out infinite alternate;
}
@keyframes sAmb { to { transform: translate3d(-4%, 3%, 0) scale(1.3); } }
.dna-bg { display: none; }
:root[data-theme="dark"] .dna-bg { display: block; opacity: .16; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]):not([data-theme="dark"]) .dna-bg { display: block; opacity: .16; } }

/* ── the grid ── */
.auth.auth--bento {
  position: relative; z-index: 1; display: grid; gap: 18px; align-items: stretch; justify-items: stretch;
  grid-template-columns: minmax(0, 1fr); inline-size: 100%; max-inline-size: 1440px; min-block-size: 100vh; margin-inline: auto;
  padding: 20px 16px 28px; background: none !important;
}
.auth--bento .auth__hero { display: none !important; }
.auth--bento .auth__col { display: flex; flex-direction: column; gap: 14px; inline-size: 100%; max-inline-size: none; justify-items: stretch; }

/* ── the form card ── */
.auth--bento .auth__card {
  flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 4px;
  padding: 36px 34px; border-radius: var(--r-xl); background: var(--card); border: 1px solid var(--card-line); box-shadow: var(--card-shadow);
  backdrop-filter: saturate(1.6) blur(24px); -webkit-backdrop-filter: saturate(1.6) blur(24px); color: var(--text);
}
.auth--bento .auth__brand { justify-content: flex-start; color: var(--brand); font-family: var(--font-display); font-weight: 600; font-size: .95rem; letter-spacing: .02em; }
.auth--bento .auth__card h1 { margin: 2px 0 2px; font-family: var(--font-display); font-weight: 800; font-size: clamp(1.7rem, 2.3vw, 2.15rem); letter-spacing: -.015em; line-height: 1.2; color: var(--text); }
.auth--bento .auth__sub { color: var(--muted); font-size: 1rem; margin: 0 0 14px; }
.auth--bento .form { gap: 16px; }
.auth--bento .field > label { font-family: var(--font-display); font-weight: 600; font-size: .95rem; color: var(--text); }
.auth--bento input[type="text"], .auth--bento input[type="password"], .auth--bento input[type="email"], .auth--bento input[type="tel"] {
  min-block-size: 54px; padding: 0 22px; border-radius: 999px; border: 2px solid var(--input-border); background: var(--input-bg); color: var(--text); font-size: 1rem;
  transition: border-color .3s, box-shadow .35s var(--ease), background .3s;
}
.auth--bento input:hover:not(:focus) { background: color-mix(in srgb, var(--input-bg) 70%, var(--brand-soft)); }
.auth--bento input:focus { outline: none; border-color: #8b5cf6; background: var(--surface); box-shadow: var(--ring); }
.auth--bento .hint { color: var(--muted); }
.auth--bento .btn--primary {
  position: relative; overflow: hidden; isolation: isolate; inline-size: 100%; min-block-size: 56px; margin-block-start: 6px;
  border: 0; border-radius: 999px; background: var(--primary); color: var(--on-primary); font-family: var(--font-display); font-weight: 800; font-size: 1.08rem;
  box-shadow: 0 6px 0 var(--primary-edge), 0 18px 34px -12px rgba(255, 190, 0, .7);
  transition: transform .4s var(--spring), box-shadow .3s var(--ease), background .25s;
}
.auth--bento .btn--primary::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .75) 50%, transparent 70%); transform: translateX(-130%); transition: transform .9s var(--ease); }
.auth--bento .btn--primary:hover { background: var(--primary-hover); transform: translateY(-3px) scale(1.01); box-shadow: 0 9px 0 var(--primary-edge), 0 24px 40px -14px rgba(255, 190, 0, .75); }
.auth--bento .btn--primary:hover::after { transform: translateX(130%); }
.auth--bento .btn--primary:active { transform: translateY(6px); box-shadow: 0 0 0 var(--primary-edge), 0 6px 14px -8px rgba(255, 190, 0, .6); transition-duration: .08s; }
.auth--bento .auth__links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; margin-block-start: 14px; }
.auth--bento .auth__links a, .auth--bento .auth__card a { color: var(--link); font-weight: 600; text-decoration: none; background: linear-gradient(currentColor, currentColor) no-repeat 100% 100% / 0 1.5px; transition: background-size .35s var(--ease); }
.auth--bento .auth__links a:hover, .auth--bento .auth__card a:hover { background-size: 100% 1.5px; }
.auth--bento .alert { border-radius: 16px; }
.auth--bento .auth-phone { margin-block-end: 6px; }
.auth--bento .auth-more > summary { color: var(--muted); }
.auth__aux { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 18px; }
.auth__help, .auth__lang button { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 60%, transparent); color: var(--muted); font: inherit; font-size: .9rem; font-weight: 600; text-decoration: none; cursor: pointer; transition: color .25s, background .25s, transform .4s var(--spring); }
.auth__help:hover, .auth__lang button:hover { color: var(--brand); background: var(--surface); transform: translateY(-2px); }
.auth__lang { margin: 0; }
.auth__help .ico, .auth__lang .ico { inline-size: 16px; block-size: 16px; }
.auth__theme { position: static !important; inline-size: 40px; block-size: 40px; min-height: 40px; padding: 0; display: inline-grid; place-items: center; border-radius: 999px; color: var(--text); background: var(--card); border: 1px solid var(--card-line); box-shadow: var(--card-shadow); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); transition: transform .45s var(--spring); }
.auth__theme:hover { transform: rotate(-18deg) scale(1.08); }

/* ── the hero card ── */
.auth__stage { display: none; }
.auth__stage {
  position: relative; overflow: hidden; isolation: isolate; flex-direction: column; justify-content: space-between;
  padding: 30px; border-radius: var(--r-xl); color: #fff; background: var(--hero); background-size: 180% 180%;
  box-shadow: 0 40px 90px -34px rgba(76, 29, 149, .7), inset 0 1px 0 rgba(255, 255, 255, .25);
  animation: sGrad 16s ease-in-out infinite alternate;
}
@keyframes sGrad { 0% { background-position: 0% 20%; } 100% { background-position: 100% 80%; } }
.auth__stage::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(55% 45% at 72% 28%, rgba(255, 255, 255, .26), transparent 70%), radial-gradient(40% 30% at 18% 96%, rgba(255, 210, 31, .3), transparent 70%), var(--hero-text-shade); }
.auth__stage::after { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, .12) 50%, transparent 60%); background-size: 250% 100%; animation: sSheen 9s ease-in-out infinite; pointer-events: none; }
@keyframes sSheen { 0%, 60% { background-position: 150% 0; } 100% { background-position: -50% 0; } }
.auth__glow { position: absolute; z-index: -1; inline-size: 62%; aspect-ratio: 1; inset-inline-start: 50%; inset-block-start: 48%; translate: -50% -50%; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .34), rgba(255, 255, 255, .06) 55%, transparent 70%); filter: blur(6px); pointer-events: none; }
[dir="rtl"] .auth__glow { translate: 50% -50%; }
.auth__orbits { position: absolute; z-index: -1; inline-size: 132%; aspect-ratio: 1; inset-inline-start: 50%; inset-block-start: 47%; translate: -50% -50%; pointer-events: none; transition: transform 1.2s var(--ease); transform: translate(calc(var(--mx, 0) * 14px), calc(var(--my, 0) * 14px)); }
[dir="rtl"] .auth__orbits { translate: 50% -50%; }
.auth__orbit { position: absolute; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, .2); }
.auth__orbit i { position: absolute; inline-size: 12px; block-size: 12px; border-radius: 50%; inset-block-start: -6px; inset-inline-start: calc(50% - 6px); background: #ffd21f; box-shadow: 0 0 0 4px rgba(255, 210, 31, .25), 0 0 22px #ffd21f; }
.auth__orbit--1 { inset: 0; animation: sSpin 30s linear infinite; }
.auth__orbit--2 { inset: 14%; animation: sSpin 18s linear infinite reverse; border-color: rgba(255, 255, 255, .28); }
.auth__orbit--2 i { background: #fff; box-shadow: 0 0 0 4px rgba(255, 255, 255, .2), 0 0 18px #fff; }
.auth__orbit--3 { inset: 28%; animation: sSpin 11s linear infinite; border-style: dashed; border-color: rgba(255, 255, 255, .22); }
.auth__orbit--3 i { inline-size: 9px; block-size: 9px; inset-block-start: -4.5px; background: #f9a8d4; box-shadow: 0 0 0 3px rgba(249, 168, 212, .25), 0 0 14px #f9a8d4; }
@keyframes sSpin { to { rotate: 360deg; } }
.auth__stage-logo { position: relative; align-self: flex-start; display: inline-flex; padding: 10px 14px; border-radius: 16px; background: rgba(14, 4, 34, .32); border: 1px solid rgba(255, 255, 255, .18); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); transition: transform .5s var(--spring), background .3s; }
.auth__stage-logo:hover { transform: translateY(-2px) scale(1.03); background: rgba(14, 4, 34, .45); }
.auth__stage-logo img { display: block; block-size: 30px; inline-size: auto; }
.auth__stage-art { position: relative; flex: 1; display: grid; place-items: center; min-block-size: 0; padding-block: 8px; }
.auth__stage-art img { inline-size: min(100%, 480px); block-size: auto; max-block-size: 100%; object-fit: contain; filter: drop-shadow(0 34px 34px rgba(20, 4, 54, .5)); transform: translate(calc(var(--mx, 0) * -10px), calc(var(--my, 0) * -8px)); transition: transform 1.2s var(--ease); animation: sFloat 7s ease-in-out infinite; }
@keyframes sFloat { 0%, 100% { translate: 0 0; } 50% { translate: 0 -12px; } }
.auth__stage-text { position: relative; }
.auth__stage-text h2 { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: clamp(2rem, 2.8vw, 2.9rem); line-height: 1.15; letter-spacing: -.015em; color: #fff; text-shadow: 0 6px 30px rgba(20, 4, 54, .35); }
.auth__stage-text p { margin: 10px 0 0; max-inline-size: 38ch; color: rgba(255, 255, 255, .9); font-size: 1.04rem; line-height: 1.7; }

/* ── the three small cards ── */
.auth__side { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.auth__tile { position: relative; overflow: hidden; border-radius: var(--r-lg); background: var(--tile); border: 1px solid var(--card-line); box-shadow: var(--card-shadow); transition: transform .6s var(--spring), box-shadow .45s var(--ease); }
.auth__tile:hover { transform: perspective(900px) rotateX(4deg) rotateY(-5deg) translateY(-6px); }
.auth__atom { display: none; }
.auth__subjects { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 14px; }
.auth__el {
  --c: #8b5cf6; position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; gap: 6px;
  min-block-size: 92px; padding: 12px 14px; border-radius: 18px; color: var(--text);
  background: linear-gradient(145deg, color-mix(in srgb, var(--c) 16%, var(--tile)), color-mix(in srgb, var(--c) 4%, var(--tile)));
  border: 1px solid color-mix(in srgb, var(--c) 26%, transparent);
  transition: transform .55s var(--spring), box-shadow .45s var(--ease), border-color .35s;
}
.auth__el::after { content: ""; position: absolute; inline-size: 70px; block-size: 70px; inset-block-start: -30px; inset-inline-end: -26px; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--c) 40%, transparent); background: radial-gradient(circle at 50% 0, var(--c) 0 3px, transparent 4px); animation: sSpin 9s linear infinite; opacity: .8; }
.auth__el b { font-family: var(--font-display); font-weight: 800; font-size: 1.7rem; line-height: 1; letter-spacing: -.02em; color: var(--c); }
.auth__el small { font-family: var(--font-display); font-weight: 600; font-size: .86rem; color: var(--muted); }
.auth__el:hover { transform: translateY(-5px) rotate(-2deg); border-color: color-mix(in srgb, var(--c) 60%, transparent); box-shadow: 0 16px 30px -16px var(--c); }
.auth__el:hover::after { animation-duration: 2.4s; }
.auth__el--chem { --c: #8b5cf6; } .auth__el--phys { --c: #ec4899; } .auth__el--bio { --c: #10b981; } .auth__el--sci { --c: #f59e0b; }
.auth__el--sci::after { animation-direction: reverse; } .auth__el--phys::after { animation-duration: 12s; }
.auth__switch {
  display: flex; align-items: center; gap: 14px; padding: 16px 18px; text-decoration: none; color: #fff;
  background: linear-gradient(135deg, #2e1065, #4c1d95 55%, #6d28d9); border-color: rgba(255, 255, 255, .08);
  box-shadow: 0 22px 44px -22px rgba(76, 29, 149, .9), inset 0 1px 0 rgba(255, 255, 255, .14);
}
.auth__switch::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px; background: linear-gradient(120deg, #ffd21f, transparent 35%, transparent 65%, #f472b6); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; opacity: .7; pointer-events: none; }
.auth__switch-ico { position: relative; flex: none; display: grid; place-items: center; inline-size: 46px; block-size: 46px; border-radius: 14px; background: rgba(255, 210, 31, .16); color: #ffd21f; }
.auth__switch-ico::after { content: ""; position: absolute; inset: -4px; border-radius: 17px; border: 1.5px solid rgba(255, 210, 31, .45); animation: sRing 2.6s var(--ease) infinite; }
@keyframes sRing { 0% { opacity: .9; transform: scale(.92); } 100% { opacity: 0; transform: scale(1.25); } }
.auth__switch-ico .ico { inline-size: 22px; block-size: 22px; }
.auth__switch-text { flex: 1; min-inline-size: 0; display: grid; gap: 2px; line-height: 1.35; }
.auth__switch-text strong { font-family: var(--font-display); font-weight: 800; font-size: 1.05rem; }
.auth__switch-text small { color: rgba(255, 255, 255, .78); font-size: .88rem; }
.auth__switch-go { flex: none; display: grid; place-items: center; inline-size: 40px; block-size: 40px; border-radius: 50%; background: #ffd21f; color: #1b1233; box-shadow: 0 6px 16px -6px rgba(255, 210, 31, .8); transition: transform .5s var(--spring); }
.auth__switch:hover { box-shadow: 0 28px 50px -22px rgba(124, 58, 237, .95), inset 0 1px 0 rgba(255, 255, 255, .18); }
.auth__switch:hover .auth__switch-go { transform: translateX(-6px) scale(1.08); }
[dir="ltr"] .auth__switch-go svg { transform: scaleX(-1); }
[dir="ltr"] .auth__switch:hover .auth__switch-go { transform: translateX(6px) scale(1.08); }
.auth__switch:active { transform: scale(.98); }
.auth__switch:focus-visible, .auth__stage-logo:focus-visible, .auth__help:focus-visible, .auth__lang button:focus-visible { outline: 3px solid #a78bfa; outline-offset: 3px; }
.atom { inline-size: min(78%, 200px); block-size: auto; overflow: visible; }
.atom__rings ellipse { stroke: var(--orbit-line); stroke-width: 1.6; }
.atom__core { fill: #ffd21f; }
.atom__halo { animation: sPulse 3s ease-in-out infinite; transform-origin: 100px 100px; }
@keyframes sPulse { 0%, 100% { opacity: .7; transform: scale(.92); } 50% { opacity: 1; transform: scale(1.12); } }
.atom__e--1 { fill: #ffd21f; filter: drop-shadow(0 0 5px #ffd21f); }
.atom__e--2 { fill: #ec4899; filter: drop-shadow(0 0 5px #ec4899); }
.atom__e--3 { fill: #8b5cf6; filter: drop-shadow(0 0 5px #8b5cf6); }
.auth__atom-text { margin: 0; display: flex; align-items: baseline; justify-content: center; gap: 8px; color: var(--muted); font-weight: 600; }
.auth__atom-text strong { font-family: var(--font-display); font-weight: 800; font-size: 1.6rem; color: var(--text); }

/* ── sizes ── */
/* ══ phones and tablets: an app sign-in. The hero runs edge to edge at the top (the controls float on it
   as glass buttons), the form is a sheet rising over its lower edge, and everything below sits on the
   same sheet: the parents' way in and the four elements. ══ */
@media (max-width: 1099px) {
  :root { --sheet: #ffffff; }
  :root[data-theme="dark"] { --sheet: #120a22; }
  body:has(> .auth) { background: var(--sheet); }
  body:has(> .auth)::before { display: none; }
  .auth.auth--bento { gap: 0; padding: 0 0 max(28px, env(safe-area-inset-bottom, 0px)); max-inline-size: 640px; min-block-size: 100vh; background: var(--sheet) !important; }
  .auth--bento .auth__home { display: none; }

  /* the hero */
  .auth__stage {
    display: flex; justify-content: flex-start; gap: 8px; min-block-size: clamp(330px, 50vh, 440px);
    padding: calc(16px + env(safe-area-inset-top, 0px)) max(20px, env(safe-area-inset-right, 0px)) 92px max(20px, env(safe-area-inset-left, 0px));
    border-radius: 0 0 34px 34px; box-shadow: none; animation: sGrad 16s ease-in-out infinite alternate;
  }
  .auth__stage-logo { padding: 8px 12px; border-radius: 14px; }
  .auth__stage-logo img { block-size: 26px; }
  .auth__stage-text { position: relative; z-index: 1; max-inline-size: 60%; margin-block-start: 14px; animation: sPop .9s var(--spring) .15s backwards; }
  .auth__stage-text h2 { font-size: clamp(1.6rem, 7vw, 2.2rem); line-height: 1.18; }
  .auth__stage-text p { font-size: .88rem; line-height: 1.6; margin-block-start: 8px; color: rgba(255, 255, 255, .86); }
  .auth__stage-art { position: absolute; z-index: 0; inset-block-end: 40px; inset-inline-end: -10px; inline-size: 56%; max-inline-size: 300px; padding: 0; display: block; }
  .auth__stage-art img { inline-size: 100%; max-block-size: none; filter: drop-shadow(0 18px 24px rgba(20, 4, 54, .55)); }
  .auth__glow { inline-size: 80%; inset-inline-start: 74%; inset-block-start: 60%; }
  .auth__orbits { inline-size: 160%; inset-inline-start: 76%; inset-block-start: 58%; }
  .auth__orbit--1 { inset: 0; } .auth__orbit--2 { inset: 16%; } .auth__orbit--3 { inset: 31%; }

  /* the controls float on the hero, top corner */
  .auth--bento .auth__col { position: static; gap: 0; margin-block-start: -64px; }
  .auth__aux {
    position: absolute; z-index: 3; inset-block-start: calc(16px + env(safe-area-inset-top, 0px)); inset-inline-end: max(16px, env(safe-area-inset-left, 0px));
    gap: 8px; animation: none;
  }
  .auth__help, .auth__lang button, .auth__theme {
    inline-size: 42px; block-size: 42px; min-height: 42px; padding: 0; justify-content: center; border-radius: 14px; font-size: 0;
    background: rgba(14, 4, 34, .3) !important; border: 1px solid rgba(255, 255, 255, .2) !important; color: #fff !important; box-shadow: none !important;
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  }
  .auth__lang button { font-size: .8rem; font-weight: 800; inline-size: auto; padding-inline: 12px; }
  .auth__lang button .ico { display: none; }
  .auth__help .ico, .auth__theme .ico { inline-size: 20px; block-size: 20px; }

  /* the sheet */
  .auth--bento .auth__card {
    position: relative; z-index: 2; padding: 16px max(22px, env(safe-area-inset-right, 0px)) 22px max(22px, env(safe-area-inset-left, 0px));
    border: 0; border-radius: 32px 32px 0 0; background: var(--sheet); box-shadow: 0 -20px 40px -26px rgba(29, 10, 70, .55); backdrop-filter: none; -webkit-backdrop-filter: none;
    animation: sSheet .9s var(--spring) .05s backwards;
  }
  .auth--bento .auth__card::before { content: ""; display: block; inline-size: 46px; block-size: 5px; margin: 0 auto 18px; border-radius: 999px; background: color-mix(in srgb, var(--muted) 30%, transparent); }
  .auth--bento .auth__card h1 { font-size: 1.85rem; }
  .auth--bento .auth__brand { font-size: .9rem; }
  .auth--bento .form { gap: 14px; }
  .auth--bento #login, .auth--bento #password, .auth--bento #phone {
    min-block-size: 58px; border-radius: 18px; padding-inline-start: 50px; font-size: 16px;
    background-repeat: no-repeat; background-size: 22px 22px; background-position: right 16px center;
  }
  [dir="ltr"] .auth--bento #login, [dir="ltr"] .auth--bento #password, [dir="ltr"] .auth--bento #phone { background-position: left 16px center; }
  .auth--bento #login { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b5cf6' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 21a8 8 0 0116 0'/%3E%3C/svg%3E"); }
  .auth--bento #password { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b5cf6' stroke-width='2' stroke-linecap='round'%3E%3Crect x='4' y='10' width='16' height='11' rx='3'/%3E%3Cpath d='M8 10V7a4 4 0 018 0v3'/%3E%3C/svg%3E"); padding-inline-end: 52px; }
  .auth--bento #phone { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b5cf6' stroke-width='2' stroke-linecap='round'%3E%3Crect x='6' y='2' width='12' height='20' rx='3'/%3E%3Cpath d='M11 18h2'/%3E%3C/svg%3E"); }
  .auth--bento .btn--primary { min-block-size: 58px; border-radius: 18px; font-size: 1.1rem; }
  .auth--bento .auth__links { font-size: .92rem; }

  /* below the form, on the same sheet */
  .auth__side { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 4px max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px)); background: var(--sheet); }
  .auth__switch { order: -1; padding: 14px 16px; border-radius: 22px; }
  .auth__tile:hover { transform: none; }
  .auth__subjects { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 0; background: none; border: 0; box-shadow: none; }
  .auth__el { min-block-size: 78px; padding: 10px 6px; border-radius: 18px; align-items: center; text-align: center; }
  .auth__el b { font-size: 1.35rem; }
  .auth__el small { font-size: .72rem; line-height: 1.3; }
  .auth__el::after { inline-size: 46px; block-size: 46px; inset-block-start: -22px; inset-inline-end: -18px; }
}
@keyframes sSheet { from { transform: translateY(70px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (max-width: 1099px) and (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --sheet: #120a22; } }
@media (max-width: 420px) {
  .auth__stage { min-block-size: clamp(310px, 48vh, 400px); }
  .auth__stage-text { max-inline-size: 64%; }
  .auth__stage-text p { display: none; }
  .auth__stage-art { inline-size: 60%; inset-block-end: 46px; }
  .auth__el small { font-size: .66rem; }
}
/* the password can be shown while typing it (the eye in the field) */
.pw-wrap { position: relative; display: block; }
.pw-eye { position: absolute; inset-block-start: 50%; inset-inline-end: 8px; translate: 0 -50%; display: grid; place-items: center; inline-size: 42px; block-size: 42px; padding: 0; border: 0; border-radius: 12px; background: transparent; color: var(--muted); cursor: pointer; transition: color .25s, background .25s; }
.pw-eye:hover, .pw-eye[aria-pressed="true"] { color: var(--brand); background: var(--brand-soft); }
.pw-eye svg { inline-size: 20px; block-size: 20px; }
.pw-eye:focus-visible { outline: 3px solid #a78bfa; outline-offset: 2px; }
.auth--bento #password { padding-inline-end: 52px; }
/* computers: hero · form · small cards, one screen high */
@media (min-width: 1100px) {
  .auth.auth--bento { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, .66fr); padding: 24px; gap: 20px; block-size: 100vh; min-block-size: 640px; max-block-size: 920px; align-content: stretch; }
  .auth--bento .auth__home { display: none; }
  .auth__stage { display: flex; animation: sGrad 16s ease-in-out infinite alternate, sPop 1s var(--spring) both; }
  .auth__side { grid-template-columns: minmax(0, 1fr); grid-template-rows: 1.35fr 1fr auto; }
  .auth__atom { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 18px; }
  .auth--bento .auth__card { padding: 40px 38px; }
}

/* ── coming in ── */
@keyframes sPop { 0% { opacity: 0; transform: translateY(26px) scale(.95); } 70% { opacity: 1; } 100% { opacity: 1; transform: none; } }
.auth--bento .auth__card { animation: sPop .95s var(--spring) .1s backwards; }
.auth__tile { animation: sPop .9s var(--spring) backwards; }
.auth__tile:nth-child(1) { animation-delay: .2s; } .auth__tile:nth-child(2) { animation-delay: .3s; } .auth__tile:nth-child(3) { animation-delay: .4s; }
@keyframes sFlip { from { opacity: 0; transform: perspective(600px) rotateX(-80deg); } to { opacity: 1; transform: none; } }
.auth__el { animation: sFlip .9s var(--spring) backwards; transform-origin: top; }
.auth__el:nth-child(1) { animation-delay: .45s; } .auth__el:nth-child(2) { animation-delay: .55s; } .auth__el:nth-child(3) { animation-delay: .65s; } .auth__el:nth-child(4) { animation-delay: .75s; }
.auth__stage-text { animation: sPop 1s var(--spring) .3s backwards; }
.auth__aux { animation: sPop .9s var(--spring) .5s backwards; }

/* day ↔ night: a circle of the new theme grows from the button */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-new(root) { animation: sTheme .7s var(--ease); }
@keyframes sTheme { from { clip-path: circle(0 at var(--tx, 50%) var(--ty, 0%)); } to { clip-path: circle(150% at var(--tx, 50%) var(--ty, 0%)); } }
html.theme-fade, html.theme-fade * { transition: background-color .45s var(--ease), color .35s, border-color .35s, box-shadow .45s !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .atom__e { display: none; }
}

/* while signing in: a thin moving line at the top until the next page opens */
html.is-leaving body::after { content: ""; position: fixed; inset-inline: 0; inset-block-start: 0; z-index: 200; block-size: 3px; background: linear-gradient(90deg, transparent, #a78bfa, #f472b6, #ffd21f, transparent) no-repeat; background-size: 50% 100%; animation: sLoad 1.1s var(--ease) infinite; }
@keyframes sLoad { from { background-position: -50% 0; } to { background-position: 150% 0; } }

/* 0.51.2 the sign-in pages on a phone or a tablet: the page is a solid sheet, so the moving helices behind it
   (hidden by the sheet anyway) are not drawn at all, and nothing moves under a finger that scrolls */
@media (max-width: 1099px) { body:has(> .auth) .dna-bg { display: none !important; } }
/* 0.51.4 on a phone the sign-in sheet is the full width of the screen (a wide phone made it a card at one side) */
@media (max-width: 1099px) { .auth--bento .auth__card { max-inline-size: none; inline-size: 100%; margin-inline: 0; } }
