/* AyeLoop portal (Plane). The marketing site's look: its tokens, header,
   buttons, cards and funnel form styles (ayeloop-site site.css), plus rules
   for the portal's plain markup (pages.go and the other page builders emit
   bare h1/p/label/input/button, so every page picks this up without a class).
   Fonts are served by Plane itself (CSP font-src 'self'; OFL licences in
   assets/fonts/). */

@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url(/assets/fonts/ibm-plex-sans-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url(/assets/fonts/ibm-plex-sans-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url(/assets/fonts/ibm-plex-sans-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: Syne; font-style: normal; font-weight: 600; font-display: swap; src: url(/assets/fonts/syne-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: Syne; font-style: normal; font-weight: 700; font-display: swap; src: url(/assets/fonts/syne-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: Syne; font-style: normal; font-weight: 800; font-display: swap; src: url(/assets/fonts/syne-latin-800-normal.woff2) format("woff2"); }

:root {
  --ink: #0b1220;
  --ink-2: #121a2b;
  --line: rgba(255,255,255,.08);
  --teal: #2ec4b6;
  --teal-dim: #1a8f86;
  --gold: #d4a017;
  --paper: #f4f1ea;
  --muted: #8b9aab;
  --white: #eef3f6;
  --danger: #e07a7a;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  background: var(--ink);
  color: var(--white);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: inherit; }
img { max-width: 100%; }
.wrap { width: min(1120px, calc(100% - 40px)); margin: 0 auto; }
.wrap-narrow { width: min(760px, calc(100% - 40px)); margin: 0 auto; }

/* Header, as on the site. */
header {
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(14px);
  background: rgba(11,18,32,.78);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { width: 46px; height: 46px; object-fit: contain; display: block; }
.word { font-family: Syne, sans-serif; font-weight: 700; letter-spacing: -.03em; font-size: 1.15rem; }
.aye { color: #D4A017; }
.loop { color: #2EC4B6; }
.nav-right { display: flex; gap: 10px; align-items: center; }
.nav-login { color: var(--muted); font-size: .92rem; text-decoration: none; padding: 0 6px; }
.nav-login:hover { color: var(--white); }

/* Buttons. */
.btn,
.panel button,
.panel input[type="submit"] {
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 999px; padding: 12px 18px;
  font: 600 .95rem/1 "IBM Plex Sans", sans-serif;
  text-decoration: none; cursor: pointer;
  background: var(--teal); color: var(--ink);
}
.panel button:hover, .btn-teal:hover { background: #3ad3c5; }
.btn-ghost,
.panel form[action="/logout"] button,
.panel form[action="/billing/portal"] button,
.panel button.secondary {
  background: transparent; color: var(--white); border: 1px solid var(--line);
}
.btn-ghost:hover,
.panel form[action="/logout"] button:hover,
.panel form[action="/billing/portal"] button:hover { border-color: var(--muted); background: transparent; }
.panel button:disabled { opacity: .42; cursor: not-allowed; }

/* Page body: one card in the site's funnel layout. */
main.funnel { flex: 1; padding: 40px 0 72px; }
.panel {
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 32px;
}
.panel h1 {
  font-family: Syne, sans-serif;
  font-size: clamp(1.8rem, 3.6vw, 2.6rem);
  line-height: 1.05;
  letter-spacing: -.04em;
  margin-bottom: 16px;
}
.panel h2, .panel h3 { font-family: Syne, sans-serif; letter-spacing: -.02em; margin: 24px 0 8px; }
.panel p { margin: 12px 0; }
.panel a { color: var(--teal); }
.panel a.btn { color: var(--ink); }
.panel a.btn-ghost { color: var(--white); }
.panel strong { color: var(--paper); }
.panel ul, .panel ol { margin: 12px 0 12px 20px; color: var(--muted); }
.panel li { margin: 4px 0; }
.panel hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
.panel code, .panel pre, .panel kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--paper);
}
.panel code, .panel kbd { padding: 2px 7px; font-size: .9em; }
.panel pre { padding: 14px 16px; overflow-x: auto; white-space: pre-wrap; word-break: break-all; }
.panel table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: .95rem; }
.panel th, .panel td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.panel th { color: var(--muted); font-weight: 500; }
.panel img { display: block; border-radius: 12px; background: #fff; padding: 10px; margin: 12px 0; }

/* Forms: the site's .field look for the portal's plain labels and inputs. */
.panel form { margin: 16px 0; }
.panel label { display: grid; gap: 6px; font-size: .92rem; font-weight: 500; }
.panel input:not([type="hidden"]):not([type="radio"]):not([type="checkbox"]):not([type="submit"]),
.panel select,
.panel textarea {
  width: 100%;
  background: var(--ink);
  border: 1px solid var(--line);
  color: var(--white);
  border-radius: 12px;
  padding: 12px 14px;
  font: 400 1rem/1.4 "IBM Plex Sans", system-ui, sans-serif;
}
.panel input:focus, .panel select:focus, .panel textarea:focus {
  outline: 2px solid var(--teal);
  outline-offset: 1px;
  border-color: var(--teal);
}
.panel input[type="radio"], .panel input[type="checkbox"] { accent-color: var(--teal); }

/* Messages. */
.error, .warning, .notice, .banner {
  margin: 16px 0;
  padding: 12px 16px;
  border-radius: 12px;
}
.error { color: #f3c4c4; background: rgba(224,122,122,.10); border: 1px solid rgba(224,122,122,.35); }
.warning, .banner { color: var(--paper); background: rgba(212,160,23,.12); border: 1px solid rgba(212,160,23,.35); }
.notice { color: var(--paper); background: rgba(46,196,182,.10); border: 1px solid rgba(46,196,182,.35); }
.muted, .note { color: var(--muted); font-size: .9rem; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 20px; }
.actions form { margin: 0; }

/* Plan choice (billing): the site's pricing cards as radio choices. */
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 20px 0; }
.plan-pick { display: block; cursor: pointer; height: 100%; position: relative; }
.plan-pick input {
  position: absolute; opacity: 0; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0);
}
.price {
  height: 100%;
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
}
.price span { display: block; }
.price .name { font-family: Syne, sans-serif; font-weight: 700; font-size: 1.1rem; }
.price .amt { font-family: Syne, sans-serif; font-size: 1.25rem; line-height: 1.2; margin: 8px 0; color: var(--white); }
.price .limits { color: var(--muted); font-size: .88rem; }
.plan-pick input:focus-visible + .price { outline: 2px solid var(--teal); outline-offset: 2px; }
.plan-pick input:checked + .price { outline: 1px solid var(--teal); border-color: var(--teal); background: #152033; }

/* TOTP enrolment (totpenroll.go, both portals): the steps, the QR code (black
   on white whatever the theme, quiet zone inside the SVG) and the collapsed
   manual key. */
.panel ol.totp-steps { color: var(--white); margin: 16px 0 16px 22px; }
.panel ol.totp-steps li { margin: 8px 0; }
.panel .totp-qr-box { margin: 20px 0; }
.panel svg.totp-qr {
  display: block; width: 232px; max-width: 100%; height: auto; aspect-ratio: 1;
  background: #fff; border-radius: 12px; forced-color-adjust: none;
}
.panel details.totp-manual { border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; margin: 16px 0; }
.panel details.totp-manual summary { cursor: pointer; color: var(--teal); font-weight: 500; list-style: revert; }
.panel details.totp-manual[open] summary { margin-bottom: 8px; }
.panel table.totp-details th { width: 96px; }
.panel table.totp-details td { overflow-wrap: anywhere; }
/* The key wraps only between its two halves (groupKeyHTML): one line, or two
   even lines of four blocks. */
.panel code.totp-key { display: inline-block; padding: 4px 10px; font-size: 1rem; line-height: 1.6; letter-spacing: .04em; word-spacing: .15em; }
.panel code.totp-key span { white-space: nowrap; }

/* Footer, as on the site. */
footer { border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--muted); font-size: .9rem; }
.foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--white); }

@media (max-width: 720px) {
  .plans { grid-template-columns: 1fr; }
  .panel { padding: 22px; }
  /* Phone width: each detail's name above its value, so four blocks of the
     key fit on a line. */
  .panel table.totp-details th, .panel table.totp-details td { display: block; width: auto; }
  .panel table.totp-details th { border-bottom: 0; padding-bottom: 0; }
}
