/* DevQ website: the pricing section of the landing and the page where a plan
   is chosen (design/ui/screens/15-plans-billing: pricing.png, choose-plan.png).
   Uses the tokens of site.css. Every text colour passes WCAG AA on its
   surface in both themes (scripts/site-check.mjs, scripts/qa-billing.mjs).
   Lime surfaces keep the same dark text in both themes. */

:root { --founding-bg: #EFFBD0; --founding-ink: #14111C; --founding-text: #1F7A45; --card-shadow: 0 1px 2px rgba(20, 17, 28, .04); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --founding-bg: #222B12; --founding-ink: #F4F2FA; --founding-text: #B4EE34; --card-shadow: none; } }
:root[data-theme="dark"] { --founding-bg: #222B12; --founding-ink: #F4F2FA; --founding-text: #B4EE34; --card-shadow: none; }

/* ---------- shared parts ---------- */

.h3 { margin: 0; font-size: 22px; line-height: 1.2; font-weight: 700; letter-spacing: -0.02em; }

/* two choices, the chosen one on a raised thumb that slides */
.seg { position: relative; display: inline-flex; padding: 4px; border-radius: 11px; background: var(--surface-2); }
.seg button {
  position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px; border: 0; border-radius: 8px;
  background: transparent; color: var(--text-2); font: 600 14px/1 var(--font); cursor: pointer; white-space: nowrap;
}
.seg button[aria-pressed="true"] { color: var(--text); }
.seg button:hover { color: var(--text); }
.seg-thumb {
  position: absolute; top: 4px; bottom: 4px; left: 0; width: 0; border-radius: 8px; background: var(--bg);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .18); transition: transform var(--dur-3) var(--ease-out), width var(--dur-3) var(--ease-out);
}
.seg:not(.ready) .seg-thumb { transition: none; }
/* without scripts the thumb cannot be placed: the chosen button carries the surface itself */
html:not(.js) .seg button[aria-pressed="true"] { background: var(--bg); }
@media (prefers-reduced-motion: reduce) { .seg-thumb { transition: none; } }
.seg .save { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 6px; background: var(--lime); color: var(--lime-ink); font-size: 11.5px; font-weight: 700; }

/* ---------- pricing section ---------- */

.pricing-head { display: flex; flex-direction: column; align-items: center; text-align: center; }
.pricing-head .h2 { max-width: 620px; }
.pricing-head > p { margin: 16px 0 0; max-width: 560px; font-size: 17px; line-height: 1.55; color: var(--text-2); }
.pricing-head .seg { margin-top: 28px; }
.pricing-head .founding-pill {
  display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 10px; margin-top: 20px; padding: 6px 14px 6px 6px;
  border: 1px solid var(--border); border-radius: 999px; font-size: 13.5px; color: var(--text-2); max-width: 100%;
}
.founding-pill .tag { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; background: var(--lime); color: var(--lime-ink); font-size: 12px; font-weight: 700; white-space: nowrap; }
.founding-pill .dot { color: var(--text-3); }
.founding-pill b { color: var(--text); font-weight: 700; white-space: nowrap; }
@media (max-width: 479px) { .pricing-head .founding-pill { border-radius: 16px; padding: 8px 12px; } .founding-pill .dot { display: none; } }

.plans-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: 40px; align-items: stretch; }
.plan { position: relative; display: flex; flex-direction: column; padding: 28px 26px 30px; border: 1px solid var(--border); border-radius: 16px; background: var(--bg); box-shadow: var(--card-shadow); }
.plan.best { border: 2px solid var(--brand); padding: 27px 25px 29px; }
.plan-badge { position: absolute; top: -12px; left: 24px; display: inline-flex; align-items: center; height: 22px; padding: 0 10px; border-radius: 999px; background: #5B3EF0; color: #FFFFFF; font-size: 12px; font-weight: 700; }
.plan h3 { margin: 0; font-size: 16px; line-height: 1.3; font-weight: 700; }
.plan .for { margin: 2px 0 0; font-size: 13.5px; color: var(--text-3); }
.plan .price { display: flex; align-items: flex-end; gap: 8px; min-height: 62px; margin: 22px 0 0; }
.plan .price b { font-size: 44px; line-height: 1; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.plan .price span { padding-bottom: 3px; font-size: 13.5px; line-height: 1.4; color: var(--text-3); }
/* the chip's line keeps its height when the founding price is not offered, so the three buttons stay level */
.plan .founding-chip {
  display: inline-flex; align-self: flex-start; align-items: center; gap: 6px; height: 26px; margin: 10px 0 0; padding: 0 10px; border-radius: 7px;
  background: var(--lime); color: var(--lime-ink); font-size: 12.5px; font-weight: 700; white-space: nowrap;
}
.plan .founding-chip[hidden] { display: inline-flex !important; visibility: hidden; }
.plan .founding-chip svg { width: 14px; height: 14px; }
.plan .btn { margin-top: 22px; width: 100%; }
.plan .under { margin: 10px 0 0; text-align: center; font-size: 12.5px; color: var(--text-3); }
.plan ul { list-style: none; margin: 20px 0 0; padding: 20px 0 0; border-top: 1px solid var(--border); display: grid; gap: 12px; }
.plan li { position: relative; padding-left: 26px; font-size: 14px; line-height: 1.45; color: var(--text-2); }
.plan li::before, .compare td.yes::before {
  content: ''; position: absolute; left: 0; top: 2px; width: 16px; height: 16px; background: var(--text);
  -webkit-mask: var(--check) center / contain no-repeat; mask: var(--check) center / contain no-repeat;
}
.plan.best li::before { background: var(--link); }
:root { --check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.500 4.500 4.500L19 7.500'/%3E%3C/svg%3E"); }
.pricing-head + .plans-grid + .fine, .fine { margin: 22px 0 0; text-align: center; font-size: 13px; color: var(--text-3); }
@media (max-width: 999px) {
  .plans-grid { grid-template-columns: minmax(0, 1fr); max-width: 520px; margin-inline: auto; gap: 24px; }
  .plan .founding-chip[hidden] { display: none !important; }
  .plan .price { min-height: 0; }
}

/* compare plans */
.compare { margin-top: 72px; }
.compare .table-scroll { margin-top: 18px; overflow-x: auto; border-radius: 6px; }
.compare table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 14px; }
.compare thead th { padding: 14px 8px; font-weight: 600; text-align: center; color: var(--text); }
.compare thead tr { border-top: 1px solid var(--border); }
.compare tr { border-bottom: 1px solid var(--border); }
.compare tbody th { padding: 14px 16px 14px 0; font-weight: 400; text-align: left; color: var(--text-2); }
.compare td { position: relative; width: 16%; padding: 14px 8px; text-align: center; color: var(--text); font-weight: 500; white-space: nowrap; }
.compare td.yes::before { position: static; display: inline-block; vertical-align: -3px; }
.compare td.yes span:not(.sr) { margin-left: 4px; }
.compare td.no::before { content: '—'; color: var(--text-3); }
/* a phone shows the whole table: cells wrap instead of the table scrolling sideways */
@media (max-width: 679px) {
  .compare { margin-top: 56px; }
  .compare table { min-width: 0; font-size: 13px; table-layout: fixed; }
  .compare thead td { width: 40%; }
  .compare td, .compare thead th { width: 20%; padding: 12px 3px; white-space: normal; overflow-wrap: anywhere; }
  .compare tbody th { padding: 12px 8px 12px 0; }
  .compare td.yes span:not(.sr) { display: block; margin: 2px 0 0; }
}

.pricing-faq { margin-top: 72px; }
.qa h4 { margin: 0; font: inherit; }
@media (max-width: 899px) { .pricing-faq { margin-top: 56px; } }

/* ---------- choose a plan (/plans/) ---------- */

body.choose { min-height: 100vh; display: flex; flex-direction: column; }
.choose .top .wrap { width: min(1320px, 100% - 40px); gap: 20px; }
.choose .top .ws-name { padding-left: 20px; border-left: 1px solid var(--border); font-size: 14.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.choose .top .back { font-size: 14px; font-weight: 600; color: var(--text-2); text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px; white-space: nowrap; }
.choose .top .back:hover { color: var(--text); text-decoration-color: currentColor; }
.choose main { flex: 1; width: min(1120px, 100% - 40px); margin: 0 auto; padding: 48px 0 80px; }
.choose-grid { display: grid; grid-template-columns: minmax(0, 1fr) 450px; gap: 56px; align-items: start; }
.choose h1 { margin: 0; font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.1rem); line-height: 1.15; font-weight: 700; letter-spacing: -0.028em; overflow-wrap: anywhere; }
.choose .sub { margin: 10px 0 0; font-size: 15.5px; color: var(--text-2); }
.choose h2 { margin: 36px 0 12px; font-size: 15px; font-weight: 700; }

.plan-options { display: grid; gap: 12px; margin-top: 28px; border: 0; padding: 0; min-width: 0; }
.plan-option { position: relative; display: flex; align-items: center; gap: 16px; padding: 18px 20px; border: 1px solid var(--border); border-radius: 14px; cursor: pointer; transition: border-color var(--dur-1) ease, box-shadow var(--dur-1) ease, background-color var(--dur-1) ease; }
.plan-option:hover { background: var(--surface); }
.plan-option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.plan-option .radio { flex: none; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--text-3); transition: border-color var(--dur-1) ease, border-width var(--dur-1) ease; }
.plan-option:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); background: var(--bg); }
.plan-option:has(input:checked) .radio { border: 5.5px solid var(--brand); }
.plan-option:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.plan-option:has(input:disabled) { cursor: default; opacity: .6; }
.plan-option .words { flex: 1; min-width: 0; }
.plan-option .words b { display: block; font-size: 15.5px; font-weight: 700; }
.plan-option .words span { display: block; margin-top: 2px; font-size: 14px; color: var(--text-2); }
.plan-option .cost { font-size: 15.5px; font-weight: 700; white-space: nowrap; }

.people-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.stepper { display: inline-flex; align-items: center; height: 42px; border: 1px solid var(--border); border-radius: 10px; }
.stepper button { width: 42px; height: 40px; border: 0; background: transparent; color: var(--text); font-size: 18px; line-height: 1; cursor: pointer; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; }
.stepper button:hover:not(:disabled) { background: var(--surface); }
.stepper button:disabled { color: var(--text-3); opacity: .5; cursor: default; }
.stepper output { min-width: 44px; text-align: center; font-size: 15.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.faces { display: inline-flex; padding-left: 8px; }
.face { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; margin-left: -8px; border-radius: 50%; border: 2px solid var(--bg); color: #FFFFFF; font-size: 11.5px; font-weight: 700; }
.people-row .now { font-size: 14px; color: var(--text-2); }
.choose .hint { margin: 12px 0 0; font-size: 13.5px; color: var(--text-3); max-width: 560px; }

.summary { padding: 26px 26px 24px; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); position: sticky; top: 24px; }
.summary h2 { margin: 0 0 18px; font-size: 16px; }
.summary .line { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 6px 0; font-size: 15px; color: var(--text-2); }
.summary .line .amount { font-family: var(--mono); font-size: 14.5px; color: var(--text); white-space: nowrap; }
.summary .line.founding { color: var(--founding-text); font-weight: 600; }
.summary .line.founding .amount { color: var(--founding-text); }
.summary .line.founding svg { display: inline-block; width: 15px; height: 15px; margin-right: 8px; vertical-align: -2px; }
.summary .total { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-top: 14px; padding-top: 18px; border-top: 1px solid var(--border); font-size: 16px; font-weight: 700; }
.summary .total .amount { font-size: 17px; font-variant-numeric: tabular-nums; }
.summary .each { margin: 6px 0 0; font-size: 13.5px; color: var(--text-3); }
.summary .btn { width: 100%; height: 48px; margin-top: 22px; font-size: 15.5px; border-radius: 10px; }
.summary .btn svg { width: 16px; height: 16px; }
.summary .btn[disabled] { opacity: .55; cursor: default; }
.summary .secure { display: flex; align-items: center; justify-content: center; gap: 7px; margin: 14px 0 0; font-size: 13px; color: var(--text-3); }
.summary .secure svg { width: 14px; height: 14px; }
.summary .held { margin: 16px 0 0; padding: 12px 14px; border-radius: 10px; background: var(--founding-bg); color: var(--founding-ink); font-size: 13.5px; line-height: 1.5; }
.summary .err, .choose .err { margin: 14px 0 0; padding: 10px 12px; border: 1px solid color-mix(in srgb, var(--danger) 40%, var(--border)); border-radius: 10px; font-size: 13.5px; color: var(--danger); }
.summary .done { margin: 14px 0 0; padding: 10px 12px; border: 1px solid color-mix(in srgb, var(--ok) 40%, var(--border)); border-radius: 10px; font-size: 13.5px; color: var(--text); }
.summary.pending .line .amount, .summary.pending .total .amount, .summary.pending .each { opacity: .45; transition: opacity var(--dur-2) ease; }

.choose .state { max-width: 520px; margin: 8vh auto 0; text-align: center; }
.choose .state p { margin: 12px 0 0; font-size: 15.5px; color: var(--text-2); }
.choose .state .btn { margin-top: 22px; }

.signin-card { max-width: 400px; margin: 6vh auto 0; padding: 28px 26px; border: 1px solid var(--border); border-radius: 16px; }
.signin-card h1 { font-size: 22px; }
.signin-card p { margin: 8px 0 0; font-size: 14.5px; color: var(--text-2); }
.signin-card label { display: block; margin: 16px 0 6px; font-size: 13px; font-weight: 600; }
.signin-card input { width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--border); border-radius: 9px; background: var(--bg); color: var(--text); font: 400 15px var(--font); }
.signin-card input:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.signin-card .btn { width: 100%; height: 44px; margin-top: 20px; }

/* the outline of the page while the workspace is being read */
.bone { display: block; border-radius: 8px; background: var(--surface-2); animation: bone 1.2s ease-in-out infinite alternate; }
@keyframes bone { from { opacity: .55; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .bone { animation: none; } }

@media (max-width: 999px) {
  .choose-grid { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .summary { position: static; }
  .choose main { padding-top: 32px; }
}
@media (max-width: 479px) {
  .plan-option { padding: 14px; gap: 12px; flex-wrap: wrap; }
  .plan-option .cost { flex-basis: 100%; padding-left: 30px; }
  .choose .top .ws-name { display: none; }
  .summary { padding: 20px 18px; }
}
