/* ============================================================
   MUUVR × FitPass — Connect flow
   Web pages (the actual in-browser views, no device chrome)
   ============================================================ */

@font-face {
  font-family: 'Tusker Grotesk';
  src: url('fonts/TuskerGrotesk-5600Semibold.otf') format('opentype');
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'PP Neue Montreal';
  src: url('fonts/PPNeueMontreal-Regular.otf') format('opentype');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'PP Neue Montreal';
  src: url('fonts/PPNeueMontreal-Medium.otf') format('opentype');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'PP Neue Montreal';
  src: url('fonts/PPNeueMontreal-SemiBold.otf') format('opentype');
  font-weight: 600; font-style: normal; font-display: swap;
}

:root {
  --purple:        #745ff3;
  --purple-light:  #7f6bff;
  --purple-active: #ab9fff;
  --purple-bg:     #f5f0ff;

  --ink:        #393939;
  --ink-strong: #282828;
  --grey:       #7a7a7a;
  --grey-mid:   #666666;
  --grey-soft:  #979797;

  --white:      #ffffff;
  --card-2:     #fbfbfb;
  --card-3:     #f7f7f7;
  --field:      #f3f3f3;
  --hairline:   #ebebeb;
  --border:     #e4e4e4;
  --divider:    #f0f0f0;
  --pill:       #e8e8e8;

  --shadow-card: 0 24px 50px -20px rgba(63, 43, 150, 0.28);
  --shadow-btn:  0 12px 24px -10px rgba(116, 95, 243, 0.55);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { height: 100%; }
body {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  background: var(--purple-bg);
  font-family: 'PP Neue Montreal', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------- Page column ---------- */
.page {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
}
.page.fill { min-height: min(760px, 88dvh); }

/* ---------- Back link ---------- */
.back {
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: 4px;
  height: 48px; padding: 0 16px;
  background: #ffffff;
  border: none; border-radius: 20px;
  color: var(--purple); font-size: 16px; font-weight: 500;
  cursor: pointer; margin-bottom: 24px;
  text-decoration: none;
  box-shadow: 0 8px 20px -12px rgba(63,43,150,.35);
}
.back svg { width: 20px; height: 20px; }

/* ---------- Card ---------- */
.card {
  background: var(--white);
  border-radius: 32px;
  padding: 32px 24px;
  box-shadow: var(--shadow-card);
}
.card.tint2 { background: var(--card-2); }
.card.tint3 { background: var(--card-3); }

/* ---------- Typography ---------- */
.heading {
  font-family: 'Tusker Grotesk', 'Arial Narrow', sans-serif;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--ink);
  font-size: 28px;
  letter-spacing: 0.4px;
  line-height: 1.05;
}
.heading.dark { color: var(--ink-strong); }
.subline {
  color: var(--grey-mid);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.42;
}

/* ---------- Buttons ---------- */
.btn {
  width: 100%;
  height: 64px;
  border: none; border-radius: 24px;
  background: var(--purple);
  color: #fff;
  font-size: 16px; font-weight: 500;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  cursor: pointer;
  box-shadow: var(--shadow-btn);
  transition: transform .12s ease, filter .12s ease;
  text-decoration: none;
}
.btn:hover { filter: brightness(1.04); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 20px; height: 20px; }

.btn-text {
  width: 100%;
  background: none; border: none;
  color: var(--purple);
  font-size: 14px; font-weight: 500;
  text-align: center; cursor: pointer; padding: 4px 0;
  text-decoration: none;
  font-family: inherit;
}

.divider { height: 1px; background: var(--divider); width: 100%; }

.legal {
  color: var(--ink);
  font-size: 10px; font-weight: 400;
  line-height: 1.4; text-align: center;
  opacity: .85;
}

/* ============================================================
   Screen 1 — Connect
   ============================================================ */
.connect-logos {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 6px 0 2px;
}
.logo-fitpass { width: 96px; height: 96px; }
.conn-dots { display: flex; align-items: center; gap: 5px; }
.conn-dots i {
  width: 5px; height: 5px; border-radius: 50%;
  background: #d0d0d0; display: block;
  animation: dotFlowLight 1.6s ease-in-out infinite;
}
.conn-dots i:nth-child(1) { animation-delay: 0s; }
.conn-dots i:nth-child(2) { animation-delay: .18s; }
.conn-dots i:nth-child(3) { animation-delay: .36s; }
.conn-dots i:nth-child(4) { animation-delay: .54s; }
.conn-dots i.on { background: var(--purple); }
@keyframes dotFlowLight {
  0%, 100% { background: #d0d0d0;       transform: scale(1); }
  40%      { background: var(--purple); transform: scale(1.4); }
}
@media (prefers-reduced-motion: reduce) {
  .conn-dots i { animation: none; }
}
.app-icon { width: 96px; height: 96px; }

/* ============================================================
   Screen 2 — Review form
   ============================================================ */
.field-group {
  border: 1px solid var(--border);
  border-radius: 24px;
}
.field {
  position: relative;
  display: flex; align-items: center;
  min-height: 68px;
  padding: 12px 12px 12px 22px;
  border-bottom: 1px solid var(--hairline);
  gap: 8px;
  cursor: pointer;
}
.field.editing { cursor: default; z-index: 2; }
.field .fvalue:not([readonly]) { cursor: text; }

/* Highlight layer — dissolves in / out on state change */
.field::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 20px;
  border: 1.5px solid var(--purple-active);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(171, 159, 255, .18);
  opacity: 0;
  transition: opacity .3s ease;
  pointer-events: none;
  z-index: 0;
}
.field.editing::before { opacity: 1; }

/* keep field content above the highlight layer */
.field .fmeta,
.field .fedit { position: relative; z-index: 1; }

@media (prefers-reduced-motion: reduce) {
  .field::before { transition: none; }
}
.field:last-child { border-bottom: none; }
.field .fmeta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.field .flabel { font-size: 10px; color: var(--ink); font-weight: 400; }
.field .fvalue {
  font-size: 15px; color: var(--ink); font-weight: 400;
  border: none; background: none; outline: none; padding: 0;
  font-family: inherit; width: 100%;
}
.field .fvalue::placeholder { color: #b4b4b4; }
.field .fedit {
  width: 44px; height: 44px; border-radius: 14px;
  border: none; background: none; cursor: pointer; flex: none;
  display: flex; align-items: center; justify-content: center;
  color: var(--purple);
}
.field .fedit svg, .field .fedit img { width: 20px; height: 20px; }
.field.editing .fedit { color: var(--grey-soft); }

/* ============================================================
   Screen 3 — OTP
   ============================================================ */
.otp-row { display: flex; gap: 12px; justify-content: center; }
.otp-cell {
  width: 66px; height: 64px;
  border-radius: 24px;
  background: var(--field);
  border: 2px solid var(--divider);
  text-align: center;
  font-size: 24px; font-weight: 500; color: var(--ink);
  font-family: 'PP Neue Montreal', sans-serif;
  outline: none;
  transition: border-color .12s ease, background .12s ease;
  caret-color: var(--purple);
}
.otp-cell:focus { border-color: var(--purple-active); background: var(--card-3); }
.otp-cell.filled { background: var(--card-3); }
.resend {
  align-self: center;
  display: inline-flex; align-items: center; gap: 6px;
  height: 40px; padding: 0 16px;
  background: var(--pill); border: none; border-radius: 16px;
  color: var(--grey); font-size: 14px; font-weight: 500;
  cursor: default; font-family: inherit;
}
.resend.active { color: var(--purple); background: rgba(116,95,243,.1); cursor: pointer; }
.resend svg { width: 18px; height: 18px; }

/* ============================================================
   Screen 4 — Confirmation
   ============================================================ */
.confirm-icon { width: 40px; height: 40px; display: block; margin: 0 auto; }

/* ============================================================
   Screen 5 — Sign in
   ============================================================ */
.email-field {
  display: flex; align-items: center;
  height: 64px; padding: 0 8px 0 22px; gap: 8px;
  border: 1px solid var(--border); border-radius: 20px;
  background: #fff;
}
.email-field.focus { border-color: var(--purple-active); box-shadow: 0 0 0 4px rgba(171,159,255,.18); }
.email-field .emeta { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.email-field .elabel { font-size: 10px; color: var(--grey-soft); }
.email-field input {
  border: none; outline: none; background: none;
  font-family: inherit; font-size: 15px; color: var(--ink); width: 100%; padding: 0;
}
.email-field .go {
  width: 48px; height: 48px; border-radius: 50%;
  border: none; background: #ededed; color: #9a9a9a;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex: none; transition: all .15s ease;
}
.email-field .go.ready { background: var(--purple); color: #fff; box-shadow: var(--shadow-btn); }
.email-field .go svg { width: 20px; height: 20px; }

.labeled-divider {
  display: flex; align-items: center; gap: 16px;
  color: var(--grey-soft); font-size: 12px;
}
.labeled-divider::before, .labeled-divider::after {
  content: ""; flex: 1; height: 1px; background: #dcdcdc;
}
.social-row { display: flex; gap: 16px; }
.social-btn {
  flex: 1; height: 48px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  border: 1.5px solid var(--ink); border-radius: 20px;
  background: none; color: var(--ink);
  font-size: 16px; font-weight: 500; cursor: pointer;
  font-family: inherit;
}
.social-btn svg, .social-btn img { width: 20px; height: 20px; }

/* utility */
.stack { display: flex; flex-direction: column; }
.center-y { justify-content: center; }
.gap-4  { gap: 4px; }
.gap-8  { gap: 8px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }
.gap-24 { gap: 24px; }
.grow { flex: 1; }

/* ============================================================
   Desktop hero band (hidden on mobile / tablet — no effect there)
   ============================================================ */
.hero { display: none; }

/* ============================================================
   Interaction states (hover + keyboard focus)
   ============================================================ */
.btn, .btn-text, .back, .social-btn,
.email-field .go, .field .fedit, .otp-cell, .resend.active {
  transition: background .15s ease, color .15s ease,
              box-shadow .15s ease, filter .15s ease, transform .12s ease;
}
@media (hover: hover) {
  .back:hover        { box-shadow: 0 10px 22px -10px rgba(63,43,150,.45); transform: translateY(-1px); }
  .btn-text:hover    { color: var(--purple-light); }
  .social-btn:hover  { background: rgba(57,57,57,.05); }
  .field .fedit:hover{ background: rgba(116,95,243,.10); }
  .email-field .go:hover        { filter: brightness(.97); }
  .email-field .go.ready:hover  { filter: brightness(1.06); }
  .resend.active:hover          { background: rgba(116,95,243,.16); }
  .otp-cell:hover    { border-color: var(--purple-active); }
}
:focus-visible { outline: none; }
.btn:focus-visible, .btn-text:focus-visible, .back:focus-visible,
.social-btn:focus-visible, .email-field .go:focus-visible,
.field .fedit:focus-visible, .otp-cell:focus-visible,
.resend.active:focus-visible {
  outline: 3px solid var(--purple-active);
  outline-offset: 2px;
}

/* ============================================================
   Tablet ≥ 768px — roomier type & spacing
   ============================================================ */
@media (min-width: 768px) {
  body { padding: 56px 24px; }
  .page { max-width: 440px; }
  .card { padding: 40px 36px; border-radius: 36px; }
  .heading { font-size: 32px; }
  .subline { font-size: 15px; }

  /* Confirmation: center the whole block instead of pinning the button */
  .page.fill { min-height: auto; }
  .page.fill .grow { flex: 0 0 auto; }
  .page.fill .btn { margin-top: 20px; }
}

/* ============================================================
   Desktop ≥ 1024px — hero band + overlapping card
   ============================================================ */
@media (min-width: 1024px) {
  body {
    display: block;
    padding: 0;
    min-height: 100dvh;
  }

  /* ---- Hero band ---- */
  .hero {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 22px;
    width: 100%; min-height: 320px;
    padding: 64px 24px 104px;
    background: linear-gradient(135deg, #6e5ae7 0%, #5f49df 55%, #5340cf 100%);
    position: relative;
    overflow: hidden;
  }
  /* soft light bloom behind the lockup */
  .hero::after {
    content: "";
    position: absolute; inset: 0;
    background: radial-gradient(60% 120% at 50% 20%, rgba(255,255,255,.16), transparent 70%);
    pointer-events: none;
  }
  .hero-lockup {
    display: flex; align-items: center; gap: 20px;
    position: relative; z-index: 1;
    animation: heroIn .55s ease both;
  }
  .hero-fitpass {
    width: 90px; height: auto;
    filter: drop-shadow(0 14px 30px rgba(20, 10, 50, .45));   /* dark badge, natural colors */
  }
  .hero-muuvr {
    /* the MUUVR asset has ~35% transparent padding around its tile,
       so it needs a larger box to match FitPass's visual size */
    width: 104px; height: 104px;
    filter: drop-shadow(0 14px 30px rgba(20, 10, 50, .45));
  }
  .hero-dots { display: flex; align-items: center; gap: 9px; }
  .hero-dots i {
    width: 7px; height: 7px; border-radius: 50%;
    background: rgba(255, 255, 255, .35);
    animation: dotFlow 1.6s ease-in-out infinite;
  }
  .hero-dots i:nth-child(1) { animation-delay: 0s; }
  .hero-dots i:nth-child(2) { animation-delay: .18s; }
  .hero-dots i:nth-child(3) { animation-delay: .36s; }
  .hero-dots i:nth-child(4) { animation-delay: .54s; }
  .hero-tag {
    position: relative; z-index: 1;
    color: rgba(255, 255, 255, .82);
    font-size: 13px; font-weight: 500; letter-spacing: .3px;
  }

  /* ---- Card pulled up to overlap the hero ---- */
  .page {
    margin: -76px auto 0;
    padding-bottom: 72px;
    max-width: 468px;
  }
  .card {
    padding: 44px 40px;
    box-shadow: 0 30px 70px -28px rgba(63, 43, 150, .40);
    animation: cardIn .55s cubic-bezier(.2, .7, .3, 1) both;
  }
  .heading { font-size: 34px; }

  /* Back link floats onto the hero, top-left */
  .back {
    position: absolute; top: 28px; left: 32px; z-index: 6;
    margin-bottom: 0;
  }

  /* Connect screen already shows the lockup in the hero — avoid duplication */
  .connect-logos { display: none; }
}

/* ---- Motion keyframes (respect reduced-motion) ---- */
@keyframes cardIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes heroIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
@keyframes dotFlow {
  0%, 100% { background: rgba(255,255,255,.30); transform: scale(1); }
  40%      { background: #ffffff;               transform: scale(1.4); }
}
@media (prefers-reduced-motion: reduce) {
  .card, .hero-lockup, .hero-dots i { animation: none !important; }
}
