/* Tidava authentication system — shared structure and restrained motion.
   Loaded after each flow's structural styles. Authentication logic is unchanged. */

/* Comfortable targets without changing the visible language of inline links. */
body.auth-root .pw-toggle {
  min-width: 52px;
  min-height: 44px;
  right: 4px;
}
body.auth-root .field-link,
body.auth-root .login-terms-note a,
body.auth-root .already-have a,
body.auth-root .check-label a,
body.auth-root .back-link,
body.auth-root .auth-signin-link,
body.auth-root .auth-home-link,
body.auth-root .brand-panel > a[href="/"],
body.auth-root .reg-story-brand,
body.auth-root .link-button,
body.auth-root .field-hint button {
  display: inline-flex;
  align-items: center;
  min-width: 44px;
  min-height: 44px;
}
body.auth-root .field-link {
  padding-inline: 2px;
  white-space: nowrap;
}
body.auth-root .login-card > a[href="/"] {
  min-height: 44px;
  padding-block: 10px;
  margin-bottom: 8px !important;
}
body.auth-root .login-terms-note a,
body.auth-root .already-have a,
body.auth-root .check-label a {
  vertical-align: middle;
}
body.auth-root .check-label a {
  justify-content: center;
  padding-inline: 2px;
}
body.auth-root .check-label .consent-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 4px;
  margin: 4px 0;
}
body.auth-root .already-have a {
  padding-inline: 4px;
}
body.auth-root .auth-signin-link {
  padding: 0 12px;
}
body.auth-root .oauth-btn {
  min-height: 44px;
}

/* One control language for sign-in, signup, and verification. */
body.auth-root :where(input[type="text"], input[type="email"], input[type="password"]):not(.otp-input):not(.code-digit) {
  height: 52px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 12px;
  background: rgba(3, 7, 12, .58);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .025);
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
body.auth-root :where(input[type="text"], input[type="email"], input[type="password"]):not(.otp-input):not(.code-digit):focus {
  border-color: rgba(94, 234, 212, .72);
  background: rgba(3, 7, 12, .78);
  box-shadow: 0 0 0 3px rgba(94, 234, 212, .12), inset 0 1px 0 rgba(255, 255, 255, .035);
}
body.auth-root :where(input[type="text"], input[type="email"], input[type="password"])::placeholder {
  color: #8298b4;
  opacity: 1;
}
body.auth-root input:-webkit-autofill,
body.auth-root input:-webkit-autofill:hover,
body.auth-root input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px #0b151d inset;
  caret-color: var(--text);
}
body.auth-root :where(.login-card, .reg-left) label {
  color: #9aafcc;
  font-size: 12px;
  font-weight: 650;
}
body.auth-root .check-label {
  border-color: rgba(94, 234, 212, .20);
  background: rgba(94, 234, 212, .045);
}
body.auth-root .check-label:hover {
  border-color: rgba(94, 234, 212, .42);
}

/* Same primary action, including its enabled color, on both flows. */
body.auth-root .login-card button[type="submit"],
body.auth-root .submit-btn {
  height: 52px;
  border: 1px solid rgba(94, 234, 212, .30);
  border-radius: 12px;
  background: linear-gradient(135deg, #5eead4 0%, #22d3b8 58%, #1bb89f 100%);
  color: #07110f;
  font-size: 16px;
  font-weight: 750;
  box-shadow: 0 10px 26px rgba(34, 211, 184, .14), inset 0 1px 0 rgba(255, 255, 255, .28);
  transition: transform .16s ease, box-shadow .18s ease, filter .18s ease;
}
body.auth-root .login-card button[type="submit"]:hover,
body.auth-root .submit-btn:hover {
  filter: brightness(1.045);
  box-shadow: 0 14px 34px rgba(34, 211, 184, .22), inset 0 1px 0 rgba(255, 255, 255, .32);
}
body.auth-root .login-card button[type="submit"]:active,
body.auth-root .submit-btn:active {
  filter: brightness(.98);
  box-shadow: 0 6px 18px rgba(34, 211, 184, .12);
}
body.auth-root .login-card button[type="submit"]:disabled,
body.auth-root .submit-btn:disabled {
  cursor: not-allowed;
  filter: saturate(.65);
  transform: none;
}

/* Shared material and hierarchy. */
body.auth-root .login-card,
body.auth-root .reg-left {
  border: 1px solid rgba(94, 234, 212, .17);
  border-radius: 24px;
  background: linear-gradient(155deg, rgba(17, 27, 38, .94), rgba(9, 15, 23, .94));
  box-shadow: 0 30px 80px rgba(0, 0, 0, .38), inset 0 1px 0 rgba(255, 255, 255, .04);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
body.auth-root .login-heading,
body.auth-root .reg-title {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -.03em;
}
body.auth-root .login-terms-note {
  font-size: 12px;
  line-height: 1.6;
}

/* Signup now uses the same desktop story + contained form shell as sign-in. */
body.auth-root .reg-layout {
  width: min(1160px, calc(100% - 48px));
  min-height: 100vh;
  min-height: 100svh;
  margin: auto;
  padding: 24px 0;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(380px, 440px);
  gap: 64px;
  align-items: center;
}
body.auth-root .reg-left {
  grid-column: 2;
  grid-row: 1;
  width: 100%;
  max-width: 440px;
  justify-self: end;
  padding: 30px 32px;
}
body.auth-root .reg-right {
  grid-column: 1;
  grid-row: 1;
  width: 100%;
  max-width: 580px;
  padding: 16px 0;
  border: 0;
  background: transparent;
  overflow: visible;
  animation: none;
}
body.auth-root .reg-story-brand {
  margin-bottom: 20px;
}
body.auth-root .reg-right .brand-logo {
  display: block;
  width: min(330px, 78%);
  height: auto;
  filter: drop-shadow(0 16px 36px rgba(34, 211, 184, .18));
}
body.auth-root .reg-right .brand-kicker {
  margin-bottom: 16px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .2em;
  text-transform: uppercase;
}
body.auth-root .reg-right .right-eyebrow {
  margin-bottom: 14px;
}
body.auth-root .reg-right .right-headline {
  max-width: 560px;
  margin-bottom: 24px;
  font-size: clamp(34px, 3.6vw, 50px);
  line-height: 1.06;
  letter-spacing: -.045em;
}
body.auth-root .reg-right .feature-list {
  gap: 12px;
  margin-bottom: 28px;
}
body.auth-root .reg-right .feature-list li {
  line-height: 1.45;
}
body.auth-root .reg-right .right-social-proof {
  max-width: 540px;
  background: rgba(17, 27, 38, .58);
  border-color: rgba(94, 234, 212, .12);
}
body.auth-root .reg-left .brand-row {
  margin-bottom: 18px;
}
body.auth-root .reg-left .auth-home-link {
  display: none;
}
body.auth-root .reg-left .auth-top-actions {
  width: 100%;
  margin-left: 0;
  justify-content: space-between;
}
body.auth-root .reg-left .back-link {
  margin-left: 0;
  white-space: nowrap;
}
body.auth-root .reg-left .reg-title {
  margin-bottom: 8px;
}
body.auth-root .reg-left .reg-sub {
  margin-bottom: 20px;
}
body.auth-root .reg-left .field-row {
  grid-template-columns: 1fr;
  gap: 14px;
}
body.auth-root .reg-left .submit-note {
  line-height: 1.5;
}
body.auth-root .reg-left .already-have {
  margin-top: 12px;
}

/* Common single-column shell. Keep the logo and one home action on mobile. */
@media (max-width: 980px) {
  body.auth-root .reg-layout {
    width: min(480px, calc(100% - 32px));
    min-height: 100vh;
    min-height: 100svh;
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 24px 0;
  }
  body.auth-root .reg-left {
    grid-column: 1;
    grid-row: 1;
    max-width: 100%;
    justify-self: center;
    padding: 28px 22px;
  }
  body.auth-root .reg-right {
    display: none;
  }
  body.auth-root .reg-left .brand-row {
    gap: 12px;
    margin-bottom: 20px;
  }
  body.auth-root .reg-left .auth-home-link {
    display: inline-flex;
    flex: 0 1 auto;
  }
  body.auth-root .reg-left .auth-logo {
    width: auto;
    height: 44px;
  }
  body.auth-root .reg-left .auth-top-actions {
    width: auto;
    margin-left: auto;
  }
  body.auth-root .reg-left .auth-signin-link {
    display: none;
  }
  body.auth-root .reg-left .back-link {
    padding-inline: 4px;
    font-size: 12px;
  }
}

@media (max-width: 640px) {
  body.auth-root .login-card,
  body.auth-root .reg-left {
    padding: 26px 20px;
    border-radius: 22px;
  }
  body.auth-root .login-heading,
  body.auth-root .reg-title {
    font-size: 26px;
  }
}

@media (max-width: 360px) {
  body.auth-root .login-card,
  body.auth-root .reg-left {
    padding-inline: 16px;
  }
  body.auth-root .reg-left .auth-logo {
    height: 40px;
  }
  body.auth-root .reg-left .brand-row {
    gap: 8px;
  }
}


/* Priority 2: product meaning, not abstract decoration. */
body.auth-root .auth-product-visual {
  position: relative;
  width: min(100%, 540px);
  aspect-ratio: 2.2;
  margin: 0;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid rgba(94, 234, 212, .20);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(17, 27, 38, .72), rgba(5, 11, 17, .86));
  box-shadow: 0 22px 55px rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .05);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  animation: auth-product-in .46s cubic-bezier(.23, 1, .32, 1) both;
}
body.auth-root .auth-product-visual img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 54%;
}
body.auth-root .auth-product-visual::after {
  content: '';
  position: absolute;
  inset: 38% 0 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(3, 7, 12, .88));
}
body.auth-root .auth-product-visual figcaption {
  position: absolute;
  right: 16px;
  bottom: 13px;
  left: 16px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #dce8f5;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .12em;
  line-height: 1.4;
  text-transform: uppercase;
}
body.auth-root .auth-product-visual figcaption span:last-child {
  color: #a8bccf;
  font-size: 9px;
  letter-spacing: .08em;
  text-align: right;
}
@keyframes auth-product-in {
  from { opacity: 0; transform: translateY(10px) scale(.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Keep normal hover/active/focus feedback, but no perpetual CTA shimmer. */
body.auth-root .login-card button[type="submit"]::after,
body.auth-root .submit-btn::after {
  content: none;
  animation: none;
}

/* Short, simultaneous entrances; slower ambient motion; no story-parent motion. */
body.auth-root {
  animation-duration: .4s;
}
body.auth-root :where(h1, form, .login-terms-note, .trust-bar, .brand-row, .reg-sub, .submit-note, .already-have) {
  animation-duration: .44s;
  animation-delay: 0s;
}
body.auth-root .auth-logo,
body.auth-root .brand-panel .brand-logo {
  animation: auth-product-in .44s cubic-bezier(.23, 1, .32, 1) both;
}
body.auth-root .reg-story-brand .brand-logo,
body.auth-root .reg-right .auth-product-visual {
  animation: none;
}
body.auth-root .reg-right .auth-product-visual {
  margin-bottom: 20px;
}
body.auth-root .auth-bg::before {
  animation-duration: 14s;
}
body.auth-root .auth-bg::after {
  animation-duration: 18s;
}
body.auth-root .reg-right {
  animation: none;
}

@media (max-width: 980px) {
  body.auth-root .auth-product-visual {
    display: none;
  }
}


/* 2026-12-03 auth polish: first-paint product visuals and task-first forms. */
body.auth-root .auth-product-visual {
  position: relative;
  width: min(100%, 540px);
  height: 258px;
  aspect-ratio: auto;
  padding: 15px 16px 42px;
  overflow: hidden;
  border-color: rgba(94, 234, 212, .22);
  border-radius: 18px;
  background:
    radial-gradient(420px 190px at 86% 0%, rgba(94, 234, 212, .09), transparent 70%),
    linear-gradient(145deg, rgba(17, 27, 38, .86), rgba(5, 11, 17, .94));
  box-shadow: 0 20px 50px rgba(0, 0, 0, .24), inset 0 1px 0 rgba(255, 255, 255, .05);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
body.auth-root .auth-product-visual::after { content: none; }
body.auth-root .auth-product-visual .atp-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #8ea3bf;
  font-size: 8px;
  font-weight: 750;
  letter-spacing: .13em;
  line-height: 1.4;
}
body.auth-root .auth-product-visual .atp-top > span:first-child { color: #d9e7f2; }
body.auth-root .auth-product-visual .atp-top i {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(94, 234, 212, .48);
  vertical-align: 1px;
}
body.auth-root .atp-chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 13px;
}
body.auth-root .atp-chart-head > span:first-child { display: flex; align-items: baseline; gap: 10px; }
body.auth-root .atp-chart-head strong { color: #edf3ff; font-size: 12px; letter-spacing: .02em; }
body.auth-root .atp-chart-head small { color: #8ea3bf; font-size: 9px; }
body.auth-root .atp-regime {
  padding: 4px 7px;
  border: 1px solid rgba(94, 234, 212, .20);
  border-radius: 5px;
  background: rgba(94, 234, 212, .07);
  color: var(--accent);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .12em;
}
body.auth-root .atp-chart { display: block; width: 100%; height: 105px; margin-top: 3px; overflow: visible; }
body.auth-root .atp-reads { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 2px; }
body.auth-root .atp-reads > span {
  min-width: 0;
  padding: 7px 9px;
  border: 1px solid rgba(255, 255, 255, .06);
  border-radius: 8px;
  background: rgba(255, 255, 255, .025);
}
body.auth-root .atp-reads small,
body.auth-root .atp-reads strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.auth-root .atp-reads small { margin-bottom: 3px; color: #8298b4; font-size: 7px; font-weight: 750; letter-spacing: .12em; }
body.auth-root .atp-reads strong { color: #dce8f5; font-size: 9px; font-weight: 650; }
body.auth-root .auth-product-visual figcaption { right: 16px; bottom: 12px; left: 16px; font-size: 8px; }
body.auth-root .auth-product-visual figcaption span:last-child { font-size: 7px; }

/* Signup tells a different product story: connected research, not repeated art. */
body.auth-root .auth-research-preview { height: 232px; }
body.auth-root .research-flow { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
body.auth-root .research-node {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 60px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: 11px;
  background: rgba(255, 255, 255, .027);
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}
body.auth-root .research-node:hover {
  transform: translateY(-2px);
  border-color: rgba(94, 234, 212, .24);
  background: rgba(94, 234, 212, .045);
}
body.auth-root .research-icon {
  display: grid;
  place-items: center;
  flex: 0 0 31px;
  width: 31px;
  height: 31px;
  border: 1px solid rgba(94, 234, 212, .16);
  border-radius: 9px;
  background: rgba(94, 234, 212, .07);
  color: var(--accent);
}
body.auth-root .research-icon svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
body.auth-root .research-node strong,
body.auth-root .research-node small { display: block; }
body.auth-root .research-node strong { margin-bottom: 4px; color: #e6eef7; font-size: 11px; }
body.auth-root .research-node small { color: #91a6bd; font-size: 8px; line-height: 1.35; }
body.auth-root .research-signal { display: none; }

/* Legal links keep a generous hit area without inflating every text line to 44px. */
body.auth-root .check-label .consent-links { display: inline; margin: 0; }
body.auth-root .check-label a {
  display: inline;
  min-width: 0;
  min-height: 0;
  padding: 12px 2px;
  margin: -12px -2px;
  vertical-align: baseline;
}
body.auth-root .check-label { line-height: 1.5; }
body.auth-root .reg-left .pw-hint { min-height: 18px; margin: -2px 0 2px; font-size: 11px; }
body.auth-root .reg-left .submit-note { margin-top: 6px; font-size: 11.5px; }
body.auth-root .reg-left .already-have { margin-top: 8px; }
body.auth-root .reg-left .oauth-divider { margin: 12px 0 10px; }
body.auth-root .reg-left .oauth-buttons { flex-direction: row; }
body.auth-root .reg-left .oauth-btn { flex: 1 1 0; }

/* Static ambient light is enough on account-entry pages. */
body.auth-root .auth-bg::before,
body.auth-root .auth-bg::after { animation: none; }
body.auth-root #particles { display: none; }

/* Consent remains available, but never sits on top of account controls. */
body.auth-root:has(#tidava-consent) { display: block !important; padding: 0 !important; }
body.auth-root:has(#tidava-consent) .login-shell {
  width: min(1160px, calc(100% - 48px));
  min-height: calc(100svh - 116px);
  margin: auto;
  align-content: center;
}
body.auth-root:has(#tidava-consent) .reg-layout { min-height: calc(100svh - 116px); }
body.auth-root #tidava-consent {
  position: relative !important;
  inset: auto !important;
  z-index: 20 !important;
  width: min(760px, calc(100% - 32px)) !important;
  max-width: 760px !important;
  margin: 0 auto 16px !important;
  box-shadow: 0 12px 36px rgba(0, 0, 0, .30) !important;
}

@media (min-width: 981px) {
  body.auth-root .reg-layout {
    width: min(1220px, calc(100% - 48px));
    grid-template-columns: minmax(0, 1fr) minmax(520px, 560px);
    gap: 52px;
    padding: 20px 0;
  }
  body.auth-root .reg-left { max-width: 560px; padding: 25px 30px; }
  body.auth-root .reg-left .brand-row { margin-bottom: 11px; min-height: 44px; }
  body.auth-root .reg-left .reg-title { margin-bottom: 6px; font-size: 28px; }
  body.auth-root .reg-left .reg-sub { margin-bottom: 12px; font-size: 13px; }
  body.auth-root .reg-left .step-chip { margin-bottom: 10px; padding: 4px 10px; }
  body.auth-root .reg-left form { gap: 10px; }
  body.auth-root .reg-left .field-row { grid-template-columns: 1fr 1fr; gap: 12px; }
  body.auth-root .reg-left label { gap: 5px; font-size: 11px; }
  body.auth-root .reg-left :where(input[type="text"], input[type="email"], input[type="password"]):not(.otp-input) { height: 48px; padding-inline: 14px; }
  body.auth-root .reg-left .pw-wrap > input { padding-right: 60px !important; }
  body.auth-root .reg-left .check-label { padding: 10px 12px; font-size: 12px; }
  body.auth-root .reg-left .submit-btn { height: 50px; margin-top: 2px; }
  body.auth-root .reg-right .right-headline { font-size: clamp(34px, 3.4vw, 48px); }
  body.auth-root .reg-right .feature-list { gap: 10px; margin-bottom: 20px; }
  body.auth-root .reg-right .right-social-proof { padding: 13px 16px; }
}

@media (min-width: 981px) and (max-height: 800px) {
  body.auth-root .brand-panel { gap: 12px; }
  body.auth-root .brand-panel .brand-logo,
  body.auth-root .reg-right .brand-logo { width: 250px; }
  body.auth-root .brand-headline { font-size: 44px; }
  body.auth-root .brand-copy { font-size: 14px; }
  body.auth-root .auth-product-visual { height: 236px; }
  body.auth-root .atp-chart { height: 88px; }
  body.auth-root .brand-points { gap: 7px; }
  body.auth-root .login-card { padding: 27px 32px; }
  body.auth-root .reg-story-brand { margin-bottom: 12px; }
  body.auth-root .reg-right .brand-kicker { margin-bottom: 10px; }
  body.auth-root .reg-right .right-eyebrow { margin-bottom: 10px; }
  body.auth-root .reg-right .right-headline { margin-bottom: 16px; font-size: 38px; }
  body.auth-root .reg-right .auth-product-visual { height: 206px; margin-bottom: 14px; }
  body.auth-root .research-flow { gap: 8px; margin-top: 12px; }
  body.auth-root .research-node { min-height: 53px; padding: 8px; }
  body.auth-root .reg-right .feature-list { gap: 8px; margin-bottom: 14px; }
}

@media (max-width: 980px) {
  body.auth-root .reg-left { padding: 22px; }
  body.auth-root .reg-left .brand-row { margin-bottom: 12px; }
  body.auth-root .reg-left .reg-sub { margin-bottom: 14px; }
  body.auth-root .reg-left .step-chip { margin-bottom: 12px; padding: 5px 10px; }
  body.auth-root .reg-left form { gap: 12px; }
  body.auth-root .reg-left .field-row { gap: 12px; }
  body.auth-root .reg-left .check-label { padding: 11px 12px; font-size: 12px; }
  body.auth-root:has(#tidava-consent) .login-shell {
    width: min(480px, calc(100% - 32px));
    min-height: auto;
    padding: 24px 0;
  }
  body.auth-root:has(#tidava-consent) .reg-layout { min-height: auto; padding: 16px 0; }
  body.auth-root #tidava-consent { padding: 14px !important; }
}

@media (max-width: 640px) {
  body.auth-root .login-card,
  body.auth-root .reg-left { padding: 22px 20px; }
  body.auth-root .reg-left .auth-logo { height: 38px; }
  body.auth-root .login-heading,
  body.auth-root .reg-title { font-size: 25px; }
  body.auth-root .login-sub { margin-bottom: 20px; }
  body.auth-root .trust-bar { gap: 10px 14px; margin-top: 18px; padding-top: 16px; }
  body.auth-root .login-card > p:last-child { font-size: 11px !important; }
}

@media (prefers-reduced-motion: reduce) {
  body.auth-root .research-node { transition: none; }
  body.auth-root .research-node:hover { transform: none; }
}


/* Inline legal copy should read as a sentence, not a row of oversized link boxes. */
body.auth-root .login-terms-note:not(.login-create-account) a {
  display: inline;
  min-width: 0;
  min-height: 0;
  padding: 12px 2px;
  margin: -12px -2px;
  vertical-align: baseline;
}
body.auth-root .login-create-account { margin-top: 12px !important; }

/* Keep inline product artwork fully opaque in Chromium's compositor. */
body.auth-root .auth-product-visual {
  animation: none;
}
