/* Shared branding and login dialog for all site surfaces. */
.auth-modal {
  --primary: #ef4444;
  --accent: #0ea5e9;
  --foreground: #162338;
  --muted-foreground: #6f7f95;
  --border: rgba(15, 23, 42, 0.1);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html.auth-modal-open,
body.auth-modal-open {
  overflow: hidden;
  overscroll-behavior: none;
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 24px;
  opacity: 0;
  transition: opacity 180ms ease;
}

.auth-modal[hidden] {
  display: none;
}

.auth-modal.is-open {
  opacity: 1;
}

.auth-modal__backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  border: 0;
  background: rgba(9, 18, 31, 0.56);
  backdrop-filter: blur(12px) saturate(0.82);
  cursor: default;
}

.auth-modal__dialog {
  position: relative;
  width: min(520px, 100%);
  height: min(620px, calc(100dvh - 48px));
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 34px 100px rgba(4, 12, 24, 0.38);
  transform: translateY(12px) scale(0.985);
  transition: transform 220ms ease;
}

.auth-modal.is-open .auth-modal__dialog {
  transform: translateY(0) scale(1);
}

.auth-modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  color: var(--foreground);
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease;
}

.auth-modal__brand {
  position: absolute;
  top: 16px;
  left: 22px;
  z-index: 3;
  display: flex;
  align-items: center;
  height: 42px;
  font-size: 24px;
  font-weight: 900;
}

.auth-modal__close:hover {
  background: var(--primary);
  color: #fff;
}

.auth-modal__close:focus-visible {
  outline: 3px solid rgba(14, 165, 233, 0.55);
  outline-offset: 3px;
}

.auth-modal__close svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.auth-modal__loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  place-items: center;
  align-items: center;
  justify-content: center;
  color: var(--muted-foreground);
  font-size: 14px;
}

.auth-modal__spinner {
  width: 38px;
  height: 38px;
  border: 3px solid rgba(14, 165, 233, 0.18);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: auth-modal-spin 720ms linear infinite;
}

@keyframes auth-modal-spin {
  to { transform: rotate(360deg); }
}

.auth-modal.is-loaded .auth-modal__loading {
  display: none;
}

.auth-modal__frame {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  opacity: 0;
  background: #fff;
  transition: opacity 160ms ease;
}

.auth-modal.is-loaded .auth-modal__frame {
  opacity: 1;
}

@media (max-width: 560px) {
  .auth-modal {
    padding: 0;
  }

  .auth-modal__dialog {
    width: 100%;
    height: 100dvh;
    border: 0;
    border-radius: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-modal,
  .auth-modal__dialog,
  .auth-modal__frame {
    transition: none;
  }
}

.ai168-wordmark {
  display: inline-flex;
  align-items: baseline;
  color: #ef4444;
  font: inherit;
  font-weight: 900;
  letter-spacing: -0.055em;
  line-height: 1;
  white-space: nowrap;
}

.ai168-wordmark__ai {
  color: #ef4444;
}

.ai168-wordmark__number {
  margin-left: 0.04em;
  color: #0ea5e9;
}

