/* Lithium motion layer for the secondary pages (sign-in, account, docs, legal).
   Only animates opacity and transform so it stays smooth on low-end machines.
   Everything is scoped to html.lm, which lithium-motion.js adds unless the
   visitor prefers reduced motion. */

:root { --lm-ease: cubic-bezier(.22, 1, .36, 1); }

/* ---------- Base fixes (these pages used to rely on the old homepage styles) ---------- */
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand__mark { display: block; width: 20px; height: 24px; object-fit: contain; }
.brand__word { font-size: 14px; font-weight: 800; letter-spacing: .22em; color: #f5f4f4; }
.brand__word span { color: var(--violet, #f73b4e); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 18px; border: 1px solid transparent; border-radius: 5px; font-size: 13px; font-weight: 700; line-height: 1; white-space: nowrap; }
.btn--ghost { border-color: var(--border-strong, rgba(255,255,255,.18)); background: rgba(255,255,255,.03); color: #e9e6e5; }
.btn--ghost:hover { background: rgba(255,255,255,.07); }
.btn--sm { padding: 9px 14px; font-size: 12.5px; min-height: 40px; }
.auth-switch a, .auth-support span, .dash-card__link, .dash-hint a { text-decoration: underline; text-decoration-color: rgba(247,59,78,.45); text-underline-offset: 3px; }

/* ---------- Ambient background ---------- */
.lm-aurora { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; contain: strict; opacity: 0; transition: opacity 1.2s ease; }
.lm-aurora.is-on { opacity: 1; }
.lm-aurora span { position: absolute; border-radius: 50%; will-change: transform; }
.lm-aurora span:nth-child(1) { width: 60vmax; height: 60vmax; left: -18vmax; top: -30vmax; background: radial-gradient(circle, rgba(237,58,76,.17), rgba(237,58,76,.04) 42%, transparent 68%); animation: lmDrift1 22s ease-in-out infinite alternate; }
.lm-aurora span:nth-child(2) { width: 50vmax; height: 50vmax; right: -16vmax; bottom: -26vmax; background: radial-gradient(circle, rgba(244,62,80,.12), rgba(244,62,80,.03) 42%, transparent 68%); animation: lmDrift2 26s ease-in-out infinite alternate; }
html.lm-paused .lm-aurora span { animation-play-state: paused; }

/* ---------- Entrance helpers ---------- */
html.lm .account-topbar,
html.lm .docs-nav,
html.lm body > .header { animation: lmDown .8s var(--lm-ease) both; }

/* Sign-in / create-account / reseller */
html.lm .auth-story__content > * { animation: lmUp .9s var(--lm-ease) both; }
html.lm .auth-story__content > :nth-child(1) { animation-delay: .08s; }
html.lm .auth-story__content > :nth-child(2) { animation-delay: .16s; }
html.lm .auth-story__content > :nth-child(3) { animation-delay: .26s; }
html.lm .auth-story__content > :nth-child(4) { animation-delay: .34s; }
html.lm .auth-points li { animation: lmLeft .8s var(--lm-ease) both; }
html.lm .auth-points li:nth-child(1) { animation-delay: .42s; }
html.lm .auth-points li:nth-child(2) { animation-delay: .5s; }
html.lm .auth-points li:nth-child(3) { animation-delay: .58s; }
html.lm .auth-story__legal { animation: lmFade 1s ease .7s both; }
html.lm .auth-panel { position: relative; animation: lmRise 1s var(--lm-ease) .2s both; }
html.lm .auth-panel > :not(.lm-spot) { animation: lmUp .8s var(--lm-ease) both; }
html.lm .auth-panel > :nth-child(1) { animation-delay: .38s; }
html.lm .auth-panel > :nth-child(2) { animation-delay: .46s; }
html.lm .auth-panel > :nth-child(3) { animation-delay: .54s; }
html.lm .auth-panel > :nth-child(4) { animation-delay: .6s; }
html.lm .auth-panel > :nth-child(n+5) { animation-delay: .66s; }
html.lm .auth-panel__mark { position: relative; animation: lmFloat 6s ease-in-out 1.2s infinite; }
html.lm .auth-panel__mark::after { content: ""; position: absolute; inset: -1px; border-radius: inherit; box-shadow: 0 0 0 0 rgba(247,59,78,.25); animation: lmPing 2.8s var(--lm-ease) 1.4s infinite; }
html.lm .account-footer { animation: lmFade 1s ease .8s both; }

/* Account dashboard */
html.lm .dash__side { animation: lmLeft .9s var(--lm-ease) .1s both; }
html.lm .dash__head { animation: lmUp .9s var(--lm-ease) .18s both; }
html.lm .dash__main > .auth-message { animation: lmUp .9s var(--lm-ease) .24s both; }
html.lm .dash-profile { animation: lmRise .9s var(--lm-ease) .3s both; }
html.lm .dash-stats > * { animation: lmUp .8s var(--lm-ease) both; }
html.lm .dash-stats > :nth-child(1) { animation-delay: .38s; }
html.lm .dash-stats > :nth-child(2) { animation-delay: .44s; }
html.lm .dash-stats > :nth-child(3) { animation-delay: .5s; }
html.lm .dash-stats > :nth-child(4) { animation-delay: .56s; }
html.lm .dash__nav a { transition: background .25s ease, color .25s ease, transform .35s var(--lm-ease); }
html.lm .dash__nav a:hover { transform: translateX(3px); }
html.lm .dash-stat,
html.lm .dash-card { transition: transform .45s var(--lm-ease), border-color .3s ease, background .3s ease; }
html.lm .dash-stat:hover,
html.lm .dash-card:hover { transform: translateY(-2px); border-color: rgba(247,59,78,.28); background: rgba(255,255,255,.03); }

/* Docs */
html.lm .docs-copy > * { animation: lmUp .9s var(--lm-ease) both; }
html.lm .docs-copy > :nth-child(1) { animation-delay: .08s; }
html.lm .docs-copy > :nth-child(2) { animation-delay: .16s; }
html.lm .docs-copy > :nth-child(3) { animation-delay: .24s; }
html.lm .docs-copy > :nth-child(4) { animation-delay: .34s; }
html.lm .docs-copy > :nth-child(5) { animation-delay: .44s; }
html.lm .docs-mark { animation: lmUp .9s var(--lm-ease) .08s both, lmFloat 6s ease-in-out 1.2s infinite; }
html.lm .docs-links { position: relative; animation: lmRise 1s var(--lm-ease) .25s both; }
html.lm .docs-link { animation: lmUp .7s var(--lm-ease) both; }
html.lm .docs-link:nth-of-type(1) { animation-delay: .45s; }
html.lm .docs-link:nth-of-type(2) { animation-delay: .52s; }
html.lm .docs-link:nth-of-type(3) { animation-delay: .59s; }
html.lm .docs-link:nth-of-type(4) { animation-delay: .66s; }
html.lm .docs-status::before { animation: lmBlink 2.4s ease-in-out infinite; }

/* Terms / privacy */
html.lm body > .wrap > :nth-child(-n+4) { animation: lmUp .9s var(--lm-ease) both; }
html.lm body > .wrap > :nth-child(2) { animation-delay: .08s; }
html.lm body > .wrap > :nth-child(3) { animation-delay: .16s; }
html.lm body > .wrap > :nth-child(4) { animation-delay: .24s; }

/* Scroll reveal for content further down the page (tagged by lithium-motion.js) */
html.lm .lm-hide { opacity: 0; transform: translateY(22px); }
html.lm .lm-show { opacity: 1; transform: none; transition: opacity .8s var(--lm-ease), transform .8s var(--lm-ease); transition-delay: var(--lm-d, 0s); }

/* ---------- Interactive bits ---------- */
.lm-spot { position: absolute; inset: 0; z-index: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .4s ease;
  background: radial-gradient(380px circle at var(--mx, 50%) var(--my, 50%), rgba(247,59,78,.06), transparent 55%); }
.lm-spot-host:hover > .lm-spot { opacity: 1; }
.lm-spot-host > :not(.lm-spot) { position: relative; z-index: 1; }

html.lm .auth-submit { position: relative; overflow: hidden; }
html.lm .auth-submit::after { content: ""; position: absolute; inset: 0; pointer-events: none; transform: translateX(-120%);
  background: linear-gradient(100deg, transparent 30%, rgba(244,62,80,.26) 50%, transparent 70%); transition: transform .8s var(--lm-ease); }
html.lm .auth-submit:hover:not(:disabled)::after { transform: translateX(120%); }

/* Page leave fade for internal links */
html.lm body { transition: opacity .22s ease; }
html.lm body.lm-leaving { opacity: 0; }

/* ---------- Keyframes ---------- */
@keyframes lmUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes lmDown { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }
@keyframes lmLeft { from { opacity: 0; transform: translateX(-16px); } to { opacity: 1; transform: none; } }
@keyframes lmRise { from { opacity: 0; transform: translateY(26px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes lmFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes lmFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes lmPing { 0% { box-shadow: 0 0 0 0 rgba(247,59,78,.25); } 70%, 100% { box-shadow: 0 0 0 12px rgba(247,59,78,); } }
@keyframes lmBlink { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes lmDrift1 { to { transform: translate(14vw, 10vh) scale(1.12); } }
@keyframes lmDrift2 { to { transform: translate(-12vw, -12vh) scale(.92); } }

@media (prefers-reduced-motion: reduce) {
  .lm-aurora span { animation: none !important; }
}
