/* Onboarding — mirrors app/onboarding.tsx (original styling). */

.screen-onboarding {
  padding-top: calc(var(--safe-top) + 16px);
  padding-bottom: calc(var(--safe-bottom) + 14px);
}

.ob-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.ob-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  touch-action: pan-y;
  -webkit-user-select: none;
  user-select: none;
}

.ob-step {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0 var(--s-xl);
}

/* Subtle "back to the landing page" button, top-left. 44px tap target around a
   36px circle; absolutely positioned so it never pushes the steps down. */
.ob-home {
  position: absolute;
  top: calc(var(--safe-top) + 4px);
  left: 8px;
  z-index: 21;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
}

.ob-home-dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04);
  color: var(--text-2);
  font-size: 18px;
}

/* ---------- Demo steps (1–3) ---------- */

.ob-eyebrow {
  margin: 0 0 var(--s-md);
  text-align: center;
  color: var(--text-2);
}

/* Size container so the card can cap its width to its height on short, wide
   windows (keeps the portrait photo from turning into a letterbox). */
.ob-card-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  justify-content: center;
  container-type: size;
}

.ob-card {
  position: relative;
  width: 100%;
  width: min(100%, 88cqh);
  height: 100%;
  border-radius: var(--r-xl);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: var(--surface-muted);
  box-shadow: var(--sh-card);
}

.ob-card-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ob-corner {
  position: absolute;
  top: var(--s-sm);
  right: var(--s-sm);
  width: 32px;
  height: 32px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.ob-prompt-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--s-xs);
  margin: var(--s-sm);
}

.ob-prompt {
  display: flex;
  align-items: center;
  min-width: 0;
  max-width: 78%;
  min-height: 38px;
  padding: 10px var(--s-md);
  border-radius: var(--r-pill);
  background: #fff;
  box-shadow: var(--sh-soft);
}

.ob-prompt-text {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 13px;
  font-weight: 500;
  line-height: 18px;
  color: var(--text);
}

.ob-cursor {
  flex-shrink: 0;
  width: 2px;
  height: 14px;
  margin-left: 3px;
  border-radius: 1px;
  background: var(--text);
  animation: obBlink 0.84s ease-in-out infinite;
}

.ob-send {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 16px;
  background: var(--charcoal);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: background-color 0.15s ease;
}

.ob-send.is-sent {
  background: var(--accent);
  animation: obSendPress 0.29s linear both;
}

.ob-title {
  margin: var(--s-lg) 0 0;
  text-align: center;
  color: var(--text);
}

@keyframes obBlink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

/* Press in (110ms, ease-out), spring back with a little overshoot (180ms). */
@keyframes obSendPress {
  0% {
    transform: scale(1);
    animation-timing-function: ease-out;
  }
  38% {
    transform: scale(0.82);
    animation-timing-function: cubic-bezier(0.34, 1.9, 0.64, 1);
  }
  100% {
    transform: scale(1);
  }
}

/* ---------- Teaser (step 4) ---------- */

.ob-teaser {
  align-items: center;
  justify-content: center;
}

.ob-teaser-title {
  margin: 0 0 var(--s-xl);
  font-size: 28px;
  font-weight: 800;
  line-height: 36px;
  letter-spacing: -0.5px;
  text-align: center;
  color: var(--text);
}

.ob-accent {
  color: var(--accent);
}

/* Full-bleed strip; vertical padding leaves room for the card shadows. */
.ob-marquee {
  flex-shrink: 0;
  width: calc(100% + 2 * var(--s-xl));
  margin: -8px calc(-1 * var(--s-xl)) -24px;
  padding: 8px 0 24px;
  overflow: hidden;
}

.ob-mq-track {
  display: flex;
  width: max-content;
  animation: obMarquee var(--ob-mq-dur, 28s) linear infinite;
  will-change: transform;
}

.ob-mq-card {
  position: relative;
  flex-shrink: 0;
  width: 150px;
  height: 210px;
  margin-right: var(--s-sm);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--surface-muted);
  box-shadow: var(--sh-card);
}

/* Cards carry their own right margin, so one set is exactly half the track. */
@keyframes obMarquee {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

/* Short screens: slightly smaller teaser cards. */
@media (max-height: 640px) {
  .ob-teaser-title {
    margin-bottom: var(--s-md);
    font-size: 25px;
    line-height: 32px;
  }
  .ob-mq-card {
    width: 128px;
    height: 180px;
  }
}

/* ---------- Teaser with sign-in (.ob-signin, set once buttons render) ----------
   Headline + a tighter, playfully tilted marquee + perks card + trust line.
   Everything stays above the buttons on a 375x667 screen. */

.ob-title-signin,
.ob-perks-wrap {
  display: none;
}

.ob-signin .ob-title-default {
  display: none;
}

.ob-signin .ob-title-signin {
  display: inline;
}

.ob-signin .ob-teaser-title {
  margin-bottom: var(--s-md);
  font-size: 30px;
  line-height: 35px;
  letter-spacing: -0.8px;
  animation: obRise 0.45s var(--ease-out, ease-out) both;
}

.ob-signin .ob-marquee {
  margin-top: -14px;
  margin-bottom: -10px;
  padding: 14px 0 22px;
}

.ob-signin .ob-mq-card {
  width: 124px;
  height: 166px;
  margin-right: 14px;
  border-radius: 20px;
  border: 3px solid #fff;
  transform: rotate(-3deg);
}

.ob-signin .ob-mq-card:nth-child(even) {
  transform: rotate(2.5deg) translateY(6px);
}

.ob-signin .ob-perks-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 400px;
  margin-top: var(--s-md);
}

.ob-perks {
  width: 100%;
  margin: 0;
  padding: 12px 14px;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-radius: 20px;
  background: var(--surface, #fff);
  box-shadow: var(--sh-soft, 0 2px 12px rgba(0, 0, 0, 0.06));
}

.ob-perk {
  display: flex;
  align-items: center;
  gap: 12px;
  animation: obRise 0.4s var(--ease-out, ease-out) both;
}

.ob-perk:nth-child(1) {
  animation-delay: 0.08s;
}
.ob-perk:nth-child(2) {
  animation-delay: 0.16s;
}
.ob-perk:nth-child(3) {
  animation-delay: 0.24s;
}

.ob-perk-icon {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.ob-perk-violet {
  background: rgba(123, 92, 250, 0.12);
  color: var(--accent);
}

.ob-perk-amber {
  background: rgba(245, 166, 35, 0.16);
  color: #c77a06;
}

.ob-perk-green {
  background: rgba(52, 168, 83, 0.13);
  color: #1e8a3e;
}

.ob-perk-text {
  min-width: 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 18px;
  letter-spacing: -0.1px;
  color: var(--text);
}

.ob-trust {
  margin: 10px 0 0;
  font-size: 12px;
  font-weight: 600;
  line-height: 16px;
  text-align: center;
  text-wrap: balance;
  color: var(--text-2);
  animation: obRise 0.4s var(--ease-out, ease-out) 0.32s both;
}

.ob-trust-lock {
  display: inline-flex;
  margin-right: 5px;
  vertical-align: -2px;
  font-size: 13px;
  color: #1e8a3e;
}

@keyframes obRise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Shorter phones (e.g. 375x667): compact everything so the buttons stay put. */
@media (max-height: 760px) {
  .ob-signin .ob-teaser-title {
    margin-bottom: 10px;
    font-size: 26px;
    line-height: 30px;
  }
  .ob-signin .ob-mq-card {
    width: 100px;
    height: 134px;
    margin-right: 12px;
    border-radius: 16px;
  }
  .ob-signin .ob-perks-wrap {
    margin-top: 10px;
  }
  .ob-perks {
    padding: 10px 12px;
    gap: 8px;
  }
  .ob-perk-icon {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    font-size: 14px;
  }
  .ob-perk-text {
    font-size: 13px;
    line-height: 17px;
  }
  .ob-trust {
    margin-top: 8px;
    font-size: 11px;
  }
}

/* Two provider buttons on a short screen: shrink the marquee a bit more. */
@media (max-height: 700px) {
  .ob-signin:has(.auth-apple) .ob-mq-card {
    width: 84px;
    height: 112px;
    border-width: 2px;
  }
  .ob-signin:has(.auth-apple) .ob-teaser-title {
    font-size: 24px;
    line-height: 28px;
  }
}

/* ---------- Footer ---------- */

.ob-footer {
  position: relative;
  flex-shrink: 0;
  padding: var(--s-md) var(--s-xl) 0;
}

.ob-actions {
  display: flex;
  flex-direction: column;
}

.ob-start {
  animation: fadeIn 0.28s ease both;
}

/* Sign-in: provider buttons (rendered by auth.js) + skip link. */
.ob-auth-group {
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.28s ease both;
}

/* Rendered at full width but invisible, sitting just above the footer so it
   never adds scrollable height. */
.ob-auth-group.is-parked {
  position: absolute;
  bottom: 100%;
  left: var(--s-xl);
  right: var(--s-xl);
  visibility: hidden;
  pointer-events: none;
}

.ob-auth {
  display: flex;
  flex-direction: column;
  gap: var(--s-sm);
}

.ob-auth:empty {
  display: none;
}

.ob-skip {
  align-self: center;
  min-height: 44px;
  margin-top: var(--s-xxs);
  padding: 0 var(--s-md);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-2);
  --press-scale: 0.96;
}

.ob-legal {
  margin: 14px 0 0;
  font-size: 11px;
  font-weight: 600;
  line-height: 16px;
  text-align: center;
  text-wrap: balance;
  color: var(--text-3);
}

.ob-auth-group:not(.is-parked) + .ob-legal {
  margin-top: var(--s-xxs);
}

/* Inline padding grows the tap area to ~40px without moving the text. */
.ob-legal a {
  padding: 12px 2px;
  margin: -12px -2px;
  color: var(--text-2);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ob-dots {
  display: flex;
  justify-content: center;
  margin-top: var(--s-md);
}

.ob-dot {
  width: 7px;
  height: 7px;
  margin: 0 4px;
  border-radius: 4px;
  background: var(--border);
  transition: width 0.3s var(--ease-out), background-color 0.3s ease;
}

.ob-dot.active {
  width: 18px;
  background: var(--accent);
}

@media (prefers-reduced-motion: reduce) {
  .ob-mq-track,
  .ob-signin .ob-teaser-title,
  .ob-perk,
  .ob-trust {
    animation: none;
  }
  .ob-marquee {
    overflow-x: auto;
    scrollbar-width: none;
  }
  .ob-marquee::-webkit-scrollbar {
    display: none;
  }
}
