@font-face { font-family: Onest; src: url("/static/fonts/Onest.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
/* AIVIO Studio identity. Extends the portal's Onest / indigo system. */
.studio-mark { display: block; width: 42px; height: 42px; flex: 0 0 auto; }
.studio-wordmark { display: flex; align-items: baseline; gap: 9px; white-space: nowrap; }
.studio-wordmark strong { font-size: 23px; font-weight: 700; letter-spacing: -.035em; line-height: 1; }
.studio-wordmark span { font-size: 17px; font-weight: 400; letter-spacing: -.025em; opacity: .72; }
.studio-lockup { display: inline-flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand.studio-lockup { padding: 22px 18px 20px; gap: 10px; }
.brand .studio-mark { width: 35px; height: 35px; }
.brand .studio-wordmark { gap: 7px; }
.brand .studio-wordmark strong { font-size: 19px; }
.brand .studio-wordmark span { font-size: 14px; }
.studio-auth { min-width: 0; min-height: 100svh; height: auto; }
.studio-auth ::selection { background: var(--accent); color: #fff; }
.studio-auth input { caret-color: var(--accent); }
.auth-layout { min-height: 100svh; display: grid; grid-template-columns: minmax(0, 1.04fr) minmax(0, 1fr); padding: 20px; }
.auth-story { position: relative; isolation: isolate; display: flex; flex-direction: column; justify-content: space-between; min-height: 640px; overflow: hidden; border-radius: var(--r-lg); background: var(--side); color: var(--side-text); padding: clamp(32px, 3.5vw, 60px); }
.auth-story .studio-lockup { align-self: flex-start; }
.auth-story .studio-wordmark span { color: #bfc1cb; opacity: 1; }
.auth-story-copy { position: relative; z-index: 1; margin: 62px 0 230px; max-width: 530px; }
.auth-story h2 { margin: 0; font-size: clamp(42px, 4.3vw, 70px); line-height: 1.08; font-weight: 500; letter-spacing: -.04em; text-wrap: balance; }
.auth-story h2 span { display: block; color: #a6afff; }
.auth-story p { margin: 24px 0 0; max-width: 350px; color: #bfc1cb; font-size: 16px; line-height: 1.65; text-wrap: pretty; }
.auth-art { position: absolute; right: -72px; bottom: -132px; width: min(580px, 85%); aspect-ratio: 1; pointer-events: none; z-index: 0; }
.auth-art svg { display: block; width: 100%; height: 100%; }
.auth-story-foot { position: relative; z-index: 1; color: #bfc1cb; font-size: 12px; line-height: 1.5; max-width: 190px; }
.auth-side { display: flex; flex-direction: column; min-width: 0; position: relative; }
.auth-toolbar { display: flex; justify-content: flex-end; padding: 10px 12px 0; }
.theme-toggle { display: inline-grid; grid-template-columns: 18px auto; align-items: center; justify-content: center; gap: 8px; min-height: 44px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--muted); padding: 10px 12px; font-size: 13px; cursor: pointer; transition: color .18s, background .18s; -webkit-tap-highlight-color: transparent; }
.theme-toggle:hover { color: var(--text); background: var(--surface); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle > span:not([hidden]) { display: inline-flex; align-items: center; }
.theme-toggle :is(#themeMoon, #themeSun) { grid-column: 1; grid-row: 1; transition: transform .18s cubic-bezier(.16,1,.3,1), opacity .12s linear; }
.theme-toggle #themeLabel { grid-column: 2; grid-row: 1; }
.theme-toggle #themeSun { opacity: 0; transform: translateY(3px) rotate(35deg) scale(.85); }
.theme-toggle[aria-pressed="true"] #themeMoon { opacity: 0; transform: translateY(-3px) rotate(-35deg) scale(.85); }
.theme-toggle[aria-pressed="true"] #themeSun { opacity: 1; transform: none; }
.auth-form-wrap { display: flex; flex: 1; align-items: center; justify-content: center; padding: 54px clamp(28px, 4vw, 72px) 86px; }
.auth-form { width: 100%; max-width: 392px; }
.auth-form h1 { margin: 0 0 13px; color: var(--text); font-size: clamp(29px, 2.8vw, 38px); font-weight: 600; line-height: 1.2; letter-spacing: -.035em; text-wrap: balance; }
.auth-intro { margin: 0 0 36px; max-width: 32ch; color: var(--muted); font-size: 15px; line-height: 1.65; }
.auth-form .field { margin-bottom: 22px; }
.auth-form .field label { color: var(--text); font-size: 13px; font-weight: 500; margin-bottom: 9px; }
.auth-form .field input { min-height: 56px; border: 1px solid light-dark(#c5c6cf, #535562); border-radius: var(--r-md); background: var(--panel); padding: 14px 16px; font-size: 16px; line-height: 1.5; color: var(--text); box-shadow: none; transition: border-color .18s, background .18s; }
.auth-form .field input::placeholder { color: light-dark(#6a6c76, #a0a3b2); opacity: 1; }
.auth-form .field input:hover { border-color: var(--muted); }
.auth-form .field input:focus { outline: 2px solid var(--accent); outline-offset: 3px; border-color: var(--accent); }
.password-field { position: relative; }
.auth-form .password-field input { padding-right: 58px; }
.password-toggle { position: absolute; right: 6px; top: 6px; width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--muted); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.password-toggle:hover { background: var(--surface); color: var(--text); }
.password-toggle svg { width: 20px; height: 20px; }
.password-toggle > span { grid-column: 1; grid-row: 1; display: inline-flex; transition: transform .16s cubic-bezier(.16,1,.3,1), opacity .12s linear; }
.password-toggle #eyeClosed { opacity: 0; transform: scale(.8); }
.password-toggle[aria-pressed="true"] #eyeOpen { opacity: 0; transform: scale(.8); }
.password-toggle[aria-pressed="true"] #eyeClosed { opacity: 1; transform: none; }
.auth-submit { min-height: 56px; display: flex; align-items: center; justify-content: center; gap: 12px; border-radius: var(--r-md); font-size: 15px; font-weight: 600; white-space: nowrap; margin-top: 8px; background: light-dark(#4353c4, #a6afff); color: light-dark(#ffffff, #16171b); }
.auth-submit svg { width: 20px; height: 20px; transition: transform .2s cubic-bezier(.16,1,.3,1); }
.studio-auth .auth-submit:active { transform: none; }
.auth-submit:disabled { opacity: 1; background: var(--accent-soft); color: var(--accent); cursor: wait; }
.auth-submit[aria-busy="true"] svg { display: none; }
.auth-form .error { line-height: 1.5; margin-top: 4px; margin-bottom: 20px; }
.auth-form .error:focus { outline: 2px solid var(--danger); outline-offset: 3px; }
.access-help { margin-top: 28px; color: var(--muted); font-size: 13px; }
.access-help summary { display: flex; align-items: center; justify-content: center; gap: 6px; width: fit-content; min-height: 44px; margin: 0 auto; padding: 5px 10px; border-radius: var(--r-sm); cursor: pointer; list-style: none; }
.access-help summary::-webkit-details-marker { display: none; }
.access-help summary:hover { color: var(--text); }
.access-help summary svg { width: 16px; height: 16px; transition: transform .18s; }
.access-help[open] summary svg { transform: rotate(180deg); }
.access-help p { margin: 8px 0 0; text-align: center; line-height: 1.65; text-wrap: pretty; }
.auth-footer { color: var(--muted); padding: 0 30px 16px; text-align: center; font-size: 12px; }
.studio-auth :is(button, a, summary):focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.gate .gate-brand { margin-bottom: 32px; }
.gate .gate-brand .studio-mark { width: 36px; height: 36px; }
.gate .gate-brand .studio-wordmark strong { font-size: 20px; }
.gate .gate-brand .studio-wordmark span { font-size: 15px; }

@media (min-width: 861px) and (max-height: 760px) {
  .auth-story { min-height: 580px; }
  .auth-story-copy { margin-top: 42px; margin-bottom: 180px; }
  .auth-art { width: 440px; bottom: -150px; }
  .auth-form-wrap { padding-top: 28px; padding-bottom: 48px; }
}
@media (max-width: 1100px) and (min-width: 861px) {
  .auth-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding: 14px; }
  .auth-story { padding: 32px; }
  .auth-story h2 { font-size: 46px; }
  .auth-form-wrap { padding-left: 36px; padding-right: 30px; }
  .auth-story-copy { margin-bottom: 220px; }
}
@media (max-width: 860px) {
  .auth-layout { display: flex; flex-direction: column; padding: 0; }
  .auth-story { display: block; min-height: auto; padding: 28px 26px 0; border-radius: 0; background: transparent; color: var(--text); overflow: visible; }
  .auth-story .studio-wordmark span { color: var(--muted); }
  .auth-story .studio-mark { width: 38px; height: 38px; }
  .auth-story .studio-wordmark { flex-direction: column; align-items: flex-start; gap: 4px; }
  .auth-story .studio-wordmark strong { font-size: 21px; }
  .auth-story .studio-wordmark span { font-size: 13px; line-height: 1; }
  .auth-story-copy, .auth-art, .auth-story-foot { display: none; }
  .auth-side { position: static; flex: 1; }
  .auth-toolbar { position: absolute; top: 26px; right: 16px; padding: 0; }
  .theme-toggle { width: 44px; padding: 12px; grid-template-columns: 20px; gap: 0; }
  .theme-toggle #themeLabel { display: none; }
  .theme-toggle svg { width: 20px; height: 20px; }
  .auth-form-wrap { padding: 66px 26px 50px; align-items: flex-start; }
  .auth-form h1 { font-size: 32px; }
  .auth-intro { margin-bottom: 32px; }
  .auth-footer { margin-top: auto; padding: 0 26px max(24px, env(safe-area-inset-bottom)); }
}
@media (max-width: 380px) {
  .auth-story { padding-left: 20px; }
  .auth-form-wrap { padding-left: 20px; padding-right: 20px; padding-top: 52px; }
  .auth-form h1 { font-size: 29px; }
}
@media (prefers-reduced-motion: no-preference) {
  /* One finite brand assembly. Inputs remain available throughout. */
  .auth-art svg > circle { transform-box: fill-box; transform-origin: center; animation: studio-orbit-arrive .64s cubic-bezier(.16,1,.3,1) both; }
  .auth-art svg > circle + circle { animation-delay: .075s; }
  .studio-auth .auth-submit { transition: transform .18s cubic-bezier(.16,1,.3,1), background-color .16s, color .16s; }
  .studio-auth .auth-submit:active:not(:disabled) { transform: scale(.985); transition-duration: .08s; }
  .auth-submit[aria-busy="true"] #buttonLabel { animation: studio-request-pulse .8s linear infinite alternate; }
  @keyframes studio-orbit-arrive { from { transform: scale(.93); opacity: .15; } to { transform: none; opacity: 1; } }
  @keyframes studio-request-pulse { from { opacity: .65; } to { opacity: 1; } }
}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .auth-submit:hover:not(:disabled) svg { transform: translateX(4px); }
}
:root[data-studio-motion-paused] .studio-auth * { animation-play-state: paused !important; }
@media (max-width: 860px) {
  .auth-art svg > circle, .auth-art .family-emblem { animation: none; }
}
@media (prefers-reduced-motion: reduce) {
  .studio-auth *, .studio-auth *::before, .studio-auth *::after { animation: none !important; transition-property: color, background-color, border-color, opacity !important; transition-duration: .12s !important; }
  .theme-toggle :is(#themeMoon, #themeSun), .password-toggle > span, .studio-auth .auth-submit:active { transform: none !important; }
}

/* AIVIO family identity: original symbol, Unbounded wordmark, Studio qualifier. */
@font-face { font-family: 'AIVIO Brand'; src: url('/static/fonts/AIVIO-Brand.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }
.studio-mark { width: 46px; height: 46px; object-fit: contain; }
.studio-wordmark { flex-direction: column; align-items: flex-start; gap: 5px; }
.studio-wordmark strong { font-family: 'AIVIO Brand', Onest, sans-serif; font-size: 20px; font-weight: 600; letter-spacing: .02em; line-height: 1.1; }
.studio-wordmark span { font-size: 13px; font-weight: 500; line-height: 1; letter-spacing: .06em; opacity: .75; }
.brand .studio-mark { width: 38px; height: 38px; }
.brand .studio-wordmark { gap: 5px; }
.brand .studio-wordmark strong { font-size: 16px; }
.brand .studio-wordmark span { font-size: 12px; }
.studio-auth { --accent: light-dark(#7c26db, #c5a3ff); --accent-hover: light-dark(#671cbf, #d4bbff); --accent-soft: light-dark(#f2e9ff, #2b1d3d); }
.auth-story { background: #17111f; }
.auth-story .studio-wordmark span { color: #c7bdd6; }
.auth-story h2 span { color: #c5a3ff; }
.auth-art { width: min(410px, 60%); right: 22px; bottom: 30px; }
.studio-auth .auth-submit { background: var(--accent); color: light-dark(#ffffff, #1b112b); }
.studio-auth .auth-submit:disabled { background: var(--accent-soft); color: var(--accent); }
@media (prefers-reduced-motion: no-preference) {
  .auth-art .family-emblem { transform-box: fill-box; transform-origin: center; animation: studio-family-arrive .72s cubic-bezier(.16,1,.3,1) both; }
  @keyframes studio-family-arrive { from { transform: translateY(18px) scale(.96); opacity: .35; } to { transform: none; opacity: 1; } }
}
@media (min-width: 861px) and (max-width: 1100px) {
  .auth-art { width: 330px; max-width: 78%; right: 0; bottom: 18px; }
}
@media (max-width: 860px) {
  .auth-story { background: transparent; }
  .auth-story .studio-mark { width: 44px; height: 44px; }
  .auth-story .studio-wordmark strong { font-size: 18px; }
  .auth-story .studio-wordmark span { font-size: 12px; letter-spacing: .06em; color: var(--muted); }
  .auth-art .family-emblem { animation: none; }
}

/* Studio login motion: visible at every breakpoint. */
.studio-mark-motion { position: relative; display: block; flex: 0 0 auto; width: 46px; height: 46px; }
.studio-mark-motion .studio-mark { width: 100%; height: 100%; }
.studio-orbit { position: absolute; inset: -8px; border: 1px solid currentColor; border-radius: 50%; color: #b36cf2; opacity: 0; pointer-events: none; }
.studio-orbit::after { content: ''; position: absolute; width: 6px; height: 6px; top: -3px; left: calc(50% - 3px); border-radius: 50%; background: #d62ff7; }
.auth-toolbar { gap: 6px; }
.motion-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 12px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.motion-toggle:hover { color: var(--text); background: var(--surface); }
.motion-toggle svg { width: 18px; height: 18px; }
.motion-toggle[hidden], .motion-toggle [hidden] { display: none; }
.auth-art .studio-orbit-track { transform-origin: 300px 300px; }
@media (prefers-reduced-motion: no-preference) {
  :root[data-studio-motion] .studio-orbit { opacity: .7; animation: studio-signal-orbit 5s linear infinite; }
  :root[data-studio-motion] .studio-mark-motion .studio-mark { animation: studio-logo-breathe 4s ease-in-out infinite; }
  :root[data-studio-motion] .auth-art .family-emblem { transform-box: fill-box; transform-origin: center; animation: studio-emblem-float 5s ease-in-out infinite; }
  :root[data-studio-motion] .auth-art .studio-orbit-track { animation: studio-signal-orbit 14s linear infinite; }
  :root[data-studio-motion] .auth-art .studio-orbit-track-inner { animation-duration: 20s; animation-direction: reverse; }
  .studio-auth .auth-form { animation: studio-form-arrive .55s cubic-bezier(.16,1,.3,1) both; }
  @keyframes studio-signal-orbit { to { transform: rotate(360deg); } }
  @keyframes studio-logo-breathe { 0%, 100% { transform: translateY(3px) rotate(-4deg); } 50% { transform: translateY(-3px) rotate(4deg); } }
  @keyframes studio-emblem-float { 0%, 100% { transform: translateY(8px) rotate(-2deg); } 50% { transform: translateY(-8px) rotate(2deg); } }
  @keyframes studio-form-arrive { from { opacity: .4; transform: translateY(14px); } to { opacity: 1; transform: none; } }
}
:root[data-studio-motion="paused"] .studio-auth *, :root[data-studio-motion="paused"] .studio-auth *::after,
:root[data-studio-motion-paused] .studio-auth *::after { animation-play-state: paused !important; }
@media (max-width: 860px) {
  .studio-mark-motion { width: 44px; height: 44px; }
  .auth-story .studio-mark-motion .studio-mark { width: 100%; height: 100%; }
  .motion-toggle { width: 44px; padding: 12px; }
  .motion-toggle #motionLabel { display: none; }
  .motion-toggle svg { width: 20px; height: 20px; }
}
