/* Sign in, sign up and the account pages as one surface: .au is the stage band beside the form, .au-page a status page
   with its dark head. Nothing floats: parts are split by lines, notes are strips of the page. */

/* ---------- The halves ---------- */
.au {
  display: grid; min-height: 100vh; background: var(--panel);
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  grid-template-areas: "aside main";
  /* Both halves start on one line, set so the content sits in the middle of a common screen height. */
  --au-top: max(52px, calc((100vh - 760px) / 2));
}
/* The band: the app's dark page header, standing up beside the form. */
.au-aside {
  --ax: clamp(28px, 4.2vw, 72px);
  --stage-line: color-mix(in srgb, var(--stage-ink) 14%, transparent);
  grid-area: aside; position: sticky; top: 0; align-self: start; height: 100vh;
  display: flex; flex-direction: column; overflow: hidden; isolation: isolate;
  background: var(--stage-bg); color: var(--stage-ink);
}
.au-aside::before, .au-aside::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.au-aside::before {
  opacity: .8;
  background: radial-gradient(75% 55% at 100% 0%, var(--stage-glow-1), transparent 62%), radial-gradient(60% 50% at 0% 100%, var(--stage-glow-2), transparent 70%);
}
.au-aside::after { background-image: radial-gradient(var(--stage-dot) 1px, transparent 1px); background-size: 18px 18px; mask-image: var(--fade-right); }

/* It starts on the same line as the form's title, so the two headings sit side by side. */
.au-aside-body { display: grid; gap: 30px; width: 100%; max-width: calc(760px + 2 * var(--ax)); margin-inline: auto; padding: var(--au-top, 52px) var(--ax) 40px; }
.au-aside h2 { max-width: 20ch; margin: 0 0 12px; font-size: 34px; line-height: 1.1; letter-spacing: var(--tr-tight); color: var(--stage-ink); }
.au-lede { max-width: 46ch; margin: 0; font-size: var(--fs-l); line-height: 1.65; color: var(--stage-muted); }

/* What an AI agent app install offers, three short lines that settle one after another. */
.au-points { display: grid; gap: 12px; max-width: 46ch; margin: 0; padding: 0; list-style: none; }
.au-points li { display: flex; align-items: center; gap: 12px; font-size: var(--fs-m); color: var(--stage-ink); animation: au-rise .5s var(--ease) both; }
.au-points li:nth-child(2) { animation-delay: .1s; }
.au-points li:nth-child(3) { animation-delay: .2s; }
.au-points svg { flex: none; width: 32px; height: 32px; padding: 7px; border-radius: var(--r-m); background: var(--stage-fill); color: var(--stage-flow); }

/* The tour, set in the band like a picture in a page. */
.au-demo-head b { display: block; font-size: var(--fs-l); font-weight: 600; color: var(--stage-ink); }
.au-demo-head > span:last-child { display: block; margin-top: 2px; font-size: var(--fs-s); line-height: 1.5; color: var(--stage-muted); }
.au-demo-pill {
  display: inline-flex; align-items: center; gap: 6px; margin-bottom: 8px; padding: 3px 10px;
  border-radius: var(--r-full); background: var(--stage-fill); color: var(--stage-flow);
  font-size: var(--fs-2xs); font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
}
.au-demo-pill svg { width: 11px; height: 11px; }
.au-demo-head { margin-bottom: 12px; }

/* The form half: one column of content, its lines running from the band to the window's edge. */
.au-main, .au-page { container: page / inline-size; }
.au-main {
  --au-gutter: 32px;
  --pad-x: max(var(--au-gutter), calc((100% - 468px) / 2));
  grid-area: main; position: relative; display: flex; flex-direction: column; min-width: 0; background: var(--panel);
}
/* The form sits in the middle of its half; the legal line stays at the bottom. */
.au-main:not(:has(> .au-form)) > .au-head { margin-top: auto; }
/* Light or dark: beside the title of a form, in its column's top right corner, or in the corner of a status page. A form
   that carries its own leaves the half's corner empty. */
.icon-btn.au-theme { position: absolute; top: 16px; right: 16px; z-index: 2; }
.au-main:has(.au-head > .au-theme) > .au-theme { display: none; }
.au-head { position: relative; }
.au-head > .icon-btn.au-theme { top: var(--au-top, 52px); right: var(--pad-x); }
.au-head:has(> .au-theme) h1 { padding-right: 48px; }
/* The lines between the form's parts stop at its column, like the form itself. */
.au-head, .au-zone { background: linear-gradient(var(--line), var(--line)) bottom center / calc(100% - 2 * var(--pad-x)) 1px no-repeat; }
.au-head { padding: var(--au-top, 52px) var(--pad-x) 26px; }
.au-head h1 { margin: 0; font-size: 30px; line-height: 1.15; letter-spacing: var(--tr-tight); }
.au-sub { margin: 8px 0 0; font-size: var(--fs-l); line-height: 1.5; color: var(--ink-4); }
/* The other way in sits right under the title, on sign in and on sign up alike. */
.au-switch { margin: 12px 0 0; font-size: var(--fs-m); color: var(--ink-4); }
.au-switch a { font-weight: 600; }
.au-switch a:hover { text-decoration: underline; }

.au-zone { padding: 24px var(--pad-x) 26px; }
/* The line between two zones replaces the divider; its words stay as the zone's label. */
.au-label { display: block; margin: 0 0 16px; font-size: var(--fs-2xs); font-weight: 600; letter-spacing: var(--tr-caps); text-transform: uppercase; color: var(--ink-4); }
.au-zone .authform > :last-child { margin-bottom: 0; }
.au-zone .authform > .btn:not(.block) { align-self: flex-start; }
.au-zone .check { margin-top: 2px; }

.au-providers { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.au-providers .btn { min-height: var(--h-lg); gap: 10px; font-size: var(--fs-m); font-weight: 500; }
.au .provider-logo { flex: none; width: 18px; height: 18px; }

/* A form that ends in the page's action bar spans the zones and the bar, so the bar can sit at the bottom. */
.au-form { display: contents; }

/* A note is a strip of the page: one sentence per line. */
.au-lines { display: grid; gap: 2px; line-height: 1.5; }

/* The fields of a form; the remember and forgot line sits between the password and the button. */
.authform { display: flex; flex-direction: column; }
.authform .field { margin-bottom: 18px; }
.authform .field > label { margin-bottom: 8px; font-size: var(--fs-m); font-weight: 500; }
.authform .req { color: inherit; font-weight: 500; }
.authform .input { min-height: var(--h-lg); padding: 10px 14px; border-radius: var(--r-m); font-size: var(--fs-m); }
.authform .pw-field .input { padding-right: 46px; }
.authform-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 2px 0 24px; }
.authform-row a { font-size: var(--fs-m); color: var(--ink); }
.authform-row a:hover { color: var(--brand-text); }
.authform .btn.primary.block { min-height: var(--h-lg); font-size: var(--fs-m); }

/* Where the bot check renders on sign up and on a forgotten password. */
.au-captcha { min-height: 65px; margin: 2px 0 20px; }

.authform > .note { margin-bottom: 18px; }
.authform-foot { margin: 24px 0 0; text-align: center; font-size: var(--fs-m); color: var(--ink-4); }
.authform-foot a { color: var(--ink); font-weight: 500; }
.authform-foot a:hover { color: var(--brand-text); }

/* The last line of both frames. */
.au-legal {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px;
  margin-top: auto; padding: 16px var(--pad-x); font-size: var(--fs-xs); color: var(--ink-4);
}
.au-legal .links { display: flex; gap: 16px; }
.au-legal a { color: var(--ink-3); }
.au-legal a:hover { color: var(--ink); }
.actionbar + .au-legal, .au-form + .au-legal { margin-top: 0; }

/* ---------- A status page ---------- */
.au-page {
  --au-gutter: 32px;
  --pad-x: max(var(--au-gutter), calc((100% - 940px) / 2));
  position: relative; display: flex; flex-direction: column; min-height: 100vh; background: var(--panel); color: var(--ink);
}
.au-content { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.au-page .phead { padding-top: 36px; padding-bottom: 36px; }
.au-page .phead-lead { line-height: 1.6; }
.phead-ic.au-ok { --rtc: var(--ok); }
.phead-ic.au-warn { --rtc: var(--warn); }
.phead-ic.au-info { --rtc: var(--brand); }
.au-code { flex: none; min-width: 46px; font-family: var(--mono); font-size: 56px; line-height: .95; font-weight: 600; letter-spacing: -.04em; color: var(--stage-flow); }
.au-page .zone-note { padding-top: 18px; }
/* What to do next: the notes as a short list, a little stronger than a footnote. */
.au-next .zone-note { padding-bottom: 0; font-size: var(--fs-s); color: var(--ink-3); }
.au-next .zone-note + .zone-note { padding-top: 10px; }
.au-next .zone-note:last-child { padding-bottom: 22px; }
.au-next .zone-note svg { color: var(--brand-text); }
.au-ref { font-size: var(--fs-m); color: var(--ink); overflow-wrap: anywhere; }

/* ---------- Allowing an assistant: who asks, what it gets, what you allow ---------- */
.au-join { display: inline-flex; align-items: center; margin-bottom: 16px; }
.au-tile { display: grid; place-items: center; flex: none; width: 52px; height: 52px; border-radius: 14px; background: var(--paper); color: var(--brand); }
.au-tile > img { width: 30px; height: 30px; object-fit: contain; }
.au-tile > svg { width: 24px; height: 24px; }
.au-join-line { position: relative; width: 64px; height: 2px; background: repeating-linear-gradient(90deg, var(--stage-flow) 0 6px, transparent 6px 11px); }
.au-join-line > span {
  position: absolute; left: 50%; top: 50%; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  transform: translate(-50%, -50%); background: var(--stage-bg); box-shadow: inset 0 0 0 1px var(--stage-flow); color: var(--stage-ink);
}
.au-join-line > span svg { width: 13px; height: 13px; }
.au-badges { min-width: 0; }
.au-badges .ph-badge { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }

.au-list { --rl-cols: 30px minmax(0, 1fr); }
.au-list .rl-row { min-height: 52px; padding-top: 12px; padding-bottom: 12px; }
.au-list .rl-row:hover { background: none; }
.au-list .rl-name b, .au-list .rl-row:hover .rl-name b { white-space: normal; font-weight: 500; font-size: var(--fs-s); line-height: 1.5; color: var(--ink); }
.au-mark { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; }
.au-mark svg { width: 14px; height: 14px; }
.au-mark.yes { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.au-mark.no { background: color-mix(in srgb, var(--bad) 10%, var(--bad-base)); color: var(--bad); }
.au-halves .zone-body { padding-top: 6px; padding-bottom: 8px; }

/* A switch with a longer explanation: the words take the width, the switch keeps to the right edge. */
.au-switchrows .frow.act { grid-template-columns: minmax(0, 620px) auto; justify-content: space-between; }
.au-goal textarea { width: 100%; min-height: 84px; resize: vertical; }

@keyframes au-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .au-points li { animation: none; }
}

/* ---------- Narrower windows ---------- */
@media (max-width: 1080px) {
  .au-aside h2 { font-size: 28px; }
}

/* On a phone the band comes first, like a page's dark header, and the form follows. */
@media (max-width: 860px) {
  .au {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "aside" "main";
  }
  .au-aside { --ax: 20px; position: relative; height: auto; }
  .au-demo-block { display: none; }
  .au-aside-body { gap: 14px; margin: 0; padding: 22px var(--ax) 24px; }
  .au-aside h2 { max-width: none; margin-bottom: 6px; font-size: 22px; }
  .au-lede { font-size: var(--fs-s); line-height: 1.55; }
  .au-points { gap: 8px; }
  .au-points li { font-size: var(--fs-s); }
  .au-points svg { width: 26px; height: 26px; padding: 5px; }
  .au-main, .au-page { --au-gutter: 20px; }
  .au-head { padding-top: 28px; }
  .au-head > .icon-btn.au-theme { top: 26px; }
  .au-head h1 { font-size: 26px; }
  .au-page .phead { padding-top: 24px; padding-bottom: 26px; }
}

@container page (max-width: 640px) {
  .au-switchrows .frow.act { grid-template-columns: minmax(0, 1fr) auto; }
}

@container page (max-width: 520px) {
  .au .otp { justify-content: space-between; }
  .au-legal { justify-content: flex-start; }
  .au-code { font-size: 44px; }
  .au .actionbar .btn, .au-page .actionbar .btn { padding-inline: 14px; }
}
