/* ==========================================================================
   Checkout page: steps on the left, sticky order summary on the right.
   ========================================================================== */
[hidden] { display: none !important; }

.co-section { padding: clamp(40px, 6vw, 88px) 0 var(--section); }

.co {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  grid-template-areas: "head summary" "steps summary";
  grid-template-rows: auto 1fr;
  column-gap: clamp(40px, 7vw, 112px);
  row-gap: 36px;
  align-items: start;
}
.co-head { grid-area: head; }
.co-steps { grid-area: steps; list-style: none; padding: 0; margin: 0; }
.summary { grid-area: summary; }

/* ---------- Heading ---------- */
.co-closed { max-width: 560px; padding-top: 8px; }
.co-closed .lead { margin-top: 18px; max-width: 30ch; }
.co-closed .beta-form { margin-top: 36px; }
.co-open-head { display: grid; gap: 18px; justify-items: start; }
.back {
  display: inline-flex; align-items: center; gap: 4px;
  min-height: 44px; margin-left: -6px; padding-right: 8px;
  font-size: 15px; font-weight: 600; color: var(--muted); text-decoration: none;
  transition: color 0.2s;
}
.back svg { width: 20px; height: 20px; transition: transform 0.2s var(--ease); }
.back:hover { color: var(--ink); }
.back:hover svg { transform: translateX(-2px); }

/* ---------- Steps ---------- */
.step {
  padding: 28px 28px 30px;
  background: var(--surface);
  border: 1.5px solid var(--line); border-radius: var(--radius);
  transition: border-color 0.3s, opacity 0.3s;
}
.step + .step { margin-top: 16px; }
.step[data-status="active"] { border-color: var(--ink); }
.step[data-status="todo"] { opacity: 0.62; }
.step-head { display: flex; align-items: center; gap: 14px; }
.step-n {
  position: relative; flex: none; display: grid; place-items: center;
  width: 32px; height: 32px; border-radius: 50%;
  border: 1.5px solid var(--line-2); color: var(--muted);
  font-size: 15px; font-weight: 650; line-height: 1;
  transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}
.step-n .tick { position: absolute; width: 18px; height: 18px; opacity: 0; transform: scale(0.6); transition: opacity 0.3s, transform 0.4s var(--ease); }
.step[data-status="active"] .step-n { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.step[data-status="done"] .step-n { background: var(--olive); border-color: var(--olive); color: #fff; }
.step[data-status="done"] .num { opacity: 0; }
.step[data-status="done"] .tick { opacity: 1; transform: none; }
.step-body { margin-top: 22px; padding-left: 46px; }

.fld + .fld { margin-top: 14px; }
.fld { margin-bottom: 14px; }
.lbl { display: block; margin: 0 0 8px 4px; font-size: 14px; font-weight: 600; color: var(--ink); }
.step-body .btn[type="submit"] { margin-top: 6px; }
.step-links { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 2px 0 6px; }
.step-body > div > p.tiny, .step-body form > p.tiny, .step-body > p.tiny { margin-top: 2px; }
.signed { font-size: 17px; color: var(--ink-2); overflow-wrap: anywhere; }
.signed .strong { color: var(--ink); }

.text-btn {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0;
  background: none; border: 0; border-radius: 6px;
  font-size: 15px; font-weight: 500; color: var(--ink-2);
  text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 4px;
  transition: color 0.2s, text-decoration-color 0.2s;
}
.text-btn:hover { color: var(--ink); text-decoration-color: var(--ink); }

.co-msg { min-height: 1.5em; margin-top: 12px; font-size: 14.5px; line-height: 1.45; color: var(--muted); }
.co-msg:empty { min-height: 0; margin-top: 0; }
.co-msg[data-tone="error"] { color: #a2463d; }
.co-msg[data-tone="ok"] { color: var(--olive); font-weight: 600; }

.step .btn-lg { width: 100%; }
#trial-block .tiny, #pay-sub { margin-top: 10px; }
.or { display: flex; align-items: center; gap: 14px; margin: 22px 0; font-size: 13px; color: var(--muted); }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.step-body p.trust { display: flex; align-items: center; gap: 8px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.trust svg { flex: none; width: 15px; height: 15px; }

/* ---------- Order summary ---------- */
.summary {
  position: sticky; top: calc(var(--nav-h) + 24px);
  padding: 30px 30px 28px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.sum-top { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.sum-change { font-size: 15px; font-weight: 500; color: var(--muted); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 4px; transition: color 0.2s, text-decoration-color 0.2s; }
.sum-change:hover { color: var(--ink); text-decoration-color: var(--ink); }

/* Small segmented control */
.seg {
  --pad: 3px;
  position: relative; display: grid; grid-template-columns: 1fr 1fr;
  margin-top: 22px; padding: var(--pad);
  background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--pill);
}
.seg-thumb {
  position: absolute; top: var(--pad); bottom: var(--pad); left: var(--pad); width: calc(50% - var(--pad));
  border-radius: var(--pill); background: var(--ink);
  transition: transform 0.45s var(--ease);
}
.seg[data-period="year"] .seg-thumb { transform: translateX(100%); }
.seg-opt { position: relative; display: block; cursor: pointer; }
.seg-opt input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.seg-opt span {
  position: relative; z-index: 1; display: flex; align-items: center; justify-content: center;
  min-height: 40px; font-size: 15px; font-weight: 600; color: var(--ink-2);
  border-radius: var(--pill); transition: color 0.3s;
}
.seg-opt:hover span { color: var(--ink); }
.seg-opt input:checked + span { color: var(--paper); }
.seg-opt input:focus-visible + span { outline: 2px solid var(--olive); outline-offset: 2px; }

.sum-price { display: flex; align-items: baseline; gap: 3px; margin-top: 26px; }
.sum-amount { font-size: 52px; font-weight: 700; letter-spacing: -0.045em; line-height: 1; font-variant-numeric: tabular-nums; }
.sum-unit { margin-left: 3px; font-size: 17px; font-weight: 500; color: var(--muted); }
.sum-eq { margin-top: 10px; min-height: 1.5em; }
.sum-rows { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.sum-trial { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 600; color: var(--ink); }
.sum-trial svg, .sum-perks svg { flex: none; width: 18px; height: 18px; color: var(--olive); }
ul.sum-perks { list-style: none; padding: 20px 0 0; margin: 20px 0 0; border-top: 1px solid var(--line); display: grid; gap: 12px; }
.sum-perks li { display: flex; align-items: flex-start; gap: 12px; font-size: 16px; line-height: 1.4; color: var(--ink-2); }
.sum-perks svg { margin-top: 2px; }

.is-swap { animation: sum-in 0.45s var(--ease) both; }
@keyframes sum-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Responsive ---------- */
@media (max-width: 939px) {
  .co { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "summary" "steps"; grid-template-rows: auto; row-gap: 28px; }
  .summary { position: static; max-width: none; }
  .co-closed .lead { max-width: none; }
  ul.sum-perks { display: none; }
}
@media (max-width: 520px) {
  .step { padding: 22px 20px 24px; }
  .step-body { padding-left: 0; margin-top: 20px; }
  .summary { padding: 24px 22px 22px; }
  .sum-amount { font-size: 46px; }
}

.trial-used { margin-bottom: 14px; }

[data-auth-panel]:focus { outline: none; }
.sent-title { font-size: 19px; font-weight: 650; letter-spacing: -0.01em; color: var(--ink); }
