:root {
  --blue: #065dff;
  --blue-hover: #004ee0;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --field: #f8fafc;
  --bg: #f1f5f9;
  --error: #b91c1c;
  --error-bg: #fef2f2;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);

  /* transitions.dev motion tokens used here */
  --duration-fast: 250ms;
  --ease-smooth-out: cubic-bezier(0.22, 1, 0.36, 1);
  --distance-micro: 4px;

  /* transitions.dev 16 (tabs sliding), mapped to this palette */
  --tabs-dur: 250ms;
  --tabs-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --tabs-text-muted: #64748b;
  --tabs-text-active: #0f172a;
  --tabs-bar-bg: #f1f5f9;
  --tabs-pill-bg: #ffffff;

  /* transitions.dev 01 (card resize) */
  --resize-dur: 300ms;
  --resize-ease: cubic-bezier(0.22, 1, 0.36, 1);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.5 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-tap-highlight-color: transparent;
}
.shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start; /* top-anchored so errors and step changes grow downward instead of re-centering */
  padding: max(clamp(32px, 14vh, 140px), env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
.card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px 24px;
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.04);
}
.brands {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 2px 0 22px;
}
.brands img { display: block; width: auto; }
.brand-radix { height: 22px; }
.brand-newfold { height: 34px; }
.pipe { width: 1px; height: 30px; background: #cbd5e1; }
h1 {
  margin: 0 0 20px;
  font: 400 18px/1.35 Unbounded, Inter, sans-serif;
  letter-spacing: -0.01em;
  text-align: center;
  text-wrap: balance;
}
.step { display: grid; gap: 10px; }
/* Animate only when switching steps, never on first paint (it read as a disabled button). */
.step.enter { animation: step-in var(--duration-fast) var(--ease-smooth-out); }
@keyframes step-in { from { opacity: 0; transform: translateY(var(--distance-micro)); } }
.intro { margin: -14px 0 18px; font-size: 14px; color: var(--muted); }
.field-with-action { position: relative; }
.field-with-action input { padding-right: 76px; }
.reveal {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  min-width: 64px;
  border: 0;
  background: none;
  color: var(--blue);
  font: 500 14px/1 Inter, sans-serif;
  cursor: pointer;
}
/* ---- transitions.dev 16: Tabs sliding (verbatim) ---- */
/* The bar is just a flex container with padding for the pill
   to sit inside. Tabs sit on z-index: 1, the pill on z-index: 0,
   so labels read above the pill background. */
.t-tabs {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border-radius: 48px;
  background: var(--tabs-bar-bg);
}
.t-tab {
  position: relative;
  appearance: none;
  border: 0;
  background: transparent;
  height: 30px;
  padding: 4px 12px;
  color: var(--tabs-text-muted);
  cursor: pointer;
  border-radius: 48px;
  z-index: 1;
  transition: color var(--tabs-dur) var(--tabs-ease);
}
.t-tab:not([aria-selected="true"]):hover,
.t-tab[aria-selected="true"] {
  color: var(--tabs-text-active);
}

/* The pill: width + transform are written inline by JS so
   the transition tweens between the previous and next
   measured positions. */
.t-tabs-pill {
  position: absolute;
  top: 3px;
  left: 0;
  height: 30px;
  width: 0;
  background: var(--tabs-pill-bg);
  border-radius: 48px;
  transform: translateX(0);
  transition:
    transform var(--tabs-dur) var(--tabs-ease),
    width     var(--tabs-dur) var(--tabs-ease);
  will-change: transform, width;
  z-index: 0;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .t-tabs-pill, .t-tab { transition: none !important; }
}
/* ---- end transitions.dev 16 ---- */

/* Layout for this card: two equal 44px tabs (touch-sized) in a rounded-rect bar. */
.switch.t-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  margin-bottom: 18px;
  border-radius: 12px;
}
.switch .t-tab {
  height: auto;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 9px;
  font: 500 14px/1 Inter, sans-serif;
}
.switch .t-tabs-pill {
  top: 4px;
  height: 44px;
  border-radius: 9px;
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.08);
}

/* ---- transitions.dev 01: Card resize (verbatim) ---- */
.t-resize {
  transition:
    width  var(--resize-dur) var(--resize-ease),
    height var(--resize-dur) var(--resize-ease);
  will-change: width, height;
}

@media (prefers-reduced-motion: reduce) {
  .t-resize { transition: none !important; }
}
/* ---- end transitions.dev 01 ---- */
.card.is-resizing { overflow: hidden; }
.note {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 14px;
}
label { font-size: 14px; font-weight: 500; }
.row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
input {
  width: 100%;
  font: inherit;
  font-size: 16px; /* stops iOS zooming on focus */
  color: var(--ink);
  background: var(--field);
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 12px 14px;
  transition: border-color 150ms var(--ease-out), box-shadow 150ms var(--ease-out);
}
input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgb(6 93 255 / 0.18); }
input[aria-invalid="true"] { border-color: var(--error); }
#code {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: 0.4em;
  text-align: center;
  font-variant-numeric: tabular-nums;
  padding: 12px 0 12px 0.4em;
}
button[type="submit"] {
  margin-top: 6px;
  min-height: 46px;
  border: 0;
  border-radius: 10px;
  background: var(--blue);
  color: #fff;
  font: 600 15px/1 Inter, sans-serif;
  cursor: pointer;
  transition: background-color 150ms var(--ease-out), transform 120ms var(--ease-out);
}
button[type="submit"]:active { transform: scale(0.98); }
.button-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border-radius: 10px;
  background: var(--blue);
  color: #fff;
  font: 600 15px/1 Inter, sans-serif;
  text-decoration: none;
}
button:disabled { opacity: 0.6; cursor: default; }
button:focus-visible { outline: 3px solid rgb(6 93 255 / 0.35); outline-offset: 2px; }
.link {
  border: 0;
  background: none;
  padding: 6px 0;
  min-height: 44px;
  color: var(--blue);
  font: 500 14px/1 Inter, sans-serif;
  cursor: pointer;
}
.link:disabled { color: var(--muted); }
.center { justify-self: center; }
.hint { margin: 0; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.hint strong { color: var(--ink); font-weight: 500; }
.error {
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--error-bg);
  color: var(--error);
  font-size: 14px;
}
@media (hover: hover) {
  button[type="submit"]:hover:not(:disabled) { background: var(--blue-hover); }
  .link:hover:not(:disabled) { text-decoration: underline; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
