/* Account (/account/) and the agent consent page (/oauth/consent/): both load this file. Panels, fields, buttons, badges and notices are site.css;
   this is layout, the sign-in card, the code box, the switch, the agent list and the consent card. No scripts depend on a class here: the pages' scripts
   (account.js, connect.js) find everything by id. */

.acct { max-width: calc(960px + 2 * var(--gutter)); }
.acct .eyebrow { margin-bottom: var(--space-3); }
.acct > h1 { margin-bottom: var(--space-5); }

/* A message from the script (saved, closed, an error from the server) stays in view while the page is long */
#msg { position: sticky; top: calc(var(--hdr-h) + 12px); z-index: 20; margin: 0 0 var(--space-4); background: linear-gradient(90deg, rgba(251, 191, 36, .12), rgba(251, 191, 36, .04)), var(--bg-2); box-shadow: 0 14px 32px -14px rgba(0, 0, 0, .8); }

/* ---- Sign in (both pages) ---- */
.auth { max-width: 520px; }
.auth .strap { margin: 0 0 var(--space-5); font-size: 1.0625rem; color: var(--text-2); }
.auth form { --stack: var(--space-4); }
.auth .field { max-width: none; margin: 0; }
.auth .btns, .acct-sec .btns { margin: 0; }
.auth > .error { margin-bottom: 0; }
.auth #sentto { margin: 0; padding: 12px 14px; border-radius: var(--r-sm); border: 1px solid rgba(125, 211, 252, .25); background: rgba(125, 211, 252, .06); color: var(--text); font-size: .9375rem; }
/* The six-digit code: one big mono box */
#code { height: 68px; padding-inline: 12px; font: 500 2rem/1 var(--font-mono); letter-spacing: .5em; text-indent: .5em; text-align: center; caret-color: var(--signal); }
#code::placeholder { letter-spacing: normal; }
.consent .auth + .auth, .consent .auth + .ask { margin-top: 0; }

/* ---- Account ---- */
.acct-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); margin: 0 0 var(--space-5); padding: 12px var(--space-5); }
.acct-bar p { margin: 0; }
.acct-bar #who { color: var(--text); font-family: var(--font-mono); font-weight: 500; overflow-wrap: anywhere; }
.acct #ready { margin-bottom: var(--space-5); }
.acct-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-5); align-items: start; }
@media (max-width: 800px) { .acct-grid { grid-template-columns: minmax(0, 1fr); } }
.acct-sec { min-width: 0; }
.acct-sec > h2, .acct-sec > h3 { margin: 0 0 var(--space-4); font-size: 1.25rem; line-height: 1.25; letter-spacing: -.02em; }
.acct-sec p { overflow-wrap: anywhere; }
.acct-address { grid-row: span 2; }
@media (max-width: 800px) { .acct-address { grid-row: auto; } }
.acct-close { grid-column: 1 / -1; border-color: rgba(248, 113, 113, .22); }
.acct-close p:last-child { margin-bottom: 0; }

/* Forms inside panels */
.fgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); }
.fgrid > .full { grid-column: 1 / -1; }
.fgrid .field { max-width: none; margin: 0; }
.fgrid > .error { margin: 0; }
@media (max-width: 480px) { .fgrid { grid-template-columns: minmax(0, 1fr); } .agents > li { flex-wrap: wrap; } .agents > li > .sm-btn { margin-left: 0; } }
.acct-sec form.stack { --stack: var(--space-4); }
.acct-sec form.stack > .error { margin: 0; }
.acct-sec .field { max-width: none; }

/* Card on file */
.acct-sec .cardline { display: flex; align-items: center; gap: 14px; margin: 0 0 var(--space-4); padding: 14px 16px; border-radius: var(--r-sm); border: 1px solid var(--line); background: rgba(5, 8, 15, .5); color: var(--text); font: 500 .9375rem/1.4 var(--font-mono); }
.cardline::before {
  content: ""; flex: none; width: 40px; height: 28px; border-radius: 5px; border: 1px solid var(--line-strong);
  background: linear-gradient(#e6bf56, #b48a2c) 7px 7px / 9px 7px no-repeat, linear-gradient(135deg, #2a3856, #111a2e);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14);
}

/* The agents-pay switch */
.switch { display: flex; align-items: center; gap: 14px; min-height: 44px; color: var(--text); font-weight: 500; cursor: pointer; }
.switch > input[type="checkbox"]:first-child {
  -webkit-appearance: none; appearance: none; position: relative; flex: none; display: block; width: 46px; height: 26px; margin: 0; border-radius: var(--r-pill);
  background: rgba(255, 255, 255, .08); border: 1px solid var(--line-strong); transition: background-color var(--dur-2), border-color var(--dur-2), box-shadow var(--dur-2);
}
.switch > input[type="checkbox"]::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--text-2); transition: transform var(--dur-2) var(--ease), background-color var(--dur-2); }
.switch > input[type="checkbox"]:checked { background: rgba(255, 107, 26, .22); border-color: rgba(255, 107, 26, .6); box-shadow: 0 0 16px -4px var(--glow); }
.switch > input[type="checkbox"]:checked::after { transform: translateX(20px); background: var(--signal-hi); }
.switch > input[type="checkbox"]:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; }
#apnote { margin: 0; }

/* The authorisation sentence the holder ticks */
.acct-sec #consentrow { margin: 0; color: var(--text); }
#consentrow .terms { margin: 0; color: var(--text); font-size: .9375rem; line-height: 1.55; }

/* Connected agents */
.agents { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
.agents > li { position: relative; display: flex; align-items: center; gap: var(--space-3); padding: 14px 16px 14px 40px; border-radius: var(--r-sm); border: 1px solid var(--line); background: rgba(5, 8, 15, .45); color: var(--text); line-height: 1.5; overflow-wrap: anywhere; }
.agents > li::before { content: ""; position: absolute; left: 16px; top: 22px; width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 10px var(--good); }
.agents > li > .sm-btn { margin-left: auto; flex: none; }
.acct-sec p.empty { margin: 0; padding: 20px 16px; text-align: center; border-radius: var(--r-sm); border: 1px dashed var(--line-strong); }
.agents:not(:empty) + p.empty { display: none; }

/* Saved designs (designs.js): the full width of the grid; each row is the file's name (a link to price it again), its size and dates, and Delete */
.acct-designs { grid-column: 1 / -1; }
.acct-designs > .helper { margin: 0 0 var(--space-4); }
.designs { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
.designs:empty { display: none; }
.designs > li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--space-3); padding: 12px 16px; border-radius: var(--r-sm); border: 1px solid var(--line); background: rgba(5, 8, 15, .45); color: var(--text-2); font: 400 .875rem/1.5 var(--font-mono); overflow-wrap: anywhere; }
.designs > li > a { font: 500 1rem/1.4 var(--font-body); color: var(--text); }
.designs > li > a:hover { color: var(--ice); }
.designs > li > .sm-btn { margin-left: auto; flex: none; color: var(--bad); border-color: rgba(248, 113, 113, .4); }
.designs > li > .sm-btn:hover:not(:disabled) { color: var(--bad); background: rgba(248, 113, 113, .1); border-color: rgba(248, 113, 113, .65); }
.acct-designs > p.error { margin: var(--space-3) 0 0; }
@media (max-width: 480px) { .designs > li > .sm-btn { margin-left: 0; } }

/* Connect an agent (instructions) */
.acct-sec .copyrow { display: flex; align-items: center; gap: var(--space-3); margin: 0 0 var(--space-4); padding: 8px 8px 8px 14px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: rgba(5, 8, 15, .6); }
.copyrow code { flex: 1; min-width: 0; padding: 0; border: 0; background: none; color: var(--ice); font-size: .9375rem; }
.howto { list-style: none; margin: 0 0 var(--space-4); padding: 0; display: grid; gap: var(--space-3); }
.howto li { position: relative; padding-left: 22px; color: var(--text-2); line-height: 1.55; overflow-wrap: anywhere; }
.howto li::before { content: ""; position: absolute; left: 2px; top: .8em; width: 10px; height: 1px; background: var(--signal); }
.howto b { color: var(--text); font-weight: 600; }

/* Destructive buttons: still glass, with a red edge */
.sm-btn.danger { color: var(--bad); border-color: rgba(248, 113, 113, .4); }
.sm-btn.danger:hover:not(:disabled), .agents > li > .sm-btn:hover:not(:disabled) { color: var(--bad); background: rgba(248, 113, 113, .1); border-color: rgba(248, 113, 113, .65); }
.agents > li > .sm-btn { color: var(--bad); border-color: rgba(248, 113, 113, .4); }

/* ---- Consent card ---- */
.ask { max-width: 640px; padding: clamp(22px, 4vw, 36px); }
.ask > * { max-width: 100%; }
.ask-k { display: flex; align-items: center; gap: 10px; margin: 0 0 var(--space-5); color: var(--signal-hi); }
.ask-k::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 0 3px rgba(255, 107, 26, .18), 0 0 12px var(--signal); animation: glowpulse 2s var(--ease) infinite; }
.ask .ask-lead { margin: 0 0 var(--space-6); font-size: 1.0625rem; line-height: 1.5; color: var(--text-2); overflow-wrap: anywhere; }
.ask #client { display: block; margin-bottom: var(--space-2); color: var(--text); font: 600 clamp(1.5rem, 1.05rem + 2.4vw, 2.5rem)/1.12 var(--font-head); letter-spacing: -.035em; text-wrap: balance; }
.ask #who { color: var(--text); font-family: var(--font-mono); font-size: .9em; font-weight: 500; }
.ask .ask-can { margin: 0 0 var(--space-3); color: var(--text-3); }
#scopes { list-style: none; margin: 0 0 var(--space-5); padding: 0; border-top: 1px solid var(--line); }
#scopes li { position: relative; padding: 14px 0 14px 28px; border-bottom: 1px solid var(--line); color: var(--text); line-height: 1.5; overflow-wrap: anywhere; }
#scopes li::before { content: ""; position: absolute; left: 3px; top: 22px; width: 7px; height: 7px; background: var(--signal); box-shadow: 0 0 10px var(--glow); }
.ask #pay { margin: 0 0 var(--space-4); color: var(--text); }
.ask .dest { position: relative; margin: 0 0 var(--space-6); padding: 14px 16px 14px 58px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: rgba(5, 8, 15, .5); color: var(--text-2); line-height: 1.55; overflow-wrap: anywhere; }
.dest::before { content: "\2192"; position: absolute; left: 14px; top: 14px; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; border: 1px solid rgba(255, 107, 26, .35); background: rgba(255, 107, 26, .1); color: var(--signal-hi); font: 500 1.0625rem/1 var(--font-mono); }
.dest #host { color: var(--signal-hi); font-family: var(--font-mono); font-size: 1.0625em; font-weight: 500; }
.ask .ask-actions { margin: 0; }
.ask-actions .btn, .ask-actions .btn-ghost { min-width: 160px; }
.btn-ghost:disabled { cursor: not-allowed; transform: none; color: var(--text-3); background: var(--surface); border-color: var(--line); box-shadow: none; }
@media (max-width: 480px) { .ask-actions .btn, .ask-actions .btn-ghost { min-width: 0; } }
