/* Auth presentation shares the workspace theme; request handling stays in each page. */
.auth-page {
  margin: 0;
  min-height: 100svh;
  background: var(--bg);
  color: var(--text);
  font-family: Anuphan, sans-serif;
  font-size: 14px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
.auth-page *, .auth-page *::before, .auth-page *::after { box-sizing: border-box; }
.auth-page button, .auth-page input { font: inherit; }
.auth-page button, .auth-page a, .auth-page input { -webkit-tap-highlight-color: transparent; }
.auth-page a { color: inherit; text-decoration: none; }
.auth-page button { cursor: pointer; }
.auth-topbar {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  max-width: 1520px;
  margin: 0 auto;
  padding: 32px 48px;
}
.auth-brand { display: inline-flex; align-items: center; gap: 11px; font-size: 24px; font-weight: 700; letter-spacing: -1px; }
.auth-brand-accent { color: var(--accent-text); }
.auth-brand-mark {
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  color: var(--accent-ink);
  background: var(--accent);
  border-radius: var(--radius-sm);
  box-shadow: inset 0 1px 0 #ffffff35, 0 0 22px #00bc7d12;
}
.auth-brand-mark svg { width: 21px; height: 21px; }
.auth-theme-toggle {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--muted);
  box-shadow: var(--shadow-card);
  transition: color var(--duration) var(--ease-out), border-color var(--duration) var(--ease-out), background var(--duration) var(--ease-out);
}
.auth-theme-toggle svg { width: 19px; height: 19px; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.auth-theme-toggle:hover { background: var(--hover); color: var(--text); border-color: var(--border-strong); }
.auth-theme-moon { display: none; }
html[data-theme="light"] .auth-theme-sun { display: none; }
html[data-theme="light"] .auth-theme-moon { display: block; }
.auth-layout {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: calc(100svh - 106px);
  padding: 20px 24px 52px;
}
.auth-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  width: min(100%, 460px);
  padding: 38px 38px 28px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background-color: var(--surface-glass);
  box-shadow: var(--shadow-popover);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  animation: auth-enter 300ms var(--ease-out) both;
}
.auth-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--accent) 38%, transparent), transparent);
  pointer-events: none;
}
.auth-symbol {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 27px;
  border: 1px solid color-mix(in srgb, var(--accent) 20%, var(--border));
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  color: var(--accent-text);
  box-shadow: inset 0 1px 0 #ffffff07, 0 5px 18px #00000010;
}
.auth-symbol svg { width: 21px; height: 21px; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.auth-eyebrow { margin: 0 0 8px; font-size: 10px; font-weight: 500; letter-spacing: 1.6px; color: var(--muted); }
.auth-card h1 { margin: 0; font-size: 28px; font-weight: 600; line-height: 1.45; letter-spacing: -.6px; }
.auth-intro { margin: 9px 0 29px; font-size: 13px; line-height: 1.85; color: var(--muted); }
.auth-field { margin-bottom: 19px; }
.auth-field label { display: block; margin-bottom: 8px; color: var(--text); font-size: 12px; font-weight: 500; }
.auth-field input {
  display: block;
  width: 100%;
  min-height: 47px;
  padding: 11px 13px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  color: var(--text);
  font-size: 14px;
  box-shadow: inset 0 1px 2px #00000008;
  transition: border-color var(--duration) var(--ease-out), box-shadow var(--duration) var(--ease-out);
}
.auth-field input::placeholder { color: var(--faint); opacity: 1; }
.auth-field input:hover { border-color: var(--muted); }
.auth-field input:focus { outline: none; border-color: var(--accent-text); box-shadow: 0 0 0 3px var(--accent-soft), inset 0 1px 2px #00000008; }
.auth-field input:-webkit-autofill { -webkit-text-fill-color: var(--text); box-shadow: 0 0 0 1000px var(--input-bg) inset; caret-color: var(--text); }
.auth-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 46px;
  margin-top: 27px;
  padding: 11px 16px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-button);
  transition: filter var(--duration) var(--ease-out), transform var(--duration) var(--ease-out), box-shadow var(--duration) var(--ease-out);
}
.auth-submit svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform var(--duration) var(--ease-out); }
@media (hover: hover) {
  .auth-submit:hover:not(:disabled) { filter: brightness(1.07); box-shadow: inset 0 1px 0 #ffffff28, 0 5px 18px #00bc7d22, 0 1px 2px #00000020; }
  .auth-submit:hover:not(:disabled) svg { transform: translateX(3px); }
}
.auth-submit:active:not(:disabled) { transform: scale(.99); }
.auth-submit:disabled { opacity: .55; cursor: wait; }
.auth-page :is(button, a):focus-visible { outline: 2px solid var(--accent-text); outline-offset: 4px; }
.auth-card:focus { outline: none; }
.auth-page #error { min-height: 22px; margin-top: 13px; color: var(--red); font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; }
.auth-card-footer { margin-top: 10px; padding-top: 21px; border-top: 1px solid var(--border); font-size: 11px; color: var(--muted); line-height: 1.9; }
.auth-page-footer { display: flex; align-items: center; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 24px 0 0; color: var(--muted); font-size: 10px; text-align: center; }
.auth-page-footer span { color: var(--faint); }
.auth-skip-link { position: fixed; top: 12px; left: 12px; z-index: 100; padding: 10px 16px; background: var(--accent); color: var(--accent-ink) !important; border-radius: var(--radius-sm); transform: translateY(-150%); }
.auth-skip-link:focus { transform: none; }
@keyframes auth-enter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 540px) {
  .auth-topbar { padding: 23px 24px; }
  .auth-brand { font-size: 22px; }
  .auth-layout { min-height: calc(100svh - 88px); padding: 18px 18px 32px; }
  .auth-card { padding: 29px 25px 25px; }
  .auth-card h1 { font-size: 25px; }
  .auth-intro { margin-bottom: 25px; }
  .auth-field input { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .auth-card { animation: none; }
  .auth-page *, .auth-page *::before, .auth-page *::after { transition: none !important; }
  .auth-submit:active:not(:disabled), .auth-submit:hover:not(:disabled) svg { transform: none; }
}
