/* goseq.app/manage: managing a GoSEQ Pro subscription. The pay page's look and motion (pay.css: the tokens, the cards,
   the tick, the rise and the fades, the same curves and timings), and only this page's own layout here. 360 px first;
   one column, never wider than the pay page's confirmation. Only transform and opacity move (and the tick's stroke). */
.mg { max-width: 560px; }
.mg-view { max-width: 520px; margin: 3vh auto 0; }
.mg-view:focus, .mg-view h1:focus, .mg-view h2:focus { outline: none; }
.mg h1 { margin: 0 0 12px; font-size: clamp(26px, 6vw, 32px); letter-spacing: -.03em; line-height: 1.15; }
.mg-step h2 { margin: 2px 0 8px; font-size: 22px; letter-spacing: -.02em; line-height: 1.2; }
.mg-backstep { display: inline-flex; align-items: center; gap: 4px; min-height: 40px; margin: -10px 0 2px -2px; padding: 8px 2px; }
.mg-backstep::before { content: ""; width: 8px; height: 8px; border: solid currentColor; border-width: 0 0 2px 2px; transform: rotate(45deg); margin-right: 2px; }

/* the overview */
.mg-alert { margin: 0 0 12px; padding: 12px 14px; border-radius: 12px; background: color-mix(in srgb, var(--bad) 13%, var(--surface)); color: var(--text); font-weight: 600; line-height: 1.45; }
.mg-card { padding: 16px 18px; }
.mg-dl { display: grid; grid-template-columns: fit-content(48%) minmax(0, 1fr); gap: 10px 16px; margin: 0; }   /* a long term never squeezes its value */
.mg-dl dt { color: var(--muted); font-size: 15px; }
.mg-dl dd { margin: 0; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
/* the plan and its price: the card's title line, full width */
.mg-dl dt.big { grid-column: 1 / -1; margin-bottom: -8px; font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.mg-dl dd.big { grid-column: 1 / -1; text-align: left; padding-bottom: 12px; border-bottom: 1px solid var(--line); color: var(--text); font-size: 19px; font-weight: 800; letter-spacing: -.01em; }
.mg-dl dd.bad { color: var(--bad); }
.mg-card .fineprint { margin-top: 12px; }
.mg-acts { display: grid; gap: 8px; margin: 16px 0 0; }
.mg-page .mg-acts .abtn { justify-content: space-between; min-height: 54px; padding: 8px 22px; border-radius: 999px; font-weight: 700; text-decoration: none; color: var(--text); }
.mg-acts .abtn small { font-weight: 600; color: var(--muted); }
.mg-page .mg-acts .abtn.primary { color: var(--bg); } .mg-acts .abtn.primary small { color: inherit; opacity: .85; }
.mg-acts .abtn::after { content: ""; flex: none; width: 7px; height: 7px; margin-left: 10px; border: solid currentColor; border-width: 2px 2px 0 0; transform: rotate(45deg); opacity: .5; }
.mg-acts .abtn > span { display: grid; text-align: left; }
.mg-portal { margin-top: 18px; }
.mg-portal .linkbtn { font-size: inherit; font-weight: 700; color: var(--accent); }
#over .msg { min-height: 0; }

/* a step: what will happen, then one button. The slot keeps its height while Stripe is asked, so the button never jumps. */
.mg-lead { margin: 0 0 12px; color: var(--text); line-height: 1.5; }
.mg-slot { min-height: 188px; }
.mg-load { display: flex; align-items: center; gap: 10px; min-height: 188px; color: var(--muted); font-weight: 600; }
.mg-load .arcspin { width: 20px; height: 20px; color: var(--accent); }
.mg-sum { padding: 14px 16px; border-radius: 14px; background: var(--bg); border: 1px solid var(--line); }
.mg-step .msg { min-height: 42px; margin: 8px 0 0; display: flex; align-items: flex-end; }
.mg-step .msg:empty { display: block; }
.mg-step button.go { display: flex; align-items: center; justify-content: center; gap: 9px; height: 54px; margin-top: 6px; white-space: nowrap; overflow: hidden; border-radius: 999px;
  transition: transform .12s var(--ease), opacity .18s var(--ease), background-color .15s var(--ease); }
.mg-step button.go[disabled] { opacity: .6; }
.mg-step button.go:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.mg-step button.go .lbl { display: inline-flex; align-items: center; gap: 9px; }
/* cancelling is as plain as subscribing: the same button, in the error colour so it reads as an ending (not hidden, not grey) */
/* (bright red is for danger only: this is the one place on the page it's used; the same pill as the main button) */
.mg-page .mg-step button.mg-danger { background: var(--bad); border-color: var(--bad); color: var(--bg); box-shadow: none; }
.mg-page .mg-step button.mg-danger:hover:not([disabled]) { border-color: color-mix(in srgb, var(--bad) 88%, var(--text)); color: var(--bg);  background: color-mix(in srgb, var(--bad) 88%, var(--text)); }
.mg-reasons { margin: 4px 0 0; padding: 0; border: 0; min-width: 0; }
.mg-reasons legend { padding: 0; margin-bottom: 6px; font-size: 14px; font-weight: 700; color: var(--muted); }
.mg-reasons label { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; margin: 0 0 6px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; cursor: pointer; }
.mg-reasons label:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent-soft) 45%, var(--surface)); }
.mg-reasons input { width: 18px; height: 18px; min-height: 0; margin: 0; accent-color: var(--accent); }
.mg-reasons label:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
#cancel .fineprint { margin-top: 10px; }

/* the card step: pay.css's Payment Element box and skeleton, as they are */
.mg .pay-card .pay-secure { margin-top: 14px; }
.mg .r { display: flex; flex-wrap: wrap; gap: 8px; } .mg .r a { text-decoration: none; }

/* the result */
.mg-result { margin-top: 3vh; }
.mg-result > p { margin: 0 0 10px; color: var(--muted); }
.mg-result > p:empty { display: none; }
.mg-result.bad .pt-disc { fill: color-mix(in srgb, var(--bad) 14%, var(--surface)); }
.mg-result.bad .pt-ring, .mg-result.bad .pt-check { stroke: var(--bad); }
.mg-result .msg { min-height: 0; }

/* invoices */
.mg-inv { margin: 4px 0 0; padding: 0; list-style: none; }
.mg-inv li { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.mg-inv li:first-child { border-top: 0; }
.mg-inv .d { font-weight: 700; }
.mg-inv .s { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.mg-inv .s b { font-weight: 700; color: var(--text); } .mg-inv .s b.due { color: var(--bad); }
.mg-inv .l { grid-row: 1 / span 2; grid-column: 2; display: flex; gap: 4px; }
.mg-inv .l a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; font-weight: 700; color: var(--accent); }
.mg-inv .none { display: block; color: var(--muted); border: 0; }

@media (max-width: 380px) { .mg-card, .acc-card.mg-step { padding: 16px; } .mg-dl { gap: 9px 12px; } .mg-dl dt { font-size: 14.5px; } }

/* ---- motion (manage.js has the rest, with the same numbers): a view rises in (.24s), the result draws its tick ---- */
@keyframes mg-rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes mg-fade { from { opacity: 0; } }
@media (prefers-reduced-motion: no-preference) {
  .mg-view.in:not(.mg-result) { animation: mg-rise .24s var(--ease) both; }
  .mg-view.in .mg-acts > * { animation: mg-rise .24s var(--ease) both; animation-delay: calc(.06s + var(--i, 0) * 40ms); }
  .mg-slot > :not([hidden]) { animation: mg-fade .2s var(--ease) both; }
  .mg-reasons label { transition: border-color .15s var(--ease), background-color .15s var(--ease); }
}
@media (prefers-reduced-motion: reduce) {
  .mg-view.in, .mg-result.in { animation: mg-fade .1s linear both; }
  .mg-step button.go { transition: none; }
}
