/* =====================================================================================================================
   The "account" pages in the redesign (theme.css look): sign in (login.html), link Studio (link.html), the account
   page (account.html, in the app shell), errors (error.html) and the legal pages (privacy.html, terms.html).
   Page-specific only: tokens and components come from theme.css. Every rule is scoped by the page's body class
   (.page-login, .page-link, .page-account, .page-error, .page-legal) so nothing leaks into other pages.
   ===================================================================================================================== */

/* ---------------------------------------------------------------- the glowing round icon over a title (all five) */
.page-login .hero-icon, .page-link .hero-icon, .page-account .hero-icon, .page-error .hero-icon {
  width: 68px; height: 68px; margin: 0 auto 22px; border-radius: 50%; transform: none; display: grid; place-items: center;
  color: #fff; background: var(--grad-blue);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 0 0 9px rgba(47, 123, 255, 0.12), 0 0 0 20px rgba(47, 123, 255, 0.05),
    0 20px 60px -10px rgba(47, 123, 255, 0.9);
}
.page-login .hero-icon .i, .page-link .hero-icon .i, .page-account .hero-icon .i, .page-error .hero-icon .i { width: 30px; height: 30px; stroke-width: 2.2; }
.page-link .hero-icon.green, .page-account .hero-icon.green { background: linear-gradient(180deg, #4ee3ab, #10b981);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 0 0 9px rgba(52, 211, 153, 0.12), 0 0 0 20px rgba(52, 211, 153, 0.05), 0 20px 60px -10px rgba(52, 211, 153, 0.8); }
.page-account .hero-icon.purple { background: var(--grad-blue); }

/* ---------------------------------------------------------------- SIGN IN: a glass card over one of our builds */
.auth-stage { position: relative; isolation: isolate; overflow: hidden; min-height: calc(100vh - 64px); display: grid; align-items: center;
  padding: clamp(28px, 6vw, 72px) 0 clamp(40px, 7vw, 88px); }
.auth-bg { position: absolute; inset: 0; z-index: -3; width: 100%; height: 100%; object-fit: cover; opacity: 0.34; filter: saturate(1.15) blur(2px); transform: scale(1.04); }
.auth-stage::before { content: ""; position: absolute; inset: 0; z-index: -2;
  background: radial-gradient(55% 60% at 50% 45%, rgba(7, 7, 8, 0.35), rgba(7, 7, 8, 0.94) 78%), linear-gradient(180deg, rgba(7, 7, 8, 0.5), var(--bg) 96%); }
.auth-stage::after { content: ""; position: absolute; left: 50%; top: 42%; z-index: -1; width: min(760px, 90vw); height: 420px; transform: translate(-50%, -50%);
  border-radius: 50%; background: radial-gradient(closest-side, rgba(47, 123, 255, 0.28), transparent); filter: blur(30px); pointer-events: none; }
/* our builds floating at the edges (desktop): real renders, tilted, with depth */
.auth-float { width: clamp(180px, 17vw, 260px); aspect-ratio: 16 / 10; z-index: -1; }
.auth-float-1 { left: max(2vw, calc(50% - 640px)); top: 16%; }
.auth-float-2 { right: max(2vw, calc(50% - 640px)); top: 30%; }
.auth-float-3 { left: max(5vw, calc(50% - 560px)); bottom: 10%; width: clamp(150px, 13vw, 210px); }
@media (max-width: 1080px) { .auth-float { display: none; } }

.page-login .narrow { max-width: 480px; padding-top: 0; }
.page-login .login-card { padding: clamp(24px, 4vw, 36px); border-radius: 26px; text-align: center;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0) 40%), rgba(17, 17, 20, 0.78);
  border: 1px solid var(--line-2); -webkit-backdrop-filter: blur(18px) saturate(1.3); backdrop-filter: blur(18px) saturate(1.3);
  box-shadow: 0 40px 100px -30px rgba(0, 0, 0, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.07); }
.page-login .login-card h1 { font-size: clamp(1.8rem, 4.4vw, 2.3rem); font-weight: 800; letter-spacing: -0.035em; margin: 0 0 10px; }
.page-login .login-card > p.muted { margin: 0 auto 24px; max-width: 34ch; }
.page-login #login-buttons { display: grid; gap: 12px; }
.page-login #login-buttons > * + * { margin-top: 0; }
.page-login .login-provider { min-height: 54px; font-size: 1.02rem; font-weight: 600; border-radius: 14px; }
.page-login .login-provider .i { width: 20px; height: 20px; }
/* Google's own button: white with its four-colour G (its brand rule), so the one blue button stays Roblox */
.page-login .btn-google, .page-login .btn-google:hover { color: #1f1f1f; background: #fff; border: 0; -webkit-backdrop-filter: none; backdrop-filter: none;
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.12), 0 8px 24px -12px rgba(0, 0, 0, 0.8); }
.page-login .btn-google:hover { background: #f1f3f6; transform: translateY(-1px); }
.page-login .login-card .perm { margin: 24px 0 18px; display: grid; gap: 12px; text-align: left; padding: 16px 18px; border-radius: 16px;
  background: rgba(255, 255, 255, 0.025); border: 1px solid var(--line); }
.page-login .login-card .perm div { display: flex; gap: 12px; align-items: flex-start; font-weight: 400; font-size: 0.95rem; line-height: 1.5; color: var(--ink-2); }
.page-login .login-card .perm .i { flex: none; width: 18px; height: 18px; margin-top: 2px; color: var(--green); stroke-width: 2.6; }
.page-login .login-card .tiny { line-height: 1.55; }
.page-login #login-signedin { margin-top: 4px; }

/* ---------------------------------------------------------------- the signed-in pages' canvas (account, link): the
   app's faint square grid under the page-top glow. They extend base.html for now (the banner test wants the site header);
   their CSS works unchanged inside base_app.html's shell too. */
body.page-account, body.page-link { background-color: #0b0b0d;
  background-image: var(--grad-hero), linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 100% 900px, 40px 40px, 40px 40px; background-repeat: no-repeat, repeat, repeat; background-position: 0 0, -1px -1px, -1px -1px; }
.page-account .acc-page { padding-top: clamp(20px, 3vw, 36px); padding-bottom: 72px; }

/* ---------------------------------------------------------------- LINK STUDIO */
.page-link .link-page { max-width: 640px; margin: 0 auto; padding-top: clamp(28px, 5vw, 56px); padding-bottom: 72px; }
.page-link .narrow { max-width: none; padding-top: 0; }
.page-link #link-card, .page-plugin .plugin-card { position: relative; overflow: hidden; padding: clamp(24px, 4vw, 40px); border-radius: 24px; border-color: var(--line-2);
  background: radial-gradient(90% 60% at 50% 0%, rgba(47, 123, 255, 0.16), transparent 70%), linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 40%), var(--surface);
  box-shadow: var(--shadow-3), inset 0 1px 0 rgba(255, 255, 255, 0.06); }
.page-link #link-card h1, .page-plugin .plugin-card h1 { font-size: clamp(1.8rem, 4.2vw, 2.4rem); font-weight: 800; letter-spacing: -0.035em; margin: 0 0 10px; }
.page-link #link-card h2 { font-size: 1.45rem; letter-spacing: -0.025em; }
.page-link #link-intro p, .page-plugin .plugin-lead { max-width: 44ch; margin: 0 auto 26px; }
.page-plugin .plugin-card .btn-lg { margin-bottom: 12px; }
.page-plugin .plugin-fine { text-align: center; }
.page-link #link-intro b { color: #fff; font-weight: 600; }
.page-link .code-input { font-family: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace; font-weight: 700; letter-spacing: 0.22em;
  font-size: clamp(1.7rem, 7.4vw, 2.5rem); min-height: 76px; padding: 14px 10px; border-radius: 18px; border: 1px solid var(--line-2); background: #0b0c0f; color: #fff;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.6); transition: border-color 0.2s, box-shadow 0.2s; }
.page-link .code-input::placeholder { color: rgba(255, 255, 255, 0.16); }
.page-link .code-input:focus { border-color: rgba(74, 144, 255, 0.85); box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.6), 0 0 0 4px rgba(47, 123, 255, 0.2), 0 0 40px -6px rgba(47, 123, 255, 0.6); }
.page-link .code-input.bad { border-color: var(--red); box-shadow: 0 0 0 4px rgba(255, 107, 107, 0.18); }
.page-link #link-check, .page-link #link-done, .page-link #link-login { text-align: left; }
.page-link #link-done { text-align: center; }
.page-link #link-done .row, .page-link #link-check .row { justify-content: center; }
.page-link #link-check label.small { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.03); cursor: pointer; }
.page-link #link-check label.small input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--blue-2); flex: none; }
.page-link .note p, .page-link .note .stack p { color: var(--ink); }
.link-help { margin-top: 22px; padding: 20px 22px; border-radius: 20px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.02); }
.link-help h2 { font-size: 0.74rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 12px; }
.link-help p, .link-help li { color: var(--ink-2); }
.link-help .plugin-paths { margin: 10px 0 12px; padding-left: 20px; font-weight: 400; gap: 6px; }
.link-help .tut { margin: 0 0 12px; }
.link-help .tut:has(> [hidden]) { display: none; }
.page-link .plugin-paths code, .page-account .plugin-paths code { color: #e9ebf0; background: rgba(255, 255, 255, 0.07); border: 1px solid var(--line); }

/* ---------------------------------------------------------------- THE ACCOUNT PAGE */
.page-account .account-grid { gap: 20px; padding-top: 0; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 860px) { .page-account .account-grid { grid-template-columns: minmax(0, 1fr); } }
/* jump links along the top of the page (each goes to a section that is always there) */
.acc-tabs { position: sticky; top: 72px; z-index: 5; display: flex; gap: 4px; max-width: 100%; margin: 0; padding: 4px; overflow-x: auto; scrollbar-width: none;
  border-radius: var(--r-pill); background: rgba(16, 17, 20, 0.82); border: 1px solid var(--line); width: max-content; justify-self: start;
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.acc-tabs::-webkit-scrollbar { display: none; }
.acc-tabs .tab { flex: none; min-height: 36px; padding: 6px 14px; font-size: 0.88rem; }
@media (max-width: 900px) { .acc-tabs { top: 70px; } }
/* the tab of the section on screen (account.js): a soft pill that slides between tabs as the page glides */
.acc-tabs .tab { transition: color 0.2s var(--ease), background-color 0.25s var(--ease), transform 0.14s var(--ease); }
.acc-tabs .tab.is-here { color: #fff; background: rgba(255, 255, 255, 0.1); }
html:has(.page-account) { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html:has(.page-account) { scroll-behavior: auto; } }
.page-account .card { padding: clamp(18px, 2.4vw, 24px); border-radius: 20px; }
.page-account .card-title { margin-bottom: 16px; min-height: 36px; flex-wrap: wrap; }
.page-account .card-title h2 { font-size: 1.12rem; font-weight: 700; letter-spacing: -0.02em; }
.page-account .card-title a.small { color: var(--ink-2); text-decoration: none; font-weight: 500; }
.page-account .card-title a.small:hover { color: #fff; }
.page-account .card p.muted, .page-account .card .small.muted { color: var(--ink-2); }
.page-account [id] { scroll-margin-top: 140px; }

/* the profile: avatar, name, plan, actions on a soft blue glow with the gradient ring */
.page-account .acc-hero { position: relative; overflow: hidden; border: 1px solid transparent;
  background: radial-gradient(70% 140% at 0% 0%, rgba(47, 123, 255, 0.22), transparent 60%), radial-gradient(50% 120% at 100% 100%, rgba(124, 108, 255, 0.14), transparent 60%),
    linear-gradient(#121317, #121317) padding-box, var(--grad-ring) border-box;
  box-shadow: var(--shadow-2), 0 30px 80px -40px rgba(47, 123, 255, 0.6); }
.page-account .profile { gap: 18px; }
.page-account .profile h2 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 800; letter-spacing: -0.035em; margin: 0 0 6px; }
.page-account .avatar-lg { width: 68px; height: 68px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.14); box-shadow: 0 0 0 5px rgba(47, 123, 255, 0.14), 0 12px 30px -10px rgba(0, 0, 0, 0.8); }
.page-account .avatar-lg.avatar-letter { font-size: 1.7rem; font-weight: 800; }
.page-account .profile .row { gap: 10px; }
#acc-plan-actions { gap: 10px; }
@media (max-width: 560px) {
  .page-account .profile { align-items: flex-start; }
  .page-account .profile .spacer { display: none; }
  #acc-plan-actions { width: 100%; }
  #acc-plan-actions .btn { flex: 1 1 auto; }
}

/* usage: thin bars with a glowing fill */
.page-account .usage { gap: 18px; }
.page-account .usage-row .top { font-weight: 600; margin-bottom: 8px; }
.page-account .usage-row .top span { color: var(--ink-3); font-size: 0.86rem; font-weight: 500; }
.page-account .bar { height: 8px; border: 0; background: rgba(255, 255, 255, 0.07); }
.page-account .bar > span { background: linear-gradient(90deg, #1d6bff, #6aa6ff); box-shadow: 0 0 12px rgba(74, 144, 255, 0.7); }
.page-account .bar.green > span { background: linear-gradient(90deg, #10b981, #6ee7b7); box-shadow: 0 0 12px rgba(52, 211, 153, 0.6); }
.page-account .bar.warn > span { background: linear-gradient(90deg, #f59e0b, #fcd34d); box-shadow: 0 0 12px rgba(245, 158, 11, 0.5); }
.page-account .bar.full > span { background: linear-gradient(90deg, #e5484d, #ff8080); box-shadow: 0 0 12px rgba(255, 107, 107, 0.6); }
.page-account .exports-left { border: 1px solid var(--line-2); border-radius: 16px; background: rgba(255, 255, 255, 0.03); padding: 14px 16px; }
.page-account .exports-left-n { font-family: var(--font-body); font-weight: 700; letter-spacing: -0.01em; }
.page-account .exports-left.is-empty { background: rgba(47, 123, 255, 0.08); border-color: rgba(74, 144, 255, 0.35); }

/* credits: the balance big and bright */
.page-account .credits { gap: 18px; align-items: flex-start; }
.page-account .credits .big { font-family: var(--font-body); font-weight: 800; font-size: 3.4rem; letter-spacing: -0.05em; line-height: 0.95; text-shadow: none;
  background: linear-gradient(180deg, #ffffff, #8fbaff); -webkit-background-clip: text; background-clip: text; color: transparent; min-width: 1ch; }
.acc-packs { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.acc-packs .acc-pack { display: grid; justify-items: start; gap: 2px; min-height: 64px; padding: 10px 14px; border-radius: 14px; text-align: left; }
.acc-pack b { font-weight: 700; font-size: 1rem; letter-spacing: -0.01em; }
.acc-pack span { font-weight: 500; font-size: 0.86rem; color: var(--ink-2); }
.acc-pack:hover { border-color: rgba(74, 144, 255, 0.55); box-shadow: 0 12px 30px -16px rgba(47, 123, 255, 0.8); }
.page-account .credit-history summary { display: flex; align-items: center; gap: 6px; min-height: 40px; color: var(--ink-2); }
.page-account .credit-history summary b { color: var(--ink); font-weight: 600; }
.page-account .credit-row { font-weight: 400; color: var(--ink-2); padding: 6px 0; border-bottom: 1px solid var(--line); }
.page-account .credit-row b { font-family: var(--font-body); font-weight: 700; }
.page-account .credit-row b.plus { color: var(--green); }

/* rows: linked Studios, keys, sign-in methods */
.page-account .device, .page-link .device { gap: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 255, 255, 0.025); }
.page-account .device .ico { border-radius: 12px; background: var(--grad-blue); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 6px 18px -8px rgba(29, 107, 255, 0.9); }
.page-account .device b { font-weight: 600; }
.page-account .device small { font-weight: 400; }
.page-account .devices > .note { margin: 0; }

/* the plugin steps */
.page-account .steps-mini { font-weight: 400; color: var(--ink-2); gap: 10px; padding-left: 22px; }
.page-account .steps-mini > li::marker { color: var(--blue); font-weight: 700; }
.page-account .steps-mini b { color: var(--ink); font-weight: 600; }
.page-account .plugin-paths { font-weight: 400; }

/* forms: API keys, own AI key, display name */
.page-account form label > .small.muted, .page-account form label > span.small { display: block; margin-bottom: 6px; font-weight: 500; }
.page-account .api-key-scopes legend { margin-bottom: 6px; }
.page-account .api-key-scopes .check { font-weight: 400; color: var(--ink-2); }
.page-account .api-key-scopes .check code { color: var(--ink); }
.page-account .api-key-raw { background: #0b0c0f; border: 1px solid var(--line-2); color: #fff; }
.page-account #name-form { align-items: flex-end; }
.page-account #name-form .input { width: 100%; }

/* the referral card (_referral_card.html) */
.page-account .ref-link { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0; }
.page-account .ref-link .input { flex: 1 1 260px; min-width: 0; font-family: ui-monospace, "Cascadia Code", Menlo, Consolas, monospace; font-size: 0.92rem; }
.page-account .stat { background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.page-account .stat b { font-family: var(--font-body); font-weight: 800; letter-spacing: -0.03em; font-size: 1.5rem; }
.page-account .stat span { font-weight: 600; font-size: 0.7rem; letter-spacing: 0.12em; }
.page-account .referral-card { background: radial-gradient(80% 140% at 100% 0%, rgba(47, 123, 255, 0.14), transparent 60%), var(--surface); }

/* the danger zone */
.page-account #privacy .delete-row { margin-top: 22px; padding: 16px; border: 1px solid rgba(255, 107, 107, 0.25); border-radius: 16px; background: rgba(255, 107, 107, 0.05); }
.page-account #privacy .delete-row b { color: #ffb4b4; font-weight: 600; }
.page-account #delete-account { color: #ffb4b4; border-color: rgba(255, 107, 107, 0.35); }
.page-account #delete-account:hover { color: #fff; background: rgba(255, 107, 107, 0.16); border-color: rgba(255, 107, 107, 0.55); }

/* signed out */
.page-account #account-signedout .narrow { max-width: 520px; padding: clamp(24px, 6vw, 72px) 0; }
.page-account #account-signedout h1 { font-size: clamp(2rem, 4.6vw, 2.6rem); font-weight: 800; letter-spacing: -0.035em; }

/* ---------------------------------------------------------------- ERRORS: the status in huge condensed type */
.page-error main { position: relative; isolation: isolate; overflow: hidden; }
.page-error .error-page { position: relative; padding: clamp(56px, 10vw, 120px) var(--gutter) clamp(56px, 8vw, 96px); max-width: 720px; }
.page-error .error-page::before { content: ""; position: absolute; left: 50%; top: 34%; z-index: -1; width: min(640px, 90vw); height: 340px; transform: translate(-50%, -50%);
  border-radius: 50%; background: radial-gradient(closest-side, rgba(47, 123, 255, 0.3), transparent); filter: blur(30px); }
.page-error .error-page .code { font-family: var(--font-hero); font-weight: 400; font-size: clamp(7rem, 30vw, 14rem); line-height: 0.85; letter-spacing: 0.01em; margin: 0 0 18px;
  background: linear-gradient(180deg, #ffffff 10%, rgba(143, 186, 255, 0.85) 60%, rgba(47, 123, 255, 0.25)); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none;
  filter: drop-shadow(0 20px 50px rgba(47, 123, 255, 0.35)); }
.page-error .error-page h1 { font-size: clamp(1.8rem, 4.4vw, 2.6rem); font-weight: 800; letter-spacing: -0.035em; }
.page-error .error-page p.muted { font-size: var(--fs-lead); max-width: 46ch; margin-left: auto; margin-right: auto; }
.page-error .error-page .row { gap: 12px; }

/* ---------------------------------------------------------------- LEGAL: a calm reading column */
.page-legal .legal { max-width: 800px; padding-top: clamp(28px, 5vw, 56px); padding-bottom: 72px; }
.legal-head { text-align: center; margin: 0 0 28px; }
.legal-head h1 { margin: 0 0 12px; }
.page-legal .legal-head p { color: var(--ink-3); font-size: var(--fs-small); margin: 0 auto 18px; max-width: 60ch; }
.legal-switch { justify-content: center; }
.page-legal .legal .card { padding: clamp(20px, 4vw, 44px); border-radius: 22px; }
.page-legal .legal p, .page-legal .legal li { color: #c9ccd3; font-weight: 400; font-size: 1rem; line-height: 1.75; }
.page-legal .legal li { margin-bottom: 8px; }
.page-legal .legal li::marker { color: var(--ink-3); }
.page-legal .legal b { color: #fff; font-weight: 600; }
.page-legal .legal .card h2 { font-size: 1.22rem; font-weight: 700; letter-spacing: -0.02em; margin: 2em 0 0.7em; padding-top: 1.4em; border-top: 1px solid var(--line); }
.page-legal .legal .card > p:first-child { margin-top: 0; }
.page-legal .legal code { font-size: 0.88em; color: #e9ebf0; background: rgba(255, 255, 255, 0.07); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
.page-legal .note { margin-bottom: 20px; }

@media (prefers-reduced-motion: reduce) {
  .page-login .btn-google:hover { transform: none; }
}
.page-link #code-help { margin-top: 10px !important; }
