:root {
  --navy: #0b1a3a;
  --navy-deep: #06101f;
  --cyan: #00a3d4;
  --ink: #f7fafc;
  --font: "Outfit", "Segoe UI", system-ui, sans-serif;
  --display: "Syne", "Outfit", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  color: var(--ink);
  background: var(--navy-deep);
}

a { color: #9fe3f5; }

.sso {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: clamp(4.5rem, 10vh, 6.5rem) clamp(1.25rem, 4vw, 3rem) clamp(2rem, 5vh, 3rem);
  background:
    radial-gradient(ellipse 70% 50% at 50% 18%, rgba(0, 163, 212, 0.18), transparent 68%),
    linear-gradient(165deg, var(--navy-deep) 0%, var(--navy) 48%, var(--navy-deep) 100%);
}

.sso-content {
  position: relative;
  z-index: 2;
  width: min(26rem, 100%);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
}

.sso-crest {
  width: clamp(7.5rem, 22vw, 10rem);
  height: auto;
  filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.35));
  animation: ssoRise 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.sso-kicker {
  margin: 0.2rem 0 0;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cyan);
  font-weight: 600;
  animation: ssoRise 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.08s both;
}

.sso-brand {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.4rem, 8vw, 3.8rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
  color: #fff;
  animation: ssoRise 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.14s both;
}

.sso-brand span { color: var(--cyan); }

.sso-lead {
  margin: 0;
  max-width: 22rem;
  font-size: clamp(1rem, 2.4vw, 1.1rem);
  line-height: 1.45;
  color: rgba(247, 250, 252, 0.78);
  animation: ssoRise 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.2s both;
}

.sso-status {
  display: none;
  margin: 0.35rem 0 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: rgba(247, 250, 252, 0.9);
}

/* Microsoft preferred / return: skip cafe chrome; plain navy while redirecting */
html.sso-passthrough,
html.sso-passthrough body {
  background: #06101f;
}

html.sso-passthrough .sso-crest,
html.sso-passthrough .sso-kicker,
html.sso-passthrough .sso-brand,
html.sso-passthrough .sso-lead,
html.sso-passthrough .sso-actions,
html.sso-passthrough .sso-legal {
  display: none !important;
}

html.sso-passthrough .sso-status {
  display: block;
  animation: ssoRise 0.45s ease both;
}

html.sso-passthrough-error .sso-status {
  display: none;
}

.sso-actions {
  margin-top: 1rem;
  width: min(20rem, 100%);
  display: grid;
  gap: 0.75rem;
  justify-items: stretch;
  animation: ssoRise 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.28s both;
}

.google-host {
  position: absolute;
  left: -10000px;
  width: 280px;
  height: 44px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.provider-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  min-height: 44px;
  padding: 0.7rem 1rem;
  border-radius: 4px;
  border: 1px solid transparent;
  font-family: "Roboto", "Helvetica Neue", Arial, sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.provider-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.provider-btn-icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.provider-btn-icon svg {
  display: block;
  width: 18px;
  height: 18px;
}

.provider-btn-google {
  background: #fff;
  color: #1f1f1f;
  border-color: #747775;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.15);
}

.provider-btn-google:hover {
  background: #f7f8f8;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.25);
}

.provider-btn-apple {
  background: #000;
  color: #fff;
  border-color: #000;
}

.provider-btn-apple:hover {
  background: #1a1a1a;
}

.provider-btn-microsoft {
  background: #fff;
  color: #5e5e5e;
  border-color: #8c8c8c;
}

.provider-btn-microsoft:hover {
  background: #f7f8f8;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.25);
}

.sso-legal {
  margin: 0.85rem 0 0;
  font-size: 0.8rem;
  color: rgba(247, 250, 252, 0.58);
  max-width: 22rem;
  animation: ssoRise 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.34s both;
}

.sso-legal a { color: #9fe3f5; }

.error {
  margin: 0.35rem 0 0;
  color: #ffb4b4;
  background: rgba(155, 28, 28, 0.25);
  border: 1px solid rgba(255, 180, 180, 0.35);
  padding: 0.55rem 0.8rem;
  width: min(22rem, 100%);
}

@keyframes ssoRise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .sso-crest,
  .sso-kicker,
  .sso-brand,
  .sso-lead,
  .sso-actions,
  .sso-legal {
    animation: none;
  }
}
