/* Onboarding: the sign-in button, sign-up step and the analysis loader. Tokens in cosmic_tokens.css. */

@property --xb-angle { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
@keyframes xb-spin { to { --xb-angle: 360deg } }
@keyframes xb-sweep { 0%, 55% { transform: translateX(-120%) skewX(-20deg) } 100% { transform: translateX(420%) skewX(-20deg) } }

/* Sign in with X: white pill on a spinning cosmic rim, with a halo that wakes up on hover. */
.xb { position: relative; isolation: isolate; display: inline-flex; align-items: center; gap: 10px; min-height: 56px; padding: 0 26px 0 24px;
  border: 0; border-radius: 99px; background: transparent; color: var(--cc-button-text); font-family: var(--cc-font); font-size: 16px; font-weight: 800; letter-spacing: -.01em;
  cursor: pointer; transition: transform 260ms var(--cc-ease-pop); }
/* The smaller one in the header of public pages. */
.ah .xb { min-height: 42px; padding: 0 16px; gap: 8px; font-size: 14px; white-space: nowrap; }
.xb::before, .xb::after { content: ""; position: absolute; border-radius: inherit; pointer-events: none;
  background: conic-gradient(from var(--xb-angle), #8b5cf6, #ff4fa3, #ffb547, #3ee6d6, #1d9bf0, #8b5cf6); animation: xb-spin 4s linear infinite; }
.xb::before { inset: -2px; z-index: -1; }
.xb::after { inset: -6px; z-index: -2; filter: blur(18px); opacity: .45; transition: opacity 300ms, inset 300ms; }
/* The white face; it follows ::before in paint order, so it sits on top of the rim. */
.xb-shine { position: absolute; inset: 0; z-index: -1; border-radius: inherit; overflow: hidden; pointer-events: none; background: var(--cc-button-bg); transition: background 200ms; }
.xb-shine::after { content: ""; position: absolute; top: -20%; left: 0; width: 38px; height: 140%; background: linear-gradient(90deg, transparent, rgba(255,255,255,.95), transparent); mix-blend-mode: soft-light; animation: xb-sweep 3.6s ease-in-out infinite; }
.xb-logo { flex-shrink: 0; }
.xb-arrow { flex-shrink: 0; margin-left: -4px; transition: transform 260ms var(--cc-ease-pop); }
.xb:hover { transform: translateY(-2px); }
.xb:hover .xb-shine { background: #fff; }
.xb:hover::after { opacity: .85; inset: -10px; }
.xb:hover .xb-arrow { transform: translateX(4px); }
.xb:active { transform: scale(.95); }
.xb:focus-visible { outline: 2px solid var(--cc-blue); outline-offset: 6px; }

.ob-how { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; font-family: var(--cc-font-mono); font-size: 12px; letter-spacing: .04em; color: var(--cc-text-muted); }
.ob-how b { font-weight: 600; color: var(--cc-text); margin-right: 6px; }

/* Sign-up */
.ob-rise > * { animation: rv-fade 600ms var(--cc-ease-out) both; }
.ob-rise > *:nth-child(2) { animation-delay: 80ms } .ob-rise > *:nth-child(3) { animation-delay: 160ms } .ob-rise > *:nth-child(4) { animation-delay: 240ms } .ob-rise > *:nth-child(5) { animation-delay: 320ms }
.ob-step { display: inline-flex; align-items: center; gap: 8px; font-family: var(--cc-font-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--cc-text-dim); }
.ob-step + .ob-step::before { content: ""; width: 22px; height: 1px; background: var(--cc-border); margin-right: 2px; }
.ob-step i { width: 8px; height: 8px; border-radius: 50%; border: 1px solid var(--cc-border); }
.ob-step.done { color: var(--cc-text-muted); }
.ob-step.done i { border: 0; background: var(--cc-text-muted); }
.ob-step.on { color: var(--cc-text); }
.ob-step.on i { border: 0; background: conic-gradient(#8b5cf6, #ff4fa3, #ffb547, #3ee6d6, #1d9bf0, #8b5cf6); animation: cc-pulse 1.6s ease-in-out infinite; }

.ob-account { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 18px; background: var(--cc-plate); box-shadow: var(--cc-plate-edge); }
.ob-avatar { flex-shrink: 0; border-radius: 50%; object-fit: cover; }
.ob-avatar-blank { display: inline-flex; align-items: center; justify-content: center; background: var(--cc-track); font-weight: 800; color: var(--cc-text-muted); }
.ob-connected { margin-left: auto; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; font-family: var(--cc-font-mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--cc-cyan); }
.ob-connected i { width: 6px; height: 6px; border-radius: 50%; background: var(--cc-cyan); box-shadow: 0 0 10px var(--cc-cyan); }
@media (max-width: 420px) { .ob-connected { display: none; } }

.ob-input { min-height: 52px; padding: 0 18px; border: 1px solid var(--cc-border); border-radius: 14px; background: #05050a; color: var(--cc-text); font-size: 16px; transition: border-color 160ms, box-shadow 160ms; }
.ob-input::placeholder { color: var(--cc-text-dim); }
.ob-input:focus { outline: none; border-color: var(--cc-violet); box-shadow: 0 0 0 4px rgba(139,92,246,.18); }
.ob-input[aria-invalid="true"] { border-color: #ff6b8a; }

.ob-deck { position: relative; width: var(--cc-card-w); height: var(--cc-card-h); animation: rv-breathe 2.8s ease-in-out infinite; }
.ob-deck-card { position: absolute !important; inset: 0; transform: translate(calc((var(--i) - 1.5) * 26px), calc(var(--i) * -4px)) rotate(calc((var(--i) - 1.5) * 7deg)); }
@media (max-width: 767px) { .ob-deck { scale: .8; } }

/* Analysis loader */
.an { position: fixed; inset: 0; overflow-y: auto; display: flex; background: #000; color: var(--cc-text); }
.an [hidden] { display: none !important; }
.an-aurora { position: fixed; inset: -20% -10% auto; height: 70%; opacity: .5; filter: blur(40px); pointer-events: none; transition: opacity 1200ms;
  background: radial-gradient(35% 45% at 35% 50%, rgba(139,92,246,.3), transparent 70%), radial-gradient(30% 40% at 65% 40%, rgba(62,230,214,.18), transparent 70%);
  animation: rv-aurora 9s ease-in-out infinite alternate; }
.an-aurora.on { opacity: 1; background: radial-gradient(35% 45% at 30% 50%, rgba(139,92,246,.45), transparent 70%), radial-gradient(30% 40% at 65% 40%, rgba(62,230,214,.3), transparent 70%), radial-gradient(30% 40% at 50% 75%, rgba(255,79,163,.35), transparent 70%); }
.an-body { position: relative; z-index: 1; margin: auto; padding: 48px 16px; width: 100%; max-width: 460px; display: flex; flex-direction: column; align-items: center; gap: 30px; }

.an-core { position: relative; width: 300px; height: 300px; flex-shrink: 0; }
.an-radar { position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 0deg, transparent 0deg 290deg, rgba(139,92,246,.28) 350deg, rgba(231,233,234,.55) 360deg);
  -webkit-mask: radial-gradient(circle, transparent 46px, #000 47px); mask: radial-gradient(circle, transparent 46px, #000 47px); animation: cc-spin 2.6s linear infinite; }
.an-orbit { position: absolute; border-radius: 50%; border: 1px solid var(--cc-divider); animation: cc-spin var(--d) linear infinite; }
.an-orbit i { position: absolute; left: 50%; top: -4px; width: 7px; height: 7px; margin-left: -3.5px; border-radius: 50%; background: var(--c); box-shadow: 0 0 12px var(--c); }
.an-orbit.o1 { inset: 0; border-style: dashed; border-color: var(--cc-border); --d: 26s; --c: var(--cc-cyan); }
.an-orbit.o2 { inset: 44px; --d: 12s; --c: var(--cc-magenta); animation-direction: reverse; }
.an-orbit.o3 { inset: 84px; border-color: rgba(139,92,246,.35); --d: 6s; --c: var(--cc-amber); }
.an-avatar { position: absolute; left: 50%; top: 50%; translate: -50% -50%; padding: 3px; border-radius: 50%; background: conic-gradient(from var(--xb-angle), #8b5cf6, #ff4fa3, #ffb547, #3ee6d6, #1d9bf0, #8b5cf6); animation: xb-spin 3s linear infinite; box-shadow: 0 0 40px rgba(139,92,246,.45); }
.an-avatar .ob-avatar { display: block; border: 3px solid #000; }
.an-avatar .ob-avatar-blank { display: flex; font-size: 34px; }
.an-sparks { position: absolute; inset: 0; pointer-events: none; }
.an-sparks i { position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; margin: -2px; border-radius: 50%; background: var(--c, #fff); box-shadow: 0 0 8px var(--c, #fff); }
.an-shock { position: absolute; inset: 60px; border-radius: 50%; border: 2px solid rgba(231,233,234,.7); opacity: 0; pointer-events: none; }
.an-shock.go { animation: cc-shock 1100ms cubic-bezier(.1,.8,.2,1) both; }
.an.done .an-radar { animation-duration: 1s; }
.an.done .an-orbit { animation-duration: calc(var(--d) / 4); }
.an.failed .an-radar, .an.failed .an-orbit, .an.failed .an-avatar { animation-play-state: paused; }
.an.failed .an-radar { opacity: 0; transition: opacity 400ms; }
.an.failed .an-core { filter: grayscale(1); opacity: .6; transition: filter 600ms, opacity 600ms; }

.an-headline { font-size: 36px; font-weight: 800; letter-spacing: -.03em; line-height: 1.05; }
.an-headline.swap { animation: rv-fade 500ms var(--cc-ease-out) both; }

.an-steps { width: 100%; display: flex; flex-direction: column; gap: 2px; }
.an-step { display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 12px; min-height: 44px; padding: 0 14px; border-radius: 12px;
  font-family: var(--cc-font-mono); font-size: 13px; color: var(--cc-text-dim); transition: color 300ms, background 300ms; }
.an-step.on { color: var(--cc-text); background: rgba(22,24,28,.7); }
.an-step.ok { color: var(--cc-text-muted); }
.an-tick { position: relative; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--cc-border); }
.an-step.on .an-tick { border-color: var(--cc-border); border-top-color: var(--cc-violet); border-right-color: var(--cc-magenta); animation: cc-spin 800ms linear infinite; }
.an-step.ok .an-tick { border: 0; background: linear-gradient(135deg, var(--cc-violet), var(--cc-cyan)); animation: cc-ignite 500ms var(--cc-ease-pop) both; }
.an-step.ok .an-tick::after { content: ""; position: absolute; left: 6px; top: 3.5px; width: 5px; height: 9px; border: solid #000; border-width: 0 2px 2px 0; rotate: 45deg; }
.an-step.bad .an-tick { border-color: #ff6b8a; animation: none; }
.an-value { color: var(--cc-text); font-variant-numeric: tabular-nums; text-align: right; }
.an-value:not(:empty) { animation: rv-fade 400ms var(--cc-ease-out) both; }
.an-value em { font-style: normal; background: var(--cc-tag-epic); -webkit-background-clip: text; background-clip: text; color: transparent; }

.an-meter { width: 100%; height: 4px; border-radius: 4px; background: var(--cc-track); overflow: hidden; }
.an-meter i { display: block; width: 3%; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--cc-violet), var(--cc-magenta), var(--cc-amber), var(--cc-cyan)); transition: width 1100ms var(--cc-ease-out); }

.an-error { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; color: var(--cc-text-muted); animation: rv-fade 500ms ease-out both; }

@media (max-width: 480px) {
  .an-core { transform: scale(.8); margin: -30px 0; }
  .an-headline { font-size: 30px; }
}

/* Paywall */
.pw-plan { display: flex; flex-direction: column; gap: 18px; padding: 22px 22px 20px; border-radius: 20px; background: var(--cc-plate); box-shadow: var(--cc-plate-edge); }
.pw-list { display: flex; flex-direction: column; gap: 10px; font-size: 15px; line-height: 1.35; color: #b9bec4; }
.pw-list li { display: flex; gap: 10px; }
.pw-list li::before { content: ""; flex-shrink: 0; width: 7px; height: 7px; margin-top: 6px; border-radius: 50%; background: conic-gradient(#8b5cf6, #ff4fa3, #ffb547, #3ee6d6, #1d9bf0, #8b5cf6); }
.pw-wait { display: inline-flex; align-items: center; gap: 8px; margin-top: 6px; font-family: var(--cc-font-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--cc-cyan); }
.pw-wait i { width: 8px; height: 8px; border-radius: 50%; background: var(--cc-cyan); box-shadow: 0 0 10px var(--cc-cyan); animation: cc-pulse 1.2s ease-in-out infinite; }
