@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
  --id-bg: #f6f8fb;
  --id-surface: #ffffff;
  --id-border: #e2e8f0;
  --id-ink: #0f172a;
  --id-subtle: #475569;
  --id-accent: #2563eb;
  --id-accent-strong: #1d4ed8;
}

body.id-body {
  min-height: 100vh;
  margin: 0;
  color: var(--id-ink);
  background: var(--id-bg);
  font-family: 'Space Grotesk', 'Segoe UI', sans-serif;
}

.id-nav {
  background: rgba(255, 255, 255, 0.92) !important;
  border-color: rgba(15, 23, 42, 0.08) !important;
  backdrop-filter: blur(8px);
}

.id-nav .navbar-brand,
.id-nav .nav-link,
.id-nav .secondary-color {
  color: #0f172a !important;
}

.id-nav .navbar-brand {
  font-weight: 600;
  letter-spacing: .01em;
}

.icon-banner {
  width: 32px;
}

.body-container {
  margin-top: 18px;
  padding-bottom: 28px;
}

.body-container-no-nav {
  margin-top: 0;
}

.id-auth-shell {
  min-height: calc(100vh - 120px);
  display: grid;
  place-items: center;
  position: relative;
}

.id-auth-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(15, 23, 42, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(15, 23, 42, .035) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(72% 72% at 50% 28%, black, transparent);
  pointer-events: none;
}

.id-auth-grid {
  width: min(1080px, 96vw);
  display: grid;
  grid-template-columns: 1.02fr .98fr;
  gap: 1rem;
  position: relative;
  z-index: 1;
}

.id-auth-card,
.id-auth-side,
.id-logout-card {
  border: 1px solid var(--id-border);
  border-radius: 12px;
  background: var(--id-surface);
  box-shadow: 0 10px 30px rgba(15, 23, 42, .08);
}

.id-auth-card {
  padding: clamp(1.1rem, 2.6vw, 1.9rem);
  animation: idRise .5s ease forwards;
}

.id-auth-card-centered {
  width: min(580px, 94vw);
  margin: 0 auto;
}

.id-auth-side {
  padding: clamp(1.1rem, 2.6vw, 1.9rem);
  display: flex;
  align-items: center;
  animation: idRise .5s ease .08s forwards;
  opacity: 0;
  transform: translateY(12px);
}

.id-auth-side-content h2 {
  margin: 0 0 .65rem;
  font-size: clamp(1.35rem, 2.3vw, 1.8rem);
}

.id-auth-side-content p {
  color: var(--id-subtle);
  margin-bottom: .75rem;
}

.id-auth-usecases {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin: 0 0 .8rem;
}

.id-auth-usecases span {
  border: 1px solid rgba(37, 99, 235, .26);
  border-radius: 999px;
  background: rgba(37, 99, 235, .07);
  color: #1e3a8a;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .01em;
  padding: .25rem .58rem;
}

.id-auth-side-content ul {
  padding-left: 1rem;
  margin: 0;
  color: #334155;
}

.id-auth-side-content li {
  margin-bottom: .35rem;
}

.id-auth-header {
  margin-bottom: .8rem;
}

.id-auth-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.id-auth-logo img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  flex-shrink: 0;
}

.id-auth-logo-minimal img {
  width: auto;
  height: 56px;
  transform: none;
}

.id-auth-logo-minimal {
  width: auto;
  height: auto;
  margin: 0 auto 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: visible;
}

.id-auth-logo span {
  font-size: 1.5rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.id-auth-logo-centered {
  justify-content: center;
}

.id-auth-kicker {
  margin: .75rem 0 .3rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .72rem;
  font-weight: 700;
  color: #1d4ed8;
}

.id-auth-header h1 {
  margin: 0;
  font-size: clamp(1.7rem, 3vw, 2.2rem);
}

.id-auth-subtitle {
  margin: .4rem 0 0;
  color: var(--id-subtle);
}

.id-auth-form-compact {
  max-width: 500px;
  margin: 0 auto;
}

.id-auth-form label {
  font-weight: 600;
  color: #0f172a;
}

.id-input {
  border-radius: 8px;
  border-color: #cbd5e1;
  background: #ffffff;
  color: #0f172a;
}

.id-input:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 .2rem rgba(37, 99, 235, .14);
  background: #ffffff;
  color: #0f172a;
}

.id-input::placeholder {
  color: #64748b;
}

.id-input-minimal {
  border-radius: 0;
  border: none;
  border-bottom: 1px solid rgba(148, 163, 184, .7);
  background: transparent;
  padding-left: 0;
  padding-right: 0;
}

.id-input-minimal:focus {
  box-shadow: none;
  border-bottom-color: #2563eb;
  background: transparent;
}

.id-input-minimal option {
  color: #0f172a;
}

.id-auth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin-top: .2rem;
}

.id-auth-actions-stack {
  display: grid;
  grid-template-columns: 1fr;
}

.id-btn-primary,
.id-btn-ghost,
.id-btn-provider {
  border-radius: 8px;
  font-weight: 600;
  min-width: 135px;
}

.id-btn-full {
  width: 100%;
}

.id-btn-primary {
  background: var(--id-accent);
  border: 1px solid var(--id-accent);
  color: #fff;
  transition: background-color .16s ease, box-shadow .16s ease;
}

.id-btn-primary:hover {
  background: var(--id-accent-strong);
  color: #fff;
  box-shadow: 0 6px 18px rgba(37, 99, 235, .24);
}

.id-btn-ghost,
.id-btn-provider {
  background: rgba(255, 255, 255, .95);
  border: 1px solid rgba(148, 163, 184, 0.5);
  color: #0f172a;
  transition: transform .16s ease, background-color .16s ease;
}

.id-btn-ghost:hover,
.id-btn-provider:hover {
  background: rgba(241, 245, 249, 1);
  color: #0f172a;
  transform: translateY(-1px);
}

.id-auth-links {
  margin-top: .8rem;
}

.id-auth-links a {
  color: #2563eb;
  text-decoration: none;
}

.id-auth-links a:hover {
  color: #1d4ed8;
  text-decoration: none;
}

.id-auth-disclaimer {
  margin: .85rem 0 0;
  color: #64748b;
  font-size: .8rem;
  line-height: 1.35;
}

.id-auth-footer-text {
  margin: .95rem 0 0;
  text-align: center;
  color: #64748b;
  font-size: .82rem;
}

.id-auth-footer-text a {
  color: #2563eb;
  text-decoration: none;
}

.id-auth-footer-text a:hover {
  color: #1d4ed8;
}

.id-validation-summary {
  margin: 0 0 .9rem;
  padding: .8rem .9rem;
  border-radius: 12px;
  border: 1px solid rgba(220, 38, 38, .25);
  background: rgba(254, 242, 242, .95);
}

.id-validation-title {
  margin: 0 0 .4rem;
  color: #b91c1c;
  font-weight: 600;
  font-size: .9rem;
}

.id-validation-items ul {
  margin: 0;
  padding-left: 1rem;
}

.id-validation-items li {
  color: #7f1d1d;
  margin-bottom: .2rem;
}

.field-validation-error {
  color: #b91c1c;
  font-size: .78rem;
  display: inline-block;
  margin-top: .25rem;
}

.input-validation-error,
.id-input.input-validation-error,
.id-input-minimal.input-validation-error {
  border-bottom-color: #ff7aa2 !important;
  box-shadow: 0 1px 0 0 #ff7aa2 !important;
}

.validation-summary-valid {
  display: none;
}

.id-external-divider {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin: .95rem 0 .7rem;
  color: #64748b;
  font-size: .9rem;
}

.id-external-divider::before,
.id-external-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: rgba(148, 163, 184, .45);
}

.id-external-list {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.id-logout-card {
  width: min(560px, 94vw);
  padding: clamp(1.25rem, 3vw, 2.1rem);
  text-align: center;
  animation: idRise .45s ease forwards;
}

.id-logout-card h1 {
  margin: .15rem 0 .6rem;
}

.id-auth-message {
  width: min(560px, 94vw);
}

.id-auth-message .id-btn-full {
  margin-top: .75rem;
}

.id-auth-form .btn {
  min-width: 160px;
}

.logged-out-page iframe,
.signout {
  display: none;
  width: 0;
  height: 0;
}

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

@media (max-width: 992px) {
  .id-auth-grid {
    grid-template-columns: 1fr;
  }

  .id-auth-side {
    order: -1;
  }
}

@media (max-width: 576px) {
  .id-auth-logo img {
    width: 50px;
    height: 50px;
  }

  .id-auth-logo-minimal img {
    width: auto;
    height: 48px;
    transform: none;
  }

  .id-auth-logo-minimal {
    width: auto;
    height: auto;
  }

  .id-auth-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .id-btn-primary,
  .id-btn-ghost,
  .id-btn-provider {
    width: 100%;
  }
}

.welcome-page .logo {
  width: 64px;
}

.welcome-page li {
  list-style: none;
  padding: 4px;
}

.grants-page .card {
  margin-top: 20px;
  border-bottom: 1px solid lightgray;
}

.grants-page .card .card-title {
  font-size: 120%;
  font-weight: bold;
}

.grants-page .card .card-title img {
  width: 100px;
  height: 100px;
}

.grants-page .card label {
  font-weight: bold;
}
