/* ===== Payment-first signup (/Subscribe, /Subscribe/Welcome) =====
   Sits on the shared .account-wrap/.account-card shell so it reads as the same product as the
   login card it replaced. Wider than the login card because it carries a plan summary. */

.subscribe-card { max-width: 560px; }

/* ---- Stepper: three dots joined by rails. State lives on the <li>: is-done / is-active. ---- */
.sub-stepper {
  list-style: none;
  margin: 0 0 22px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  counter-reset: none;
}
.sub-step {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2, #64748b);
  text-align: center;
}
/* Rail between dots. Drawn on every step but the first; fills when the step is done. */
.sub-step + .sub-step::before {
  content: "";
  position: absolute;
  top: 14px;
  right: 50%;
  width: 100%;
  height: 2px;
  background: var(--border, #e4e7ee);
  z-index: 0;
}
.sub-step.is-done + .sub-step::before,
.sub-step.is-done + .sub-step.is-done::before {
  background: var(--success-fill, #0a7450);
}
.sub-step-dot {
  position: relative;
  z-index: 1;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-1, #fff);
  border: 2px solid var(--border, #e4e7ee);
  color: var(--text-2, #64748b);
  font-size: 12px;
  font-weight: 700;
  transition: background-color 240ms ease, border-color 240ms ease, color 240ms ease, transform 240ms ease;
}
.sub-step-dot svg { width: 14px; height: 14px; }
.sub-step.is-active .sub-step-dot {
  border-color: var(--accent);
  color: var(--accent-text, var(--accent));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent);
  animation: sub-pulse 1800ms ease-in-out infinite;
}
.sub-step.is-active { color: var(--text-0, #0f172a); }
.sub-step.is-done .sub-step-dot {
  background: var(--success-fill, #0a7450);
  border-color: var(--success-fill, #0a7450);
  color: var(--success-on, #fff);
}
.sub-step.is-done { color: var(--success-text, #0a7450); }
/* The moment a step completes (JS adds .just-done), the dot pops. */
.sub-step.just-done .sub-step-dot { animation: sub-pop 420ms cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes sub-pulse {
  0%, 100% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent); }
  50%      { box-shadow: 0 0 0 7px color-mix(in srgb, var(--accent) 8%, transparent); }
}
@keyframes sub-pop {
  0%   { transform: scale(0.7); }
  60%  { transform: scale(1.18); }
  100% { transform: scale(1); }
}

/* ---- Copy ---- */
.sub-title { font-size: 26px; letter-spacing: -0.02em; margin: 0 0 6px; text-wrap: balance; }
.sub-accent { color: var(--accent-text, var(--accent)); }
.sub-lede { margin: 0 0 18px; line-height: 1.55; }
.sub-callout { margin-bottom: 16px; }

/* ---- Context: sent here by the upload wizard ---- */
.sub-context {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 14px; margin-bottom: 16px;
  border-radius: var(--radius-sm, 10px);
  background: color-mix(in srgb, var(--accent) 9%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  color: var(--text-0, #0f172a); font-size: 14px; line-height: 1.5;
  animation: sub-rise 320ms ease-out both;
}
.sub-context strong { display: block; margin-bottom: 2px; }
.sub-context-icon { color: var(--accent-text, var(--accent)); font-size: 16px; line-height: 1.3; flex-shrink: 0; }

/* ---- Plan picker: the options, as a segmented row ---- */
.sub-picker {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
  padding: 4px; margin-bottom: 12px;
  background: var(--bg-0, #f7f8fb); border-radius: 12px;
}
.sub-picker-item {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 9px 8px; border-radius: 9px; text-decoration: none;
  color: var(--text-1, #475569); border: 1px solid transparent;
  transition: background-color var(--transition, 160ms), color var(--transition, 160ms), box-shadow var(--transition, 160ms);
}
.sub-picker-item:hover { color: var(--text-0, #0f172a); }
.sub-picker-item.is-current {
  background: var(--bg-1, #fff); color: var(--text-0, #0f172a);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  box-shadow: 0 1px 3px rgba(15,23,42,0.08);
}
.sub-picker-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sub-picker-name { font-size: 13px; font-weight: 700; }
.sub-picker-price { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.sub-picker-price span { font-weight: 500; color: var(--text-2, #64748b); }
.sub-picker-item.is-current .sub-picker-price { color: var(--accent-text, var(--accent)); }
@media (max-width: 420px) {
  .sub-picker-name { font-size: 12px; }
  .sub-picker-price { font-size: 12px; }
}

/* ---- Plan summary ---- */
.sub-plan {
  border: 1px solid var(--border, #e4e7ee);
  border-radius: var(--radius-md, 14px);
  background: var(--bg-0, #f7f8fb);
  padding: 16px 18px;
  margin-bottom: 18px;
  animation: sub-rise 320ms ease-out both;
}
.sub-plan-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.sub-plan-name { font-size: 17px; font-weight: 700; color: var(--text-0, #0f172a); }
.sub-plan-for { font-size: 13px; color: var(--text-2, #64748b); margin-top: 2px; }
.sub-plan-price {
  font-size: 28px; font-weight: 800; letter-spacing: -0.02em; color: var(--text-0, #0f172a);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.sub-plan-currency { font-size: 16px; vertical-align: top; margin-right: 1px; font-weight: 700; }
.sub-plan-per { font-size: 13px; font-weight: 600; color: var(--text-2, #64748b); margin-left: 2px; }
.sub-plan-feats {
  list-style: none; margin: 12px 0 0; padding: 0;
  display: flex; flex-direction: column; gap: 6px;
  font-size: 14px; color: var(--text-1, #475569);
}
.sub-plan-feats li { padding-left: 22px; position: relative; }
.sub-plan-feats li::before {
  content: "";
  position: absolute; left: 0; top: 4px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--success-fill, #0a7450) no-repeat center / 8px 8px
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
}
.sub-switch {
  margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border, #e4e7ee);
  display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; align-items: center;
}
.sub-switch-link { color: var(--accent-text, var(--accent)); font-weight: 600; text-decoration: none; }
.sub-switch-link:hover { text-decoration: underline; }

/* ---- "What happens next" ---- */
.sub-next {
  list-style: none; margin: 0 0 18px; padding: 0;
  display: flex; flex-direction: column; gap: 8px;
  font-size: 14px; color: var(--text-1, #475569); line-height: 1.45;
}
.sub-next li { display: flex; gap: 10px; align-items: flex-start; }
.sub-next-num {
  flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent-text, var(--accent));
  font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
  margin-top: 1px;
}

/* ---- Primary action with an in-button spinner ---- */
.sub-start { position: relative; width: 100%; }
.sub-start-spinner {
  display: inline-block; width: 16px; height: 16px; margin-left: 10px; vertical-align: -3px;
  border-radius: 50%; border: 2px solid color-mix(in srgb, var(--accent-on, #fff) 40%, transparent);
  border-top-color: var(--accent-on, #fff);
  animation: sub-spin 700ms linear infinite;
}
.sub-start-spinner[hidden] { display: none; }
@keyframes sub-spin { to { transform: rotate(360deg); } }

.sub-trust {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 8px;
  font-size: 12px; margin: 12px 0 0; text-align: center;
}
.sub-alt { font-size: 13px; margin: 14px 0 0; text-align: center; }
.sub-alt a { color: var(--accent-text, var(--accent)); font-weight: 600; }

/* ---- Welcome: paid banner, done state, confetti ---- */
.sub-paid {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; margin-bottom: 14px;
  border-radius: var(--radius-sm, 10px);
  background: color-mix(in srgb, var(--success-fill, #0a7450) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--success-fill, #0a7450) 35%, transparent);
  color: var(--text-0, #0f172a); font-size: 14px;
  animation: sub-rise 320ms ease-out both;
}
.sub-paid-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
  background: var(--success-fill, #0a7450);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--success-fill, #0a7450) 40%, transparent);
  animation: sub-ring 1600ms ease-out infinite;
}
@keyframes sub-ring {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--success-fill, #0a7450) 40%, transparent); }
  70%  { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.sub-done-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 6px; }
.sub-done-actions .auth-submit { flex: 1 1 200px; text-align: center; text-decoration: none; }
.sub-done-actions .btn-ghost { flex: 0 1 auto; }

.sub-done { position: relative; animation: sub-rise 360ms ease-out both; }
.sub-done[hidden] { display: none; }
/* Six drifting flecks in the brand colours. Cheap, no library, and gone in a second. */
.sub-confetti { position: absolute; inset: -24px 0 auto 0; height: 0; pointer-events: none; }
.sub-confetti i {
  position: absolute; top: 0; width: 8px; height: 12px; border-radius: 2px; opacity: 0;
  animation: sub-fleck 1100ms ease-out forwards;
}
.sub-confetti i:nth-child(1) { left: 12%; background: var(--accent);               animation-delay: 0ms;   }
.sub-confetti i:nth-child(2) { left: 28%; background: var(--success-fill, #0a7450); animation-delay: 80ms;  }
.sub-confetti i:nth-child(3) { left: 44%; background: #f59e0b;                      animation-delay: 40ms;  }
.sub-confetti i:nth-child(4) { left: 60%; background: var(--accent);               animation-delay: 120ms; }
.sub-confetti i:nth-child(5) { left: 76%; background: var(--success-fill, #0a7450); animation-delay: 20ms;  }
.sub-confetti i:nth-child(6) { left: 90%; background: #f59e0b;                      animation-delay: 100ms; }
@keyframes sub-fleck {
  0%   { opacity: 0; transform: translateY(0) rotate(0deg); }
  15%  { opacity: 1; }
  100% { opacity: 0; transform: translateY(120px) rotate(240deg); }
}

@keyframes sub-rise {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Card swap on completion: the form fades out, the done panel rises in. */
.subscribe-card .is-leaving { animation: sub-leave 220ms ease-in forwards; }
@keyframes sub-leave { to { opacity: 0; transform: translateY(-6px); } }

@media (max-width: 480px) {
  .subscribe-card { padding: 22px 18px; }
  .sub-plan-head { flex-direction: column; }
  .sub-step-label { font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  .sub-step.is-active .sub-step-dot,
  .sub-step.just-done .sub-step-dot,
  .sub-paid-dot,
  .sub-confetti i,
  .sub-plan, .sub-paid, .sub-done,
  .subscribe-card .is-leaving { animation: none; }
  .sub-start-spinner { animation-duration: 2.4s; }
  .sub-step-dot { transition: none; }
}
.sub-trust a { color: var(--accent-text, var(--accent)); font-weight: 600; }

/* "What is a video" — the question two customers asked before subscribing.
   Quieter than the feature bullets it sits among: it clarifies rather than sells. */
.sub-feat-note {
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-2);
  list-style: none;
  margin-left: -1.1em;
}

/* ---- First-month discount code (between the plan summary and "what happens next") ----
   Built from the shared pieces (.auth-input, .input-action-row, .badge, .field-help); only the
   spacing and the deal's price stack are particular to this page. No new colours. */
.sub-code { margin: -6px 0 18px; }
.sub-code-toggle { padding-left: 0; padding-right: 0; }
.sub-code-panel .auth-label:first-child { margin-top: 4px; }
.sub-code-panel .input-action-row { margin: 0; }
.sub-code-applied { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.sub-code-applied[hidden], .sub-code-panel[hidden] { display: none; }
.sub-code-help { margin: 6px 0 0; }
.sub-code-help:empty { display: none; }
/* A refusal is a sentence in the danger ink; a referral code typed here is NOT an error (the
   referrer still gets credit), so it keeps the neutral help colour. */
.sub-code-help.is-error { color: var(--danger-text); }

.sub-plan-deal { text-align: right; }
.sub-plan-deal[hidden] { display: none; }
.sub-plan-was { display: block; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.sub-plan-deal .sub-plan-price { font-size: 22px; }
.sub-plan-then { font-size: 13px; margin-top: 2px; }
@media (max-width: 480px) {
  .sub-plan-deal { text-align: left; }
}
.sub-discount-note { margin: -4px 0 14px; }
