/* ==========================================================================
   D09 Signup & Onboarding — page styles (demo/signup.html)
   One page, six screens (signup → 4 setup steps → welcome checklist).
   Screens are toggled with [hidden] by assets/js/pages/signup.js.
   ========================================================================== */

/* Page frame ------------------------------------------------------------- */
.signup {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.signup-screen {
  flex: 1;
}

/* Flow header ------------------------------------------------------------ */
.signup-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
}

.signup-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}

/* Rounded square with a triangle (Δ) cut from the canvas color */
.signup-logo__mark {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--ink);
}

.signup-logo__mark::before {
  content: '';
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 12px solid var(--canvas);
}

.signup-logo__name {
  font-family: var(--font-display);
  font-size: 20px;
}

/* Setup progress (visible on steps 1–4) */
.setup-progress {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 6px;
  max-width: 360px;
}

.setup-progress__bar {
  flex: 1;
  height: 4px;
  border-radius: 4px;
  background: var(--surface-3);
}

.setup-progress__bar.is-done {
  background: var(--ink);
}

.setup-progress__label {
  margin-left: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-3);
  white-space: nowrap;
}

/* Demo-flow dots: jump to any screen */
.demo-flow {
  display: flex;
  align-items: center;
  gap: 10px;
}

.demo-flow__dot {
  width: 10px;
  height: 10px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--line-2);
  cursor: pointer;
}

.demo-flow__dot[aria-current="step"] {
  background: var(--ink);
}

.demo-flow__label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
}

/* Screen 0 · Signup split ------------------------------------------------ */
.signup-split:not([hidden]) {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr));
}

.signup-split__form {
  display: flex;
  justify-content: center;
  padding: clamp(32px, 6vw, 80px) 24px;
}

.signup-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 400px;
}

.signup-form__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 44px;
  line-height: 1;
  letter-spacing: -.04em;
}

.signup-form__lead {
  margin: 0;
  color: var(--ink-2);
}

/* SSO / passkey buttons */
.auth-btn {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--surface);
  font-weight: 600;
  cursor: pointer;
}

.auth-btn__google {
  font-family: var(--font-mono);
  font-weight: 500;
}

/* Four-square Microsoft mark */
.auth-btn__ms {
  display: grid;
  grid-template-columns: 6px 6px;
  gap: 1px;
}

.auth-btn__ms span {
  width: 6px;
  height: 6px;
  background: var(--ink-2);
}

.signup-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--ink-3);
}

.signup-divider__line {
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* Magic-link form */
.magic-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.signup-input {
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--surface);
}

.magic-form .btn {
  padding: 0 22px;
}

.magic-sent {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.magic-sent__text {
  font-size: 14px;
  color: var(--ink-2);
}

.magic-sent__link {
  align-self: flex-start;
}

.signup-legal {
  margin: 0;
  font-size: 13px;
  color: var(--ink-3);
}

/* Right-hand "what happens next" panel */
.signup-split__aside {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 20px;
  padding: clamp(32px, 6vw, 80px) 32px;
  border-left: 1px solid var(--line);
  background: var(--surface-2);
}

.signup-aside__title {
  max-width: 18ch;
  font-family: var(--font-display);
  font-size: clamp(28px, 3vw, 40px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -.03em;
}

.signup-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 15px;
}

.signup-steps__item {
  display: flex;
  gap: 12px;
}

.signup-steps__num {
  font-family: var(--font-mono);
  color: var(--ink-3);
}

.signup-quote {
  font-size: 14px;
  color: var(--ink-2);
}

/* Screens 1–4 · Setup steps ---------------------------------------------- */
.setup:not([hidden]) {
  display: flex;
  justify-content: center;
  padding: clamp(40px, 8vw, 96px) 24px;
}

.setup__step {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  max-width: 560px;
  animation: pop .24s ease-out;
}

.setup__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.05;
  letter-spacing: -.035em;
}

.setup__input {
  min-height: 52px;
  padding: 0 16px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: var(--surface);
  font-size: 18px;
}

.setup__slug {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink-2);
}

/* Radio cards */
.choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 10px;
}

.choice {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 80px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.choice[aria-checked="true"] {
  border: 2px solid var(--ink);
}

.choice__desc {
  font-size: 13px;
  color: var(--ink-2);
}

/* Back / skip / continue */
.setup__nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.setup__nav-end {
  display: flex;
  gap: 10px;
}

.setup__back,
.setup__skip {
  min-height: 44px;
  border: 0;
  background: none;
  cursor: pointer;
}

.setup__back {
  padding: 10px 0;
  font-weight: 600;
  color: var(--ink-2);
}

.setup__skip {
  padding: 10px 12px;
  color: var(--ink-3);
}

.setup__cta {
  padding: 0 24px;
}

/* Screen 5 · Welcome ----------------------------------------------------- */
.welcome:not([hidden]) {
  display: flex;
  flex-direction: column;
}

.trial-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--info-bg);
  color: var(--info);
  font-size: 14px;
}

.trial-bar__link {
  font-weight: 600;
}

.welcome__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  align-items: start;
  gap: 24px;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: clamp(32px, 6vw, 72px) 24px;
}

.welcome__col {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.welcome__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 40px;
  line-height: 1;
  letter-spacing: -.035em;
}

/* "You closed your first loop" toast */
.celebrate:not([hidden]) {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--pos-bg);
  color: var(--ink);
  animation: pop .36s cubic-bezier(.34, 1.56, .64, 1);
}

.celebrate__check {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--pos);
  color: var(--canvas);
  font-weight: 700;
}

/* Activation checklist */
.checklist {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
}

.checklist__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.checklist__meter {
  height: 6px;
  margin-bottom: 8px;
  overflow: hidden;
  border-radius: 6px;
  background: var(--surface-3);
}

/* Fill width comes from --pct (set by JS) */
.checklist__meter-fill {
  display: block;
  width: var(--pct, 0%);
  height: 100%;
  background: var(--pos);
  transition: width .36s cubic-bezier(.2, .8, .2, 1);
}

.task {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 12px 0;
  border: 0;
  border-top: 1px solid var(--line);
  background: none;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.task__mark {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1.5px solid var(--line-2);
  border-radius: 50%;
  background: transparent;
  color: var(--canvas);
  font-size: 12px;
}

.task__text {
  flex: 1;
}

.task__time {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
}

.task[aria-checked="true"] .task__mark {
  border-color: var(--pos);
  background: var(--pos);
}

.task[aria-checked="true"] .task__text {
  color: var(--ink-3);
  text-decoration: line-through;
}

/* Invite prompt ("right moment") */
.invite:not([hidden]) {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px;
  border: 2px solid var(--ink);
  border-radius: var(--r-lg);
  background: var(--surface);
  animation: pop .36s ease-out;
}

.invite__title {
  font-size: 20px;
  line-height: 1.2;
}

.invite__row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.invite__input,
.invite__select {
  min-height: 44px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--canvas);
}

.invite__input {
  flex: 1;
  min-width: 180px;
  padding: 0 12px;
}

.invite__select {
  padding: 0 10px;
}

.invite__actions {
  display: flex;
  gap: 8px;
}

.invite__send,
.invite__later {
  min-height: 44px;
  border-radius: 999px;
  cursor: pointer;
}

.invite__send {
  padding: 0 18px;
  border: 0;
  background: var(--action);
  color: var(--on-action);
  font-weight: 600;
}

.invite__later {
  padding: 0 14px;
  border: 1px solid var(--line-2);
  background: var(--surface);
}

.source-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface-2);
}

.source-card__note {
  font-size: 14px;
  color: var(--ink-2);
}

.source-card__link {
  font-weight: 600;
}
