/* The cancellation form with the reason and the offer: one white card on a white page, held up by soft layered
   shadows and a 1px edge. Three views share the card (the reason, what you lose, the end) and the card's height
   follows the one on show. */
:root {
  --page: #ffffff;            /* the page */
  --card: #ffffff;            /* the card */
  --ink: #131316;             /* the words */
  --muted: #6e6e78;           /* the small words */
  --faint: #a4a4ad;           /* struck out words, placeholders */
  --line: rgba(19, 19, 22, 0.08); /* hairlines and edges */
  --soft: #f5f5f7;            /* resting pills and fields */
  --accent: #5146e5;          /* the colour of a choice and of the offer */
  --accent-tint: #efeefe;     /* the fill of a chosen pill */
  --accent-deep: #3b31c4;     /* the words of a chosen pill */
  --cancel: #c2372e;          /* cancel and the strike */
  --w: min(372px, 92vw);
  --pad: min(22px, 4.2vh, 5.6vw);
  --gap: min(14px, 2.6vh);
}

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

html, body { height: 100%; }

body {
  background: var(--page);
  color: var(--ink);
  font-family: 'Mona Sans Variable', 'Mona Sans', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

button, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }

.sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

.stage {
  position: relative;
  height: 100vh;
  display: grid;
  place-items: center;
  padding: min(2.4vh, 18px) 10px;
  overflow: hidden;
}

/* ---------- the card ---------- */
.cx {
  position: relative;
  width: var(--w);
  padding: var(--pad);
  border-radius: 22px;
  background: var(--card);
  box-shadow:
    0 0 0 1px var(--line),
    0 1px 2px rgba(19, 19, 22, 0.05),
    0 8px 18px -6px rgba(19, 19, 22, 0.08),
    0 34px 64px -26px rgba(40, 34, 120, 0.22);
}

/* the top edge catches the light */
.cx::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(81, 70, 229, 0.045), transparent 34%);
}

.cx__head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: min(12px, 2.2vh);
  margin-bottom: min(14px, 2.6vh);
  border-bottom: 1px solid var(--line);
}

.app { display: inline-flex; align-items: center; gap: 7px; }

.app__mark {
  width: 22px; height: 22px;
  padding: 3px;
  border-radius: 7px;
  background: linear-gradient(160deg, #6b61f2, #3b31c4);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 2px 6px -2px rgba(59, 49, 196, 0.6);
  fill: none; stroke: #fff; stroke-width: 1.9; stroke-linecap: round;
}

.app__name { font-size: 13.5px; font-weight: 640; font-variation-settings: 'wdth' 104; letter-spacing: 0.005em; }

.app__plan {
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.02em;
  color: var(--accent-deep);
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--accent-tint);
}

.cx__price { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- the views ---------- */
.views { position: relative; }

.view {
  position: absolute;
  left: 0; right: 0; top: 0;
  visibility: hidden;
}

.view.is-on { visibility: visible; }

.title {
  font-size: min(21px, 4.4vh, 6.2vw);
  line-height: 1.15;
  font-weight: 620;
  font-variation-settings: 'wdth' 100;
  letter-spacing: -0.015em;
}

.sub {
  margin-top: 5px;
  font-size: min(13px, 2.8vh, 3.7vw);
  line-height: 1.4;
  color: var(--muted);
}

/* ---------- the reasons ---------- */
.reasons {
  margin-top: var(--gap);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: min(7px, 1.4vh);
}

.pill {
  position: relative;
  height: min(38px, 7.8vh);
  border-radius: 999px;
  background: var(--soft);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: min(13px, 3.45vw, 2.9vh);
  font-weight: 520;
  color: #3a3a42;
  white-space: nowrap;
  isolation: isolate;
  transition: color 0.25s, box-shadow 0.25s;
}

.pill__fill {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--accent-tint);
  box-shadow: inset 0 0 0 1.5px var(--accent), 0 6px 14px -8px rgba(81, 70, 229, 0.65);
  opacity: 0;
  z-index: -1;
}

/* GSAP moves .pill__in, the CSS keeps its centring */
.pill__in {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 0 10px;
}

.pill__tick {
  display: inline-block;
  width: 0;
  overflow: hidden;
  flex: none;
}

.pill__tick svg {
  display: block;
  width: 14px; height: 14px;
  margin-right: 5px;
  fill: none; stroke: var(--accent); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 1; stroke-dashoffset: 1;
}

.pill__words { font-variation-settings: 'wdth' 100; }

.pill[aria-checked='true'] { color: var(--accent-deep); box-shadow: none; }

@media (hover: hover) {
  .pill:hover { color: var(--ink); box-shadow: inset 0 0 0 1px rgba(19, 19, 22, 0.16); }
  .pill[aria-checked='true']:hover { color: var(--accent-deep); box-shadow: none; }
}

.pill:focus-visible, .next:focus-visible, .act:focus-visible, .back:focus-visible, .undo:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- anything else ---------- */
.more {
  height: 0;
  overflow: hidden;
  margin: 0 -5px;
  padding: 0 5px;
  opacity: 0;
}

.more__box {
  position: relative;
  display: block;
  margin: min(10px, 2vh) 0 5px;
  border-radius: 14px;
  background: var(--soft);
  box-shadow: inset 0 0 0 1px var(--line);
  padding: min(8px, 1.6vh) 12px min(6px, 1.2vh);
  transition: box-shadow 0.25s, background 0.25s;
}

.more__box.is-focus, .more__box:focus-within {
  background: #fff;
  box-shadow: inset 0 0 0 1.5px var(--accent), 0 0 0 4px rgba(81, 70, 229, 0.1);
}

.more__label { display: block; font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: 0.01em; }

.more__text {
  display: block;
  width: 100%;
  height: min(36px, 7vh);
  margin-top: 2px;
  border: 0;
  background: none;
  resize: none;
  outline: none;
  font-size: min(13.5px, 2.9vh, 3.7vw);
  line-height: 1.35;
}

.more__text::placeholder { color: var(--faint); }

.more__count {
  position: absolute;
  right: 12px; top: min(8px, 1.6vh);
  font-size: 10.5px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

/* ---------- continue ---------- */
.next {
  position: relative;
  margin-top: var(--gap);
  width: 100%;
  height: min(44px, 9vh);
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: min(14px, 3vh, 3.9vw);
  font-weight: 580;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 8px 18px -10px rgba(19, 19, 22, 0.7);
  transition: background 0.3s, color 0.3s, box-shadow 0.3s;
}

.next:disabled { background: #ececef; color: var(--faint); box-shadow: none; cursor: default; }

.next__icon { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

@media (hover: hover) {
  .next:not(:disabled):hover .next__icon { transform: translateX(2px); }
}
.next__icon { transition: transform 0.35s cubic-bezier(0.3, 1.6, 0.5, 1); }

/* ---------- what you lose ---------- */
.back {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin: -4px 0 min(6px, 1.2vh) -6px;
  padding: 4px 8px 4px 4px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 560;
  color: var(--muted);
  transition: background 0.2s, color 0.2s;
}

.back svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

@media (hover: hover) { .back:hover { background: var(--soft); color: var(--ink); } }

.losses {
  list-style: none;
  margin-top: min(10px, 2vh);
  display: grid;
  gap: min(9px, 1.7vh);
}

.loss {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: min(13.5px, 2.9vh, 3.8vw);
  color: var(--ink);
  transition: color 0.4s;
}

.loss__icon {
  width: 18px; height: 18px; flex: none;
  fill: none; stroke: var(--muted); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
  transition: stroke 0.4s, opacity 0.4s;
}

.loss__words { position: relative; display: inline-block; }

.loss__strike {
  position: absolute;
  left: -2px; right: -2px;
  top: 54%;
  height: 1.5px;
  border-radius: 2px;
  background: var(--cancel);
  transform: scaleX(0);
  transform-origin: 0 50%;
}

.loss.is-struck { color: var(--faint); }
.loss.is-struck .loss__icon { opacity: 0.5; }

/* ---------- the offer ---------- */
.offer {
  position: relative;
  margin-top: var(--gap);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: min(13px, 2.5vh) 14px;
  border-radius: 16px;
  background: linear-gradient(160deg, #ffffff, #f7f6ff);
  box-shadow: 0 0 0 1px rgba(81, 70, 229, 0.16), 0 2px 4px -2px rgba(40, 34, 120, 0.12);
  overflow: hidden;
  isolation: isolate;
}

/* a light that runs around the edge: a conic gradient masked to a 1.5px ring */
.offer__edge {
  --a: 0deg;
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.5px;
  background: conic-gradient(from var(--a), transparent 0deg, rgba(81, 70, 229, 0) 200deg, rgba(81, 70, 229, 0.9) 290deg, #b9b3ff 320deg, transparent 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  opacity: 0;
  pointer-events: none;
}

/* a soft light inside, under the pointer */
.offer__glow {
  position: absolute;
  left: 0; top: 0;
  width: 180px; height: 180px;
  margin: -90px 0 0 -90px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(81, 70, 229, 0.14), transparent);
  opacity: 0;
  z-index: -1;
  pointer-events: none;
}

.offer__icon {
  width: min(36px, 7.4vh); height: min(36px, 7.4vh);
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: linear-gradient(160deg, #6b61f2, #3b31c4);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 6px 12px -6px rgba(59, 49, 196, 0.8);
}

.offer__icon svg { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

.offer__body { display: grid; gap: 2px; min-width: 0; }

.offer__title { font-size: min(14.5px, 3vh, 4vw); font-weight: 620; letter-spacing: -0.005em; }

.offer__line { font-size: min(12px, 2.6vh, 3.4vw); line-height: 1.35; color: var(--muted); }

/* ---------- pause and cancel ---------- */
.acts {
  margin-top: var(--gap);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.act {
  position: relative;
  height: min(44px, 9vh);
  border-radius: 999px;
  font-size: min(14px, 3vh, 3.9vw);
  font-weight: 580;
}

/* GSAP presses the button; the face keeps the CSS look */
.act__face {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  border-radius: inherit;
  transition: background 0.25s, box-shadow 0.25s, color 0.25s;
}

.act--keep .act__face {
  background: linear-gradient(180deg, #5d53ee, var(--accent));
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 10px 20px -10px rgba(81, 70, 229, 0.9);
}

.act--cancel .act__face {
  color: var(--cancel);
  box-shadow: inset 0 0 0 1px var(--line);
}

@media (hover: hover) {
  .act--keep:hover .act__face { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 14px 24px -10px rgba(81, 70, 229, 1); }
  .act--cancel:hover .act__face { background: #fdf3f2; box-shadow: inset 0 0 0 1px rgba(194, 55, 46, 0.25); }
}
.act.is-hot.act--keep .act__face { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 14px 24px -10px rgba(81, 70, 229, 1); }
.act.is-hot.act--cancel .act__face { background: #fdf3f2; box-shadow: inset 0 0 0 1px rgba(194, 55, 46, 0.25); }
.act.is-down .act__face { box-shadow: inset 0 2px 5px rgba(19, 19, 22, 0.18); }

/* ---------- the end ---------- */
.view[data-view='done'] { text-align: center; padding-top: min(6px, 1vh); }

.cal {
  width: min(48px, 9.6vh); height: min(48px, 9.6vh);
  fill: none; stroke-linecap: round; stroke-linejoin: round;
}

.cal__body, .cal__ring, .cal__line { stroke: var(--ink); stroke-width: 2; }
.cal__mark { stroke: var(--accent); stroke-width: 2.6; }
.cal * { stroke-dasharray: 1; stroke-dashoffset: 1; }

.done__lead { margin-top: min(8px, 1.4vh); font-size: min(13.5px, 2.9vh, 3.8vw); color: var(--muted); }

.done__date {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  margin-top: 2px;
  min-height: 1.1em;
  font-size: min(44px, 9vh, 12vw);
  line-height: 1.05;
  font-weight: 650;
  font-variation-settings: 'wdth' 92;
  letter-spacing: -0.03em;
}

.done__chars { display: inline-flex; white-space: pre; }
.done__ch { display: inline-block; white-space: pre; }

.done__caret {
  display: inline-block;
  width: 2px;
  height: 0.78em;
  margin-left: 3px;
  border-radius: 1px;
  background: var(--accent);
  align-self: center;
  opacity: 0;
}

.done__sub { margin: min(6px, 1vh) auto 0; max-width: 260px; font-size: min(12.5px, 2.7vh, 3.6vw); line-height: 1.4; color: var(--muted); }

.undo {
  margin-top: min(14px, 2.6vh);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 580;
  color: var(--accent-deep);
  box-shadow: inset 0 0 0 1px rgba(81, 70, 229, 0.22);
  transition: background 0.2s;
}

@media (hover: hover) { .undo:hover { background: var(--accent-tint); } }

/* ---------- the drawn pointer of the autopilot ---------- */
.ghost {
  position: absolute;
  left: 0; top: 0;
  width: 22px; height: 22px;
  fill: #111;
  stroke: #fff;
  stroke-width: 1.4;
  stroke-linejoin: round;
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.22));
  pointer-events: none;
  visibility: hidden;
  z-index: 5;
  margin: -3px 0 0 -4px;
}

@media (prefers-reduced-motion: reduce) {
  .next__icon, .pill, .loss, .loss__icon { transition: none; }
}
