/* Terms and Conditions. Two surfaces share this sheet: the legal document (terms.html)
   and the acceptance gate rendered over the sign-up form (customer.js).
   Nothing here is placed in a cascade layer, so it outranks the legacy sheets that
   customer-legacy.css imports — which is what keeps `.customer-page input{height:52px}`
   off the agreement checkbox. */

/* ---------- document ---------- */
.terms-page main{padding-top:10px}
/* The document reads edge to edge: the page inset is the only gutter, so wide screens get the
   full measure instead of a narrow column floating in empty space. */
.terms-page .wrap{width:calc(100% - clamp(40px,6vw,96px))}
.terms-doc{margin:26px 0 56px}
/* studio.css styles every bare <header> as the 108px site bar; this one is document chrome. */
.terms-doc-head{display:block;height:auto;padding:0}
.terms-eyebrow{font-size:10px;font-weight:800;letter-spacing:1.6px;color:var(--muted-ink);margin:0 0 16px}
.terms-doc-head h1{font-size:clamp(34px,4.4vw,56px);line-height:1.06;font-weight:700;letter-spacing:-2.4px;margin:0;color:var(--ink)}
.terms-lede{font-size:15px;line-height:1.8;color:var(--muted-ink);max-width:660px;margin:18px 0 0}
.terms-meta{display:flex;flex-wrap:wrap;gap:10px 22px;list-style:none;padding:16px 0 0;margin:22px 0 0;border-top:1px solid var(--rule);font-size:11px;color:var(--muted-ink)}
.terms-meta li{display:flex;align-items:center;gap:8px}
.terms-meta li:before{content:"";width:5px;height:5px;border-radius:50%;background:var(--surface)}
html.dark .terms-meta li:before{background:#5c86a8}
/* Three columns keep the clause index scannable at document width; both documents carry a
   multiple of three sections so the card never ends in a half row. */
.terms-toc{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:2px 26px;margin:26px 0 0;padding:20px 22px;border:1px solid var(--rule);border-radius:16px;background:var(--card-1)}
.terms-toc a{position:relative;padding:7px 0;font-size:12px;color:var(--muted-ink);transition:color var(--quick) var(--ease)}
.terms-toc a:hover{color:var(--ink);text-decoration:underline;text-underline-offset:4px}
.terms-sec{display:grid;grid-template-columns:190px minmax(0,1fr);gap:8px 30px;padding:26px 0;border-top:1px solid var(--rule);scroll-margin-top:24px}
.terms-sec h2{font-size:17px;font-weight:700;letter-spacing:-.3px;line-height:1.35;margin:0;color:var(--ink)}
.terms-sec h2 span{display:block;font-size:10px;font-weight:800;letter-spacing:1.4px;color:var(--muted-ink);margin-bottom:6px}
.terms-sec-body p{font-size:14px;line-height:1.85;margin:0 0 12px;color:var(--ink);opacity:.88}
.terms-sec-body p:last-child{margin-bottom:0}
.terms-sec-body ul{margin:0;padding:0;list-style:none}
.terms-sec-body li{position:relative;padding-left:16px;font-size:14px;line-height:1.75;margin-bottom:8px;color:var(--ink);opacity:.88}
.terms-sec-body li:last-child{margin-bottom:0}
.terms-sec-body li:before{content:"";position:absolute;left:0;top:.68em;width:5px;height:5px;border-radius:1px;background:var(--surface)}
html.dark .terms-sec-body li:before{background:#5c86a8}
.terms-doc-foot{display:flex;align-items:center;justify-content:space-between;gap:22px;margin-top:8px;padding:22px 24px;border:1px solid var(--rule);border-radius:16px;background:var(--card-1)}
.terms-doc-foot b{display:block;font-size:13px;margin-bottom:5px}
.terms-doc-foot p{font-size:12px;line-height:1.6;color:var(--muted-ink)}
.terms-doc-go{display:inline-flex;align-items:center;gap:7px;flex-shrink:0;padding:13px 18px;border-radius:999px;background:var(--ink);color:var(--page);font-size:12px;font-weight:700;transition:transform var(--quick) var(--ease),opacity var(--quick) var(--ease)}
.terms-doc-go:hover{transform:translateY(-2px)}
.terms-doc-go:active{transform:translateY(0);opacity:.82}
.terms-foot{font-size:11px;color:var(--muted-ink)}
.terms-foot a{color:var(--ink)}
/* The line under the sign-in form that links the document above. */
.auth-legal{font-size:10.5px;line-height:1.6;text-align:center;color:var(--muted-ink);margin:0 0 20px}
.auth-legal a{color:var(--ink);text-decoration:underline;text-underline-offset:3px;transition:opacity var(--quick) var(--ease)}
.auth-legal a:hover{opacity:.7}
@media(max-width:700px){
  .terms-doc{margin-top:12px}
  .terms-toc{grid-template-columns:minmax(0,1fr);padding:16px}
  .terms-sec{grid-template-columns:minmax(0,1fr);gap:12px;padding:22px 0}
  .terms-sec h2 span{display:inline;margin:0 8px 0 0;vertical-align:2px}
  .terms-doc-foot{flex-direction:column;align-items:flex-start}
}

/* ---------- acceptance gate ---------- */
.terms-gate{position:fixed;inset:0;z-index:120;display:grid;place-items:center;padding:24px}
.terms-gate:before{content:"";position:fixed;inset:0;z-index:-1;background:#0d1420c4;backdrop-filter:blur(3px)}
html[data-theme=light] .terms-gate:before{background:#172d5366}
.terms-card{display:flex;flex-direction:column;width:min(720px,100%);max-height:calc(100dvh - 40px);border:1px solid var(--auth-border,#cad4dc);border-radius:18px;background:var(--auth-panel,#fff);box-shadow:0 30px 70px #0d142059;overflow:hidden;animation:terms-rise .24s var(--ease)}
.terms-card-head{display:flex;align-items:center;gap:13px;flex-shrink:0;padding:17px 22px}
.terms-card-mark{flex-shrink:0;width:38px;height:38px;margin-top:1px;border-radius:11px;background:#183650;color:#f3f9fe;display:grid;place-items:center;font-size:16px;font-weight:800;letter-spacing:-.04em}
html.dark .terms-card-mark{background:#d7edff;color:#132c44}
.terms-card-headings{flex:1;min-width:0}
.terms-card-title{display:flex;align-items:flex-start;gap:12px}
.terms-card-title h2{flex:1;min-width:0;font-size:19px;font-weight:700;letter-spacing:-.6px;line-height:1.3;margin:0;color:var(--ink)}
.terms-card-intro{padding:16px 22px 15px;border-bottom:1px solid var(--auth-border)}
.terms-card-intro p{margin:0;font-size:12.5px;line-height:1.65;color:var(--muted-ink)}
.terms-card-intro p strong{color:var(--ink);font-weight:600;overflow-wrap:anywhere}
.terms-card-x{flex-shrink:0;display:grid;place-items:center;width:30px;height:30px;margin:-3px -3px 0 0;border:1px solid var(--auth-border);border-radius:8px;background:var(--auth-field);color:var(--muted-ink);font:600 12px Manrope,sans-serif;line-height:1;cursor:pointer;transition:color var(--quick) var(--ease),border-color var(--quick) var(--ease)}
.terms-card-x:hover{color:var(--ink);border-color:#7ca8d2}
.terms-card-x:active{background:#dfe9f2;border-color:#7ca8d2}
html.dark .terms-card-x:active{background:#22384e}
.terms-card-chips{display:flex;flex-wrap:wrap;gap:7px;margin:12px 0 0}
.terms-chip{padding:5px 9px;border:1px solid var(--auth-border);border-radius:7px;background:var(--auth-field);font-size:10px;font-weight:700;letter-spacing:.04em;color:var(--muted-ink)}
.terms-chip.is-now{border-color:#7ca8d2;background:#83b5e51f;color:#2f5f88}
html.dark .terms-chip.is-now{color:#a9d4ee}
.terms-card-scroll{flex:1;min-height:clamp(64px,15vh,110px);overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:color-mix(in srgb,var(--muted-ink) 55%,transparent) transparent;border-top:1px solid var(--auth-border);background:var(--auth-panel)}
/* Windows Chrome paints the thin-scrollbar track from scrollbar-color as a solid column, which
   reads as a grey bar down the side of the dark card — pin both parts explicitly. */
.terms-card-scroll::-webkit-scrollbar{width:10px}
.terms-card-scroll::-webkit-scrollbar-track{background:transparent}
.terms-card-scroll::-webkit-scrollbar-thumb{border:3px solid transparent;border-radius:8px;background:color-mix(in srgb,var(--muted-ink) 55%,transparent);background-clip:padding-box}
.terms-card-scroll::-webkit-scrollbar-thumb:hover{background:color-mix(in srgb,var(--muted-ink) 80%,transparent);background-clip:padding-box}
.terms-card-scroll .terms-sec{display:block;gap:0;margin:0;padding:17px 22px;border-top:1px solid var(--auth-border);scroll-margin:0}
.terms-card-intro+.terms-sec{border-top:0}
.terms-card-scroll .terms-sec h2{display:flex;align-items:baseline;gap:9px;font-size:13px;letter-spacing:-.1px;margin:0 0 7px}
.terms-card-scroll .terms-sec h2 span{display:inline;margin:0;font-size:10px;letter-spacing:1.1px}
.terms-card-scroll .terms-sec-body p,.terms-card-scroll .terms-sec-body li{font-size:12.5px;line-height:1.7;margin:0 0 8px;opacity:1;color:var(--ink)}
.terms-card-scroll .terms-sec-body p:last-child,.terms-card-scroll .terms-sec-body li:last-child{margin:0}
.terms-card-scroll .terms-sec-body ul{margin:2px 0 0}
.terms-card-scroll .terms-sec-body li:before{top:.62em;background:var(--surface)}
html.dark .terms-card-scroll .terms-sec-body li:before{background:#5c86a8}
.terms-card-end{flex-shrink:0;padding:15px 22px;font-size:10.5px;font-weight:700;letter-spacing:1.2px;color:var(--muted-ink);border-top:1px solid var(--auth-border);background:var(--auth-field)}
.terms-check{display:flex;align-items:flex-start;gap:11px;flex-shrink:0;padding:15px 22px;margin:0;border-top:1px solid var(--auth-border);background:var(--auth-field);font-size:12.5px;font-weight:600;line-height:1.55;color:var(--ink);cursor:pointer}
.terms-check input{appearance:none;-webkit-appearance:none;flex-shrink:0;width:20px;height:20px;min-height:0;margin:1px 0 0;padding:0;border:1px solid var(--auth-border);border-radius:6px;background:var(--auth-panel);cursor:pointer;transition:background var(--quick) var(--ease),border-color var(--quick) var(--ease)}
.terms-check input:hover{border-color:#7ca8d2}
.terms-check input:checked{background:#183650;border-color:#183650}
.terms-check input:checked:after{content:"✓";display:block;text-align:center;font-size:13px;font-weight:800;line-height:18px;color:#f3f9fe}
html.dark .terms-check input:checked{background:#d7edff;border-color:#d7edff}
html.dark .terms-check input:checked:after{color:#132c44}
.terms-check input:disabled{opacity:.5;cursor:not-allowed}
.terms-check input:focus-visible{outline:3px solid #83b5e5;outline-offset:2px}
.terms-check small{display:block;margin-top:3px;font-size:11px;font-weight:500;line-height:1.55;color:var(--muted-ink)}
.terms-check a{color:#2f5f88;text-decoration:underline;text-underline-offset:3px}
html.dark .terms-check a{color:#a9d4ee}
.terms-card-actions{display:flex;align-items:center;justify-content:flex-end;gap:10px;flex-shrink:0;padding:16px 22px;border-top:1px solid var(--auth-border);background:var(--auth-panel)}
.terms-card-note{margin-right:auto;font-size:10.5px;line-height:1.5;color:var(--muted-ink)}
.terms-btn{flex-shrink:0;min-height:46px;padding:0 19px;border-radius:10px;font:700 12.5px Manrope,sans-serif;cursor:pointer;transition:background var(--quick) var(--ease),transform var(--quick) var(--ease),border-color var(--quick) var(--ease)}
.terms-btn.is-ghost{border:1px solid var(--auth-border);background:transparent;color:var(--ink)}
.terms-btn.is-ghost:hover{background:var(--auth-field);border-color:#7ca8d2}
.terms-btn.is-ghost:active{background:#dfe9f2}
html.dark .terms-btn.is-ghost:active{background:#22384e}
.terms-btn.is-accept{border:1px solid #183650;background:#183650;color:#f3f9fe}
.terms-btn.is-accept:hover{background:#244c6d;border-color:#244c6d;transform:translateY(-1px)}
.terms-btn.is-accept:active{background:#12293d;border-color:#12293d;transform:translateY(0)}
.terms-btn.is-accept:disabled{background:var(--auth-field);border-color:var(--auth-border);color:var(--muted-ink);opacity:1;transform:none;cursor:not-allowed}
html.dark .terms-btn.is-accept{background:#d7edff;border-color:#d7edff;color:#132c44}
html.dark .terms-btn.is-accept:hover{background:#eaf6ff;border-color:#eaf6ff}
html.dark .terms-btn.is-accept:active{background:#b9dcf5;border-color:#b9dcf5}
html.dark .terms-btn.is-accept:disabled{background:#16283b;border-color:#2d4053;color:#6f8ba1}
.terms-btn:focus-visible{outline:3px solid #83b5e5;outline-offset:3px}
/* ---------- checkout variant ---------- */
/* The payment and invoice pages are the graphite console, not the navy sign-up screen, so the same
   card is re-skinned with the tokens the cancel-invoice dialog beside it uses. Every rule above is
   written against five variables, so handing those variables to the console palette re-skins the
   body of the card in one line; only the hand-picked accents below still need restating. */
.terms-gate.is-console{--auth-panel:var(--raised);--auth-field:var(--panel);--auth-border:var(--line);--ink:var(--text);--muted-ink:var(--muted);--surface:var(--accent)}
.terms-gate.is-console:before{background:#0b0b0ea6}
html[data-theme=light] .terms-gate.is-console:before{background:#14141873}
.terms-gate.is-console .terms-card{border-color:var(--line);box-shadow:0 30px 70px #000000c4;font-family:inherit}
html[data-theme=light] .terms-gate.is-console .terms-card{box-shadow:0 30px 70px #14141840}
.terms-gate.is-console .terms-card-mark{background:var(--text);color:var(--bg)}
.terms-gate.is-console .terms-card-x:hover{border-color:var(--accent);color:var(--accent)}
.terms-gate.is-console .terms-card-x:active{background:var(--hover);border-color:var(--accent);color:var(--accent)}
.terms-gate.is-console .terms-chip.is-now{border-color:color-mix(in srgb,var(--accent) 45%,transparent);background:color-mix(in srgb,var(--accent) 13%,transparent);color:var(--accent)}
.terms-gate.is-console .terms-card-scroll .terms-sec-body li:before{background:var(--accent)}
.terms-gate.is-console .terms-check input:hover{border-color:var(--faint)}
.terms-gate.is-console .terms-check input:checked{background:var(--accent);border-color:var(--accent)}
.terms-gate.is-console .terms-check input:checked:after{color:var(--bg)}
.terms-gate.is-console .terms-check input:focus-visible,.terms-gate.is-console .terms-btn:focus-visible{outline-color:var(--accent)}
.terms-gate.is-console .terms-check a{color:var(--accent)}
.terms-gate.is-console .terms-btn{font-family:inherit}
.terms-gate.is-console .terms-btn.is-ghost:hover{background:var(--hover);border-color:var(--faint)}
.terms-gate.is-console .terms-btn.is-ghost:active{background:var(--panel);border-color:var(--faint)}
.terms-gate.is-console .terms-btn.is-accept{border-color:var(--button);background:var(--button);color:var(--button-text)}
.terms-gate.is-console .terms-btn.is-accept:hover{border-color:var(--button);background:var(--button);opacity:.88}
.terms-gate.is-console .terms-btn.is-accept:active{border-color:var(--button);background:var(--button);opacity:.78;transform:none}
.terms-gate.is-console .terms-btn.is-accept:disabled{background:var(--hover);border-color:var(--line);color:var(--faint)}
/* The agreement row above sits on the field tint; giving the action bar the same tint makes the
   two fixed bands read as one base under the scrolling clauses. */
.terms-gate.is-console .terms-card-actions{background:var(--panel)}
@media(max-width:700px){
  .terms-gate{padding:14px}
  .terms-card{max-height:calc(100dvh - 28px);border-radius:16px}
  .terms-card-head{padding:15px 16px;gap:11px}
  .terms-card-mark{width:34px;height:34px;font-size:15px}
  .terms-card-title h2{font-size:17px}
  .terms-card-intro,.terms-card-scroll .terms-sec,.terms-check,.terms-card-actions,.terms-card-end{padding-inline:16px}
  /* The meta chips wrap onto a second row at phone width and push the first clause out of view;
     the version chip alone identifies what is being accepted. */
  .terms-card-chips .terms-chip:not(.is-now){display:none}
  /* Stacked in reading order: reassurance line, then the way out, then the way in — the accept
     button lands under the thumb instead of floating above the fold. */
  .terms-card-actions{flex-direction:column;align-items:stretch;gap:9px}
  .terms-card-note{margin:0 0 3px}
  .terms-btn{width:100%}
}
/* The header, checkbox and actions never shrink, so a very short window squeezes the clause list down
   to its floor and starts clipping the accept button. Tighten the chrome instead of hiding it. */
@media(max-height:520px){
  .terms-gate{padding:10px}
  .terms-card{max-height:calc(100dvh - 20px)}
  .terms-card-head{padding-block:11px}
  .terms-card-scroll{min-height:44px}
  .terms-check{padding-block:11px}
  .terms-card-actions{padding-block:11px;gap:8px}
  .terms-btn{min-height:42px}
}
@keyframes terms-rise{from{opacity:0;transform:translateY(14px)}to{opacity:1;transform:none}}
@media(prefers-reduced-motion:reduce){.terms-card{animation:none}.terms-btn{transition:none}}
