.auth-page {
  display: flex;
  flex-direction: column;
  min-width: 320px;
  min-height: 100dvh;
  background: #fff;
}

.auth-main {
  flex: 1 0 auto;
  width: min(400px, calc(100% - 40px));
  margin: 0 auto;
  padding: 48px 0 80px;
}

.auth-panel {
  width: 100%;
}

.auth-title {
  display: flex;
  width: fit-content;
  align-items: center;
  justify-content: center;
  margin: 0;
  border: none;
  border-radius: 0;
  background: #fff;
  padding: 0;
}
.auth-title-text {
  margin-right: 10px;
  color: var(--brand-primary);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 3px;
  line-height: 1;
}
.auth-title-bars {
  display: flex;
  align-items: center;
  margin-right: 5px;
}
.auth-title-bar {
  height: 25px;
  margin-right: 2px;
  border-radius: 1000px;
  background: var(--brand-primary);
}
.auth-title-bar.is-lg { width: 10px; }
.auth-title-bar.is-md { width: 7px; }
.auth-title-bar.is-sm { width: 4px; margin-right: 0; }

.auth-subtitle {
  margin: 6px 0 28px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
}

[data-auth-form] {
  display: grid;
  gap: 16px;
}

[data-register-only].hidden,
[data-login-only].hidden {
  display: none !important;
}

.auth-label {
  display: block;
  margin-bottom: 6px;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
}

.auth-optional {
  color: var(--text-secondary);
  font-weight: 400;
}

.auth-input {
  width: 100%;
  min-height: 44px;
  border: 1px solid #d8d8d8;
  border-radius: 10px;
  background: #fff;
  padding: 0 14px;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 400;
  outline: none;
}

.auth-input::placeholder { color: #b0b0b0; letter-spacing: 0; }
.auth-input[type="password"] {
  font-family: "Noto Sans", ui-sans-serif, system-ui, sans-serif;
  letter-spacing: .08em;
}
.auth-input:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(158, 54, 32, .14);
}
.auth-input.is-invalid,
.auth-input:user-invalid { border-color: #c2410c; }
.auth-input.is-invalid:focus {
  border-color: #c2410c;
  box-shadow: 0 0 0 3px rgba(194, 65, 12, .12);
}

.auth-field-error {
  margin: 6px 0 0;
  color: #c2410c;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
}

.auth-password-wrap { position: relative; }
.auth-password-wrap .auth-input { padding-right: 46px; }

.auth-password-toggle {
  position: absolute;
  top: 50%;
  right: 6px;
  display: grid;
  width: 32px;
  height: 32px;
  transform: translateY(-50%);
  place-items: center;
  border: 0;
  background: transparent;
  color: #8a8a8a;
}

.auth-password-toggle:hover { color: var(--text-primary); }
.auth-password-toggle .material-symbols-outlined { font-size: 20px; }

.auth-login-options,
.auth-agree {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.auth-remember {
  display: inline-flex;
  align-items: flex-start;
  gap: 8px;
  color: #707070;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.45;
  cursor: pointer;
}

.auth-checkbox {
  width: 16px;
  height: 16px;
  margin-top: 1px;
  flex: 0 0 auto;
  border: 1px solid #c5c5c5;
  border-radius: 3px;
  accent-color: var(--brand-primary);
}

.auth-forgot,
.auth-inline-link,
.auth-legal a,
.auth-resend,
[data-switch-action] {
  color: var(--brand-primary);
  font-weight: 500;
}

.auth-forgot,
.auth-resend,
[data-auth-switch] {
  border: 0;
  background: transparent;
  padding: 0;
}

.auth-forgot {
  font-size: 13px;
}

.auth-forgot:hover,
.auth-inline-link:hover,
.auth-legal a:hover,
.auth-resend:hover,
[data-switch-action]:hover {
  color: var(--brand-primary-dark);
  text-decoration: underline;
}

.auth-google {
  appearance: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  height: 48px;
  margin: 0;
  padding: 0;
  border: 1px solid #E6E6E4;
  border-radius: 16px;
  background: #fff;
  color: #111;
  font: 500 16px/1 "Noto Sans TC", "Noto Sans", -apple-system, BlinkMacSystemFont, "PingFang TC", sans-serif;
  cursor: pointer;
}
.auth-google svg { width: 18px; height: 18px; flex: none; }
.auth-google.is-loading { position: relative; color: transparent; pointer-events: none; }
.auth-google.is-loading .loading-dot {
  position: absolute;
  top: 50%;
  width: 6px;
  height: 6px;
  margin-top: -3px;
  border-radius: 50%;
  background: #111;
  animation: auth-dot .9s infinite ease-in-out;
}
.auth-google.is-loading .loading-dot:nth-child(1) { left: calc(50% - 14px); }
.auth-google.is-loading .loading-dot:nth-child(2) { left: calc(50% - 3px); animation-delay: .15s; }
.auth-google.is-loading .loading-dot:nth-child(3) { left: calc(50% + 8px); animation-delay: .3s; }
@keyframes auth-dot {
  0%, 80%, 100% { opacity: .25; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-4px); }
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0 4px;
  color: #9a9a9a;
  font-size: 12px;
  font-weight: 400;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #E6E6E4;
}

.oauth-callback .oauth-status {
  margin: 80px 0 0;
  color: var(--text-secondary);
  font-size: 15px;
  text-align: center;
}

.auth-submit {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 44px;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: var(--brand-primary);
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
}

.auth-submit:hover { background: var(--brand-primary-dark); }
.auth-submit:disabled,
.auth-submit.is-busy {
  color: transparent;
  pointer-events: none;
}
.auth-submit:disabled::after,
.auth-submit.is-busy::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 18px;
  height: 18px;
  margin: auto;
  border: 2px solid rgba(255, 255, 255, .35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: auth-spin .6s linear infinite;
}
@keyframes auth-spin { to { transform: rotate(360deg); } }

.auth-legal {
  margin: 14px 0 0;
  color: #9a9a9a;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.7;
}

.auth-status {
  display: block;
  margin: 0 0 16px;
  color: var(--brand-primary);
  font-size: 28px;
  line-height: 1;
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}
.auth-status.is-error { color: #c2410c; }

.auth-verify-note,
.auth-legal {
  margin: 14px 0 0;
  color: #9a9a9a;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.7;
}

.auth-switch {
  margin-top: 22px;
  text-align: center;
}

.auth-switch-link {
  color: #707070;
  font-size: 13px;
  font-weight: 400;
  text-decoration: none;
}

[data-auth-switch] {
  color: #707070;
  font-size: 13px;
  font-weight: 400;
}

[data-switch-action] { margin-left: 4px; }

.auth-resend {
  width: 100%;
  margin-top: 16px;
  text-align: left;
  font-size: 13px;
  font-weight: 400;
  color: #707070;
}
.auth-resend-link {
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--brand-primary);
  font-size: 13px;
  font-weight: 500;
}
.auth-resend-link:hover { color: var(--brand-primary-dark); text-decoration: underline; }
.auth-resend-link:disabled {
  cursor: not-allowed;
  color: #9a9a9a;
  text-decoration: none;
}

.auth-message {
  display: block;
  margin-top: 2px;
  color: #c2410c;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
}
.auth-message-error { color: #c2410c; }
.auth-message-success { color: #15803d; }

@media (max-width: 639px) {
  .auth-main { padding: 32px 0 64px; }
  .auth-title-text { font-size: 20px; letter-spacing: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-input,
  .auth-submit { transition: none; }
  .auth-google.is-loading .loading-dot { animation: none; opacity: .7; }
}

.queue-page {
  min-width: 320px;
  background: #fff;
}

.queue-main {
  width: min(520px, calc(100% - 40px));
  margin: 0 auto;
  padding: 48px 0 80px;
}

.queue-panel {
  width: 100%;
}

.queue-icon {
  display: block;
  margin: 0 0 16px;
  color: var(--brand-primary);
  font-size: 32px;
  line-height: 1;
}

.queue-panel h1 {
  margin: 0;
  color: var(--text-primary);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.35;
}

.queue-description {
  margin: 10px 0 0;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.75;
}

.queue-actions {
  margin-top: 24px;
}

.queue-primary {
  display: inline-flex;
  width: 100%;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 9999px;
  background: #ea580c;
  padding: 14px 16px;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
}

.queue-primary .site-nav-glyph {
  width: 8px;
  height: 18px;
  flex: 0 0 auto;
}

.queue-primary:hover {
  background: #dc4a05;
}

.queue-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 24px;
  color: var(--text-secondary);
}

.queue-note > .material-symbols-outlined {
  margin-top: 1px;
  color: var(--brand-primary);
  font-size: 20px;
}

.queue-note strong {
  display: block;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 700;
}

.queue-note p {
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 1.7;
}

.queue-process {
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid #f0f0f0;
}

.queue-process-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
}

.queue-process-heading .site-nav-deco {
  width: 14px;
  height: 18px;
  flex: 0 0 auto;
  object-fit: contain;
}

.queue-process-heading h2 {
  margin: 0;
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
}

.queue-process ol {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.queue-process li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.queue-process li > span {
  flex: 0 0 auto;
  min-width: 1.2em;
  color: #ea580c;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
}

.queue-process strong {
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 700;
}

.queue-process p {
  margin: 4px 0 0;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.7;
}

@media (max-width: 639px) {
  .queue-main {
    padding: 32px 0 64px;
  }

  .queue-panel h1 {
    font-size: 22px;
  }
}
