html:has(body:not(.booting) #authScreen.collage-auth:not(.hidden)),
body:not(.booting):has(#authScreen.collage-auth:not(.hidden)) { background: #ffc4db; }

html[data-theme="dark"]:has(body:not(.booting) #authScreen.collage-auth:not(.hidden)),
html[data-theme="dark"] body:not(.booting):has(#authScreen.collage-auth:not(.hidden)) { background: #30091c; }

.editorial-product #authScreen.collage-auth {
  --auth-canvas: #ffc4db;
  --auth-paper: #fff8ee;
  --auth-input: #fffdf6;
  --auth-ink: #4a0928;
  --auth-muted: #71394f;
  --auth-action: #65072e;
  --auth-action-text: #fff8ee;
  --auth-accent: #a7124f;
  --auth-outline: #65072e3f;
  --auth-grid: #b3638320;
  display: block;
  width: 100%;
  height: auto;
  min-height: 100vh;
  min-height: 100svh;
  overflow: visible;
  color: var(--auth-ink);
  background: var(--auth-canvas);
  font-family: 'Golos Text', Arial, sans-serif;
  color-scheme: light;
}

html[data-theme="dark"] .editorial-product #authScreen.collage-auth {
  --auth-canvas: #30091c;
  --auth-paper: #48112c;
  --auth-input: #3a1025;
  --auth-ink: #ffdfeb;
  --auth-muted: #f4bed3;
  --auth-action: #ffc4db;
  --auth-action-text: #4a0928;
  --auth-accent: #ff9cc9;
  --auth-outline: #ffb5d977;
  --auth-grid: #ffb5d92b;
  color-scheme: dark;
}

#authScreen.collage-auth .auth-scene-header,
#authScreen.collage-auth .collage-auth-layout {
  width: min(1160px, calc(100% - 64px));
  margin-inline: auto;
}

#authScreen.collage-auth .auth-scene-header {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-block: max(12px, env(safe-area-inset-top)) 12px;
}

#authScreen.collage-auth .auth-scene-brand {
  color: var(--auth-ink);
  font: 400 clamp(18px, 2vw, 25px)/1 'Dela Gothic One', Arial, sans-serif;
  letter-spacing: -.07em;
  text-decoration: none;
  white-space: nowrap;
}

#authScreen.collage-auth .auth-scene-brand sup {
  padding-left: 3px;
  vertical-align: top;
  font: 700 9px/1 Arial, sans-serif;
  letter-spacing: 0;
}

#authScreen.collage-auth .auth-scene-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(5px, 1.3vw, 18px);
}

#authScreen.collage-auth .auth-scene-nav a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  color: var(--auth-ink);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

#authScreen.collage-auth .auth-scene-nav a:hover { text-decoration: underline; }

#authScreen.collage-auth .theme-toggle {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  color: var(--auth-ink);
  border: 1px solid var(--auth-outline);
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
}

#authScreen.collage-auth .collage-auth-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(0, .94fr);
  align-items: stretch;
  gap: clamp(20px, 4vw, 48px);
  padding: 22px 0 max(42px, env(safe-area-inset-bottom));
}

#authScreen.collage-auth .collage-auth-visual {
  position: relative;
  display: grid;
  isolation: isolate;
  align-items: end;
  min-height: 520px;
  margin: 0;
  overflow: hidden;
  color: #65072e;
  border: 1px solid #65072e3f;
  border-radius: 32px;
  background: radial-gradient(ellipse at 50% 55%, #ffdfec 1%, #ffa1c9 76%);
}

#authScreen.collage-auth .collage-auth-visual::before {
  position: absolute;
  z-index: -1;
  inset: 15% 13% -24%;
  transform: rotate(-8deg);
  border: 1px solid #b54a773f;
  border-radius: 49% 52% 4% 8%;
  background: repeating-linear-gradient(0deg, #884a6920 0 1px, transparent 1px 22px), #fff8ed;
  content: '';
}

#authScreen.collage-auth .collage-auth-visual img {
  display: block;
  width: 105%;
  max-width: none;
  height: auto;
  margin-left: -2%;
  filter: drop-shadow(2px 0 #fff7ee) drop-shadow(-2px 0 #fff7ee) drop-shadow(0 -2px #fff7ee);
}

#authScreen.collage-auth .collage-auth-visual figcaption {
  position: absolute;
  top: 9%;
  right: 8%;
  z-index: 1;
  padding: 8px 19px 10px;
  transform: rotate(8deg);
  background: #f6ff83;
  box-shadow: 2px 4px 0 #65072e25;
  font: 600 clamp(22px, 3vw, 36px)/1.1 'Caveat', cursive;
}

#authScreen.collage-auth .collage-auth-heart {
  position: absolute;
  top: 13%;
  left: 9%;
  width: 60px;
  fill: none;
  stroke: #a7124f;
  stroke-linecap: round;
  stroke-width: 4px;
  transform: rotate(-19deg);
}

.editorial-product #authScreen.collage-auth .auth-panel {
  width: 100%;
  height: auto;
  min-width: 0;
  justify-content: center;
  margin: 0;
  padding: clamp(24px, 3.2vw, 42px);
  overflow: visible;
  color: var(--auth-ink);
  border: 1px solid var(--auth-outline);
  border-radius: 26px;
  background-color: var(--auth-paper);
  background-image: linear-gradient(var(--auth-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--auth-grid) 1px, transparent 1px);
  background-size: 21px 21px;
  box-shadow: 4px 6px 0 #65072e20;
}

#authScreen.collage-auth .auth-panel::before { content: none; }

#authScreen.collage-auth .auth-kicker {
  align-self: flex-start;
  padding: 7px 12px;
  border: 1px solid var(--auth-outline);
  border-radius: 50px;
  background: var(--auth-paper);
  color: var(--auth-accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .07em;
}

.editorial-product #authScreen.collage-auth .auth-panel h1 {
  max-width: 475px;
  margin: 14px 0 12px;
  color: var(--auth-ink);
  font: 400 clamp(24px, 2.55vw, 36px)/1.16 'Dela Gothic One', Arial, sans-serif;
  letter-spacing: -.055em;
  overflow-wrap: anywhere;
}

#authScreen.collage-auth .auth-panel > .muted {
  margin: 0 0 18px;
  color: var(--auth-muted);
  font-size: 16px;
  line-height: 1.55;
  opacity: 1;
}

#authScreen.collage-auth[data-auth-copy="trial"] :is(.auth-kicker, .auth-direct-note) { display: none; }

#authScreen.collage-auth .auth-direct-note {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 10px;
  margin: 0 0 14px;
  padding: 10px 12px;
  color: var(--auth-ink);
  border: 1px solid var(--auth-outline);
  border-radius: 12px;
  background: var(--auth-paper);
  font-size: 13px;
  box-shadow: none;
}

#authScreen.collage-auth .auth-direct-note small { display: block; color: var(--auth-muted); font-size: 12px; }
#authScreen.collage-auth .auth-direct-note small:empty { display: none; }

#authScreen.collage-auth .auth-tabs {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px;
  margin: 0 0 16px;
  padding: 3px;
  border: 1px solid var(--auth-outline);
  border-radius: 25px;
  background: var(--auth-paper);
}

#authScreen.collage-auth .auth-tabs button {
  min-height: 44px;
  padding: 7px 8px;
  color: var(--auth-muted);
  border: 0;
  border-radius: 22px;
  background: transparent;
  font: 600 13px/1.3 'Golos Text', Arial, sans-serif;
}

#authScreen.collage-auth .auth-tabs button.active {
  color: var(--auth-action-text);
  background: var(--auth-action);
}

#authScreen.collage-auth .auth-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

#authScreen.collage-auth .auth-form > label { gap: 6px; color: var(--auth-ink); font-size: 13px; font-weight: 600; }

#authScreen.collage-auth .auth-form input:not([type="checkbox"]) {
  width: 100%;
  min-height: 49px;
  padding: 8px 12px;
  border: 1px solid var(--auth-outline);
  border-radius: 12px;
  color: var(--auth-ink);
  background: var(--auth-input);
  font: 400 16px/1.3 'Golos Text', Arial, sans-serif;
}

#authScreen.collage-auth .auth-form input::placeholder { color: var(--auth-muted); opacity: 1; font-size: 13px; }

#authScreen.collage-auth .legal-consent-group {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1.2fr) minmax(0, .85fr);
  gap: 0 clamp(6px, 1vw, 12px);
  padding: 0;
}

#authScreen.collage-auth .auth-form .legal-consent {
  display: grid;
  align-items: center;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 5px;
  min-height: 44px;
  margin: 0;
  padding: 0;
  color: var(--auth-ink);
  border: 0;
  background: transparent;
  font-size: 12px;
  font-weight: 500;
}

#authScreen.collage-auth .legal-consent span { overflow-wrap: anywhere; }

#authScreen.collage-auth .legal-consent-age { grid-column: 1 / -1; }
#authScreen.collage-auth .legal-consent input { width: 18px; height: 18px; min-height: 18px; margin: 0; accent-color: var(--auth-action); }
#authScreen.collage-auth :is(.legal-consent, .auth-legal-links) a { color: var(--auth-ink); text-decoration: underline; }

.editorial-product #authScreen.collage-auth .auth-form > .primary {
  grid-column: 1 / -1;
  position: relative;
  min-height: 54px;
  padding: 10px 32px;
  color: var(--auth-action-text);
  border: 1px solid var(--auth-action);
  border-radius: 40px;
  background: var(--auth-action);
  box-shadow: none;
  font: 600 15px/1.3 'Golos Text', Arial, sans-serif;
}

.editorial-product #authScreen.collage-auth .auth-form > .primary:hover:not(:disabled) {
  box-shadow: 0 3px 0 var(--auth-outline);
}

#authScreen.collage-auth .auth-form > .primary::after {
  position: absolute;
  right: 14px;
  top: 50%;
  translate: 0 -50%;
  font-size: 18px;
  content: '↗';
}

#authScreen.collage-auth .auth-panel .auth-note,
#authScreen.collage-auth .auth-panel .auth-scene-identity {
  margin: 12px 0 0;
  color: var(--auth-muted);
  text-align: left;
  font-size: 12px;
  line-height: 1.5;
}

#authScreen.collage-auth .auth-legal-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 0 14px;
  margin: 6px 0 0;
}

#authScreen.collage-auth .auth-legal-links a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  font-size: 12px;
  font-weight: 500;
}

#authScreen.collage-auth .auth-panel .auth-scene-identity { margin-top: 0; }

#authScreen.collage-auth :is(a, button, input):focus-visible {
  outline: 2px solid var(--auth-accent);
  outline-offset: 3px;
}

#authScreen.collage-auth:not(.hidden) .auth-panel > * { animation: none; }

@media (prefers-reduced-motion: no-preference) {
  #authScreen.collage-auth .collage-auth-visual img { animation: collage-auth-arrival 420ms ease-out both; }
}

@keyframes collage-auth-arrival {
  from { opacity: .82; transform: translateY(10px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 900px) {
  #authScreen.collage-auth .auth-scene-header,
  #authScreen.collage-auth .collage-auth-layout { width: min(550px, calc(100% - 40px)); }

  #authScreen.collage-auth .auth-scene-header { min-height: 63px; }
  #authScreen.collage-auth .collage-auth-layout { grid-template-columns: minmax(0, 1fr); gap: 14px; padding-top: 2px; }

  #authScreen.collage-auth .collage-auth-visual {
    min-height: 0;
    height: clamp(184px, 45vw, 244px);
    border-radius: 23px;
  }

  #authScreen.collage-auth .collage-auth-visual img {
    position: absolute;
    top: 4px;
    left: 50%;
    width: min(78%, 360px);
    margin: 0;
    translate: -51% 0;
  }

  #authScreen.collage-auth .collage-auth-heart { top: 14%; width: 34px; }
  #authScreen.collage-auth .collage-auth-visual figcaption { top: 9%; right: 5%; padding: 6px 10px; }
  .editorial-product #authScreen.collage-auth .auth-panel { padding: 22px; border-radius: 21px; }
}

@media (max-width: 540px) {
  #authScreen.collage-auth .auth-scene-header,
  #authScreen.collage-auth .collage-auth-layout {
    width: auto;
    margin-inline: max(14px, env(safe-area-inset-left)) max(14px, env(safe-area-inset-right));
  }

  #authScreen.collage-auth .auth-scene-nav a[href="/"] { display: none; }
  #authScreen.collage-auth .auth-scene-nav a[href="/lab"] { max-width: 115px; font-size: 12px; line-height: 1.25; }
  #authScreen.collage-auth .auth-form { grid-template-columns: minmax(0, 1fr); }
  .editorial-product #authScreen.collage-auth .auth-panel { padding: 18px 15px 17px; }
  .editorial-product #authScreen.collage-auth .auth-panel h1 { font-size: clamp(22px, 6.25vw, 29px); }
  #authScreen.collage-auth .auth-panel > .muted { margin-bottom: 14px; font-size: 15px; }
}
