/* Shared by the React app and server-rendered authentication pages. No CDN. */
:root {
  color-scheme: light;
  --ui-bg: #f5f5f7;
  --ui-surface: #fff;
  --ui-soft: #f7f8fa;
  --ui-hover: #f0f2f5;
  --ui-text: #1d1d1f;
  --ui-secondary: #565963;
  --ui-muted: #6e717a;
  --ui-border: #dfe2e8;
  --ui-divider: #e9eaee;
  --ui-primary: #0071e3;
  --ui-primary-hover: #0064ca;
  --ui-primary-soft: #edf5ff;
  --ui-success: #187347;
  --ui-success-soft: #ecf8f1;
  --ui-warning: #946000;
  --ui-warning-soft: #fff7e6;
  --ui-danger: #be3030;
  --ui-danger-soft: #fff0f0;
  --ui-radius: 16px;
  --ui-shadow: 0 5px 24px rgba(25,35,55,.06);
  --ui-font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}
.auth-page, .auth-page * { box-sizing: border-box; }
.auth-page {
  margin: 0; min-height: 100vh; min-height: 100dvh; padding: 40px 20px;
  display: flex; align-items: center; justify-content: center;
  background: var(--ui-bg); color: var(--ui-text); font: 14px/1.6 var(--ui-font);
  -webkit-font-smoothing: antialiased;
}
.auth-page :is(h1,h2,h3,p) { margin: 0; overflow-wrap: anywhere; }
.auth-page :is(.container,.login-container,.consent-container) { width: 100%; max-width: 440px; }
.auth-page :is(.card,.login-card,.consent-card,.error-box) {
  width: 100%; max-width: 480px; padding: 36px; border: 1px solid var(--ui-divider);
  border-radius: var(--ui-radius); background: var(--ui-surface); box-shadow: var(--ui-shadow);
}
.auth-page :is(.brand,.app-info) { text-align: center; margin-bottom: 28px; }
.auth-page :is(.brand-icon,.app-logo,.icon-wrap) {
  width: 52px; height: 52px; margin: 0 auto 18px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  background: var(--ui-primary-soft); color: var(--ui-primary); font-size: 24px;
}
.auth-page .brand-icon { background: linear-gradient(135deg,#0071e3,#516ae8); color: #fff; }
.auth-page :is(.brand-icon,.icon-wrap) svg { width: 26px; height: 26px; stroke: currentColor; stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.auth-page .app-logo img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.auth-page :is(h1,h2) { font-size: 24px; line-height: 1.4; font-weight: 700; letter-spacing: -.5px; }
.auth-page :is(.brand p,.app-info p,.description) { color: var(--ui-secondary); font-size: 13px; margin-top: 8px; }
.auth-page .form-group { margin-bottom: 18px; }
.auth-page label { display: block; margin-bottom: 7px; font-weight: 500; }
.auth-page input:not([type=hidden]) {
  display: block; width: 100%; min-height: 44px; padding: 11px 13px;
  border: 1px solid var(--ui-border); border-radius: 9px; background: var(--ui-surface);
  color: var(--ui-text); font: inherit; transition: border-color .15s, box-shadow .15s;
}
.auth-page input::placeholder { color: var(--ui-muted); }
.auth-page input:focus { border-color: var(--ui-primary); outline: none; box-shadow: 0 0 0 3px var(--ui-primary-soft); }
.auth-page :is(button,a,input):focus-visible { outline: 3px solid #99c9fb; outline-offset: 3px; }
.auth-page :is(.submit-btn,.retry-btn,.btn) {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 11px 20px;
  border: 1px solid transparent; border-radius: 9px; background: var(--ui-primary);
  color: #fff; font: 600 14px/1.5 var(--ui-font); cursor: pointer; text-decoration: none;
}
.auth-page .submit-btn { width: 100%; margin-top: 6px; }
.auth-page :is(.submit-btn,.retry-btn,.btn-confirm):hover { background: var(--ui-primary-hover); }
.auth-page .btn-deny { color: var(--ui-secondary); border-color: var(--ui-border); background: var(--ui-surface); }
.auth-page .btn-deny:hover { background: var(--ui-hover); }
.auth-page a { color: var(--ui-primary); text-decoration: none; }
.auth-page a:hover { text-decoration: underline; }
.auth-page .retry-btn { margin: 24px 0 8px; color: #fff; }
.auth-page .alt-link { text-align: center; margin-top: 22px; color: var(--ui-secondary); font-size: 13px; }
.auth-page .alt-link a { margin-left: 4px; }
.auth-page .footer { margin-top: 28px; text-align: center; color: var(--ui-muted); font-size: 12px; }
.auth-page :is(.flash-error,.flash-success,.hint) { padding: 12px 14px; margin: 0 0 20px; border-radius: 9px; font-size: 13px; overflow-wrap: anywhere; }
.auth-page .flash-error { background: var(--ui-danger-soft); color: var(--ui-danger); }
.auth-page .flash-success { background: var(--ui-success-soft); color: var(--ui-success); }
.auth-page .hint { background: var(--ui-soft); color: var(--ui-secondary); }
.auth-page .section-label { font-size: 12px; color: var(--ui-muted); margin-bottom: 10px; }
.auth-page .account-list { display: grid; gap: 10px; }
.auth-page :is(.account-item,.other-account) {
  display: flex; gap: 12px; align-items: center; width: 100%; padding: 14px; text-align: left;
  border: 1px solid var(--ui-border); border-radius: 10px; background: var(--ui-surface);
  color: var(--ui-text); font: inherit; cursor: pointer;
}
.auth-page :is(.account-item,.other-account):hover { background: var(--ui-primary-soft); border-color: var(--ui-primary); }
.auth-page :is(.account-avatar,.other-icon) { flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%; background: var(--ui-primary-soft); color: var(--ui-primary); display: flex; align-items: center; justify-content: center; font-weight: 600; overflow: hidden; }
.auth-page .account-avatar img { width: 100%; height: 100%; object-fit: cover; }
.auth-page .account-info { flex: 1; min-width: 0; }
.auth-page .account-name { font-weight: 600; overflow-wrap: anywhere; }
.auth-page .account-email { font-size: 12px; color: var(--ui-muted); overflow-wrap: anywhere; }
.auth-page .account-arrow { width: 18px; height: 18px; flex-shrink: 0; color: var(--ui-muted); }
.auth-page .other-icon svg { width: 22px; height: 22px; stroke: currentColor; fill: none; }
.auth-page .divider { display: flex; gap: 14px; align-items: center; margin: 20px 0; color: var(--ui-muted); font-size: 12px; }
.auth-page .divider::before,.auth-page .divider::after { content: ''; flex: 1; height: 1px; background: var(--ui-divider); }
.auth-page .hidden-form { display: none; }
.auth-page .request-text { color: var(--ui-secondary); text-align: center; margin-bottom: 20px; }
.auth-page .scope-list { list-style: none; margin: 0 0 26px; padding: 0; }
.auth-page .scope-item { display: flex; gap: 12px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--ui-divider); }
.auth-page .scope-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 9px; background: var(--ui-primary-soft); }
.auth-page .scope-name { color: var(--ui-muted); font-size: 12px; }
.auth-page .btn-group { display: flex; gap: 12px; }
.auth-page .status-card, .auth-page .error-box { text-align: center; }
.auth-page .error-box h1 { margin-bottom: 16px; }
.auth-page .error-box > p { color: var(--ui-secondary); }
.auth-page .status-error { color: var(--ui-danger); background: var(--ui-danger-soft); }
.auth-page .error-details { margin-top: 20px; color: var(--ui-secondary); text-align: left; font-size: 13px; }
.auth-page .error-details summary { cursor: pointer; }
.auth-page pre { margin: 10px 0 0; padding: 16px; border-radius: 9px; background: var(--ui-soft); overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; }
.ui-spinner { display: inline-block; width: 30px; height: 30px; border: 3px solid var(--ui-border); border-top-color: var(--ui-primary); border-radius: 50%; animation: ui-spin .8s linear infinite; }
@keyframes ui-spin { to { transform: rotate(360deg); } }
@media (max-width: 480px) {
  .auth-page { padding: 24px 16px; }
  .auth-page :is(.card,.login-card,.consent-card,.error-box) { padding: 28px 22px; }
  .auth-page input:not([type=hidden]) { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
