:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #17191f;
  background: #f5f7fb;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(circle at 50% 0, rgba(74, 111, 230, .08), transparent 32rem),
    #f5f7fb;
  overflow-x: hidden;
}

.ambient { display: none; }

.page-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.signin-card,
.denied-card {
  width: min(408px, 100%);
  padding: 40px;
  border: 1px solid rgba(23, 25, 31, .08);
  border-radius: 24px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 24px 70px rgba(26, 38, 72, .09), 0 2px 8px rgba(26, 38, 72, .03);
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: fit-content;
  margin: 0 auto;
  color: #17191f;
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -.025em;
  text-decoration: none;
}

.brand-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  border: 1px solid #dfe6fb;
  border-radius: 18px;
  background: linear-gradient(145deg, #f8faff, #edf2ff);
  box-shadow: 0 10px 28px rgba(65, 98, 205, .12);
}

.brand-icon img {
  display: none;
}

.brand-icon::before {
  content: "";
  width: 34px;
  height: 34px;
  background: #4b74e6;
  -webkit-mask: url("/favicon.svg") center / contain no-repeat;
  mask: url("/favicon.svg") center / contain no-repeat;
}

.access-label {
  width: fit-content;
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 12px auto 0;
  color: #7f8798;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.access-label span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #4b74e6;
  box-shadow: 0 0 0 3px rgba(75, 116, 230, .1);
}

.signin-panel {
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid #eceef3;
}

.clerk-seat {
  width: 100%;
  min-height: 44px;
}

.loader {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.loader span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4b74e6;
  animation: pulse 1s ease-in-out infinite;
}

.loader span:nth-child(2) { animation-delay: .14s; }
.loader span:nth-child(3) { animation-delay: .28s; }

@keyframes pulse {
  0%, 100% { opacity: .22; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-4px); }
}

.auth-error {
  margin: 14px 0 0;
  color: #b23b45;
  font-size: 12px;
  text-align: center;
}

.denied-content {
  margin: 42px 0 32px;
  text-align: center;
}

.denied-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 24px;
  margin-bottom: 16px;
  padding: 0 9px;
  border: 1px solid #eadcdf;
  border-radius: 999px;
  color: #ad515c;
  background: #fff8f8;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: .06em;
}

.denied-content h1 {
  margin: 0;
  font-size: 23px;
  font-weight: 650;
  letter-spacing: -.035em;
}

.denied-content p {
  margin: 10px 0 0;
  color: #8a91a0;
  font-size: 13px;
}

.denied-content strong {
  color: #555c6a;
  font-weight: 550;
}

.denied-content .access-label { margin-top: 18px; }

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding-top: 26px;
  border-top: 1px solid #eceef3;
}

.actions a,
.actions button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 11px;
  font: inherit;
  font-size: 13px;
  font-weight: 620;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .16s ease, border-color .16s ease, transform .16s ease;
}

.actions a:active,
.actions button:active { transform: translateY(1px); }

.primary-action {
  border: 1px solid #17191f;
  color: #fff;
  background: #17191f;
}

.primary-action:hover { background: #30333b; }

.secondary-action {
  border: 1px solid #dfe2e9;
  color: #555c6a;
  background: #fff;
}

.secondary-action:hover { background: #f7f8fa; }

.redirect-note {
  margin: 18px 0 0;
  color: #a0a6b2;
  font-size: 10px;
  text-align: center;
}

.redirect-note b {
  color: inherit;
  font-weight: 550;
}

.compact { text-align: center; }
.compact .brand { margin-bottom: 40px; }
.compact .denied-symbol {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin: 0 auto 18px;
  border-radius: 14px;
  color: #9d6d18;
  background: #fff7e7;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
}
.compact .eyebrow { display: none; }
.compact h1 { margin: 0; font-size: 23px; }
.compact .denied-copy { color: #8a91a0; font-size: 13px; }
.compact .actions { grid-template-columns: 1fr; }

@media (max-width: 520px) {
  .page-shell { padding: 16px; }
  .signin-card,
  .denied-card { padding: 32px 24px; border-radius: 20px; }
  .brand-icon { width: 54px; height: 54px; border-radius: 16px; }
  .actions { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}
