:root { --page: light-dark(#F8F7F5, #0e0604); --card: light-dark(#ffffff, #1d110d); --line: light-dark(#E9E1DC, rgba(245, 245, 244, 0.14)); --field: light-dark(#ffffff, #160b08); }
body[data-page="login"] { margin: 0; min-height: 100dvh; background: var(--page); color: var(--text); }
.signin-page { position: relative; min-height: 100dvh; overflow: hidden; isolation: isolate; }
.signin-stage { position: relative; z-index: 2; display: grid; place-items: center; min-height: 100dvh; padding: 96px 20px 48px; }
.signin-card { width: 100%; max-width: 440px; background: var(--card); border-radius: 12px; outline: 1px solid light-dark(transparent, rgba(245, 245, 244, 0.08));
        box-shadow: 0 1px 2px rgb(18 5 2 / 0.06), 0 12px 32px -8px rgb(18 5 2 / 0.16), 0 32px 64px -24px rgb(18 5 2 / 0.18); overflow: hidden;
        animation: rise 0.6s cubic-bezier(0.16, 1, 0.3, 1) both; }
.card-body { padding: 44px 44px 36px; }
.signin-card h1 { margin: 0 0 28px; font-size: 1.5rem; font-weight: 600; letter-spacing: -0.02em; cursor: default; }
.signin-card label { display: block; margin: 0 0 7px; font-size: 0.8125rem; font-weight: 600; }
body[data-page="login"] .signin-card input {
  height: 44px;
  margin: 0 0 20px;
  padding: 0 12px 0 42px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9375rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
body[data-page="login"] .signin-card input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 45%, transparent);
}
.label-row { display: flex; justify-content: space-between; align-items: baseline; }
.link-btn-quiet { position: relative; min-height: 0; padding: 0; border: 0; background: none; color: var(--muted); font-size: 0.8125rem; font-weight: 600; letter-spacing: 0; text-transform: none; }
.link-btn-quiet:hover { background: none; color: var(--text); }
.link-btn-quiet::after { content: ""; position: absolute; inset: -16px -10px -8px; }
body[data-page="login"] .signin-card .signin-submit { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 44px; margin-top: 6px;
  border-radius: 8px; background: #120502; border: 1px solid light-dark(#120502, rgba(245, 245, 244, 0.16)); color: #f5f5f4;
  font-size: 0.9375rem; font-weight: 600; letter-spacing: 0; text-transform: none; }
body[data-page="login"] .signin-card .signin-submit:hover { background: #2a1712; border-color: light-dark(#2a1712, rgba(245, 245, 244, 0.28)); color: #f5f5f4; }
.card-foot { margin: 0; padding: 18px 44px; border-top: 1px solid var(--line); background: light-dark(#FBFBFA, rgba(245, 245, 244, 0.03));
  font-size: 0.8125rem; color: var(--muted); text-align: center; text-wrap: balance; }
.card-foot a { position: relative; margin-left: 4px; color: var(--text); font-weight: 600; white-space: nowrap; }
.card-foot a::after { content: ""; position: absolute; inset: -14px -6px; }
.input-wrap { position: relative; }
.field-icon { position: absolute; left: 13px; top: 13px; width: 18px; height: 18px; color: var(--muted); pointer-events: none; transition: color 0.15s ease; }
.input-wrap:focus-within .field-icon { color: var(--text); }
.btn-icon { width: 18px; height: 18px; flex: none; }
.foot-icon { display: inline-block; width: 16px; height: 16px; margin-right: 6px; vertical-align: -3px; color: var(--muted); }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@media (max-width: 640px) { .card-body { padding: 32px 24px 28px; } .card-foot { padding: 16px 24px; } .signin-stage { padding-top: 84px; } }
@media (max-height: 760px) {
  .signin-stage { padding-top: 80px; padding-bottom: 16px; }
  .card-body { padding-top: 32px; padding-bottom: 28px; }
  .signin-card h1 { margin-bottom: 20px; }
  body[data-page="login"] .signin-card input[type="text"], body[data-page="login"] .signin-card input[type="email"], body[data-page="login"] .signin-card input[type="password"] { margin-bottom: 16px; }
}
@media (prefers-reduced-motion: reduce) { .signin-card { animation: none !important; } }

.topbar-lite { position: absolute; inset: 0 0 auto 0; z-index: 3; height: 68px; display: flex; align-items: center; justify-content: space-between; padding: 0 24px 0 40px; }
.topbar-lite .theme-switch { position: static; }
.topbar-lite .theme-switch, .topbar-lite .theme-switch:hover { background: var(--card); box-shadow: 0 1px 2px rgb(18 5 2 / 0.08), 0 4px 12px -4px rgb(18 5 2 / 0.18); }
.topbar-rule { position: absolute; inset: 68px 0 auto 0; height: 1px; background: var(--line); z-index: 0; }
.wordmark { font-weight: 700; font-size: 1.0625rem; letter-spacing: -0.02em; }
.ribbon-wrap { position: absolute; inset: -10% -20% -10% 30%; z-index: 1; pointer-events: none; }
.knockout path { fill: var(--page); }
.ribbon { width: 100%; height: 100%; }
@media (max-width: 760px) { .ribbon-wrap { inset: -30% -60% 40% 10%; opacity: 0.7; } }

.card-anchor { position: relative; width: 100%; max-width: 440px; }
.robot-wrap { position: absolute; right: calc(100% + 24px); bottom: -94px; width: 300px; height: 380px; perspective: 900px;
              animation: robot-in 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.25s both; }
.robot { width: 100%; height: 100%; overflow: visible; transform-origin: 50% 90%; animation: turn 7s ease-in-out infinite alternate; }
.robot * { transform-box: view-box; }
.robot-antenna { animation: glow 1.6s ease-in-out infinite alternate; }
.robot-status { animation: glow 2.2s ease-in-out infinite alternate; }
.robot-bar { transform-origin: 0 206px; animation: meter 1.1s ease-in-out infinite alternate; }
.robot-bar.b2 { animation-delay: 0.25s; }
.robot-bar.b3 { animation-delay: 0.5s; }
.robot-shadow { transform-origin: 150px 356px; animation: shadow 2.4s ease-in-out infinite alternate; }
.robot-body { animation: bob 2.4s ease-in-out infinite alternate; }
.robot-eyes { transform-origin: 150px 96px; animation: blink 4.2s infinite, look 6s ease-in-out infinite alternate; transition: translate 0.3s ease; }
.robot-arm-wave { transform-origin: 208px 164px; animation: wave 1.1s ease-in-out infinite alternate; }
.robot-arm-left { transform-origin: 92px 164px; animation: sway 2.4s ease-in-out infinite alternate; }
.robot-wrap.is-thinking .robot-eyes { translate: 0 -5px; }
@keyframes robot-in { from { opacity: 0; transform: translateY(24px); } }
@keyframes turn { from { transform: rotateY(-14deg); } to { transform: rotateY(10deg); } }
@keyframes bob { from { transform: translateY(0); } to { transform: translateY(-9px); } }
@keyframes shadow { from { transform: scaleX(1); opacity: 1; } to { transform: scaleX(0.84); opacity: 0.72; } }
@keyframes blink { 0%, 92%, 100% { scale: 1 1; } 95% { scale: 1 0.1; } }
@keyframes look { 0%, 30% { transform: translateX(-4px); } 70%, 100% { transform: translateX(4px); } }
@keyframes wave { from { transform: rotate(-150deg); } to { transform: rotate(-112deg); } }
@keyframes sway { from { transform: rotate(4deg); } to { transform: rotate(-4deg); } }
@keyframes meter { from { transform: scaleY(0.35); } to { transform: scaleY(1); } }
@keyframes glow { from { opacity: 0.6; } to { opacity: 1; } }

.robot-thought { position: absolute; inset: 0; pointer-events: none; animation: bob 2.4s ease-in-out infinite alternate; }
.robot-bubble { position: absolute; left: -110px; bottom: calc(100% + 16px); width: 340px; min-height: 92px; padding: 16px 20px;
                background: var(--card); border: 1px solid var(--line); border-radius: 18px;
                box-shadow: 0 1px 2px rgb(18 5 2 / 0.06), 0 12px 28px -10px rgb(18 5 2 / 0.22); }
.bubble-tail { position: absolute; border-radius: 50%; background: var(--card); border: 1px solid var(--line); }
.bubble-tail.t1 { width: 14px; height: 14px; left: 166px; top: -10px; }
.bubble-tail.t2 { width: 8px; height: 8px; left: 172px; top: 10px; }
.bubble-quote { margin: 0; display: grid; gap: 8px; transition: opacity 0.3s ease, transform 0.3s ease; }
.bubble-text { font-size: 0.9375rem; line-height: 1.45; color: var(--text); text-wrap: pretty; }
.bubble-author { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.02em; color: var(--muted); }
.bubble-dots { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 7px; opacity: 0; transition: opacity 0.2s ease; }
.bubble-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); animation: dot 1s ease-in-out infinite; }
.bubble-dots i:nth-child(2) { animation-delay: 0.15s; }
.bubble-dots i:nth-child(3) { animation-delay: 0.3s; }
.robot-bubble[data-state="thinking"] .bubble-dots { opacity: 1; }
.robot-bubble:not([data-state="thinking"]) .bubble-dots { transition: none; }
.robot-bubble[data-state="thinking"] .bubble-quote, .robot-bubble[data-state="resting"] .bubble-quote { opacity: 0; transform: translateY(4px); }
@keyframes dot { 0%, 100% { opacity: 0.35; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-4px); } }

@media (min-width: 1120px) and (min-height: 700px) { .card-anchor { translate: 162px 0; } }
@media (max-width: 1119px), (max-height: 699px) { .robot-wrap { display: none; } }
@media (prefers-reduced-motion: reduce) { .robot-wrap, .robot, .robot *, .robot-thought, .bubble-dots i { animation: none !important; } .bubble-quote { transition: none; } .robot-arm-wave { transform: rotate(-130deg); } }
