:root {
  --brand-accent: #4f46e5;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  background-color: #f0f2f5;
  color: #1a1a2e;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  margin: 0;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.auth-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem 1rem;
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
  text-decoration: none;
}
.auth-brand img {
  height: 32px;
  width: auto;
}
.auth-brand span {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1a1a2e;
  letter-spacing: -0.02em;
}

.auth-card {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 4px 24px rgba(0, 0, 0, 0.04);
  border: 1px solid #e5e7eb;
  width: 100%;
  max-width: 440px;
  padding: 2.5rem 2rem;
}

.auth-card-wide {
  max-width: 640px;
}

.auth-header {
  text-align: center;
  margin-bottom: 1.75rem;
}
.auth-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1a1a2e;
  margin: 0 0 0.375rem;
  letter-spacing: -0.02em;
}
.auth-header p {
  color: #6b7280;
  font-size: 0.9375rem;
  margin: 0;
}

.auth-footer {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.875rem;
  color: #6b7280;
}
.auth-footer a {
  color: var(--brand-accent);
  text-decoration: none;
  font-weight: 500;
}
.auth-footer a:hover {
  text-decoration: underline;
}

/* The line on the registration page, and under the sign-in page's external sign-ins, that links the app's terms and privacy pages. */
.auth-consent {
  font-size: 0.8125rem;
  line-height: 1.5;
  color: #6b7280;
  margin: 0;
}
.auth-consent a {
  color: var(--brand-accent);
  text-decoration: underline;
}

.auth-email-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 0.625rem 0.875rem;
  font-size: 0.9rem;
  color: #1a1a2e;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hidden {
  display: none !important;
}

.auth-form .form-group {
  margin-bottom: 1.25rem;
}
.auth-form label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #1a1a2e;
  margin-bottom: 0.375rem;
}
.auth-form .form-control {
  display: block;
  width: 100%;
  padding: 0.625rem 0.875rem;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: #1a1a2e;
  background-color: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
}
.auth-form .form-control::placeholder {
  color: #9ca3af;
}
.auth-form .form-control:focus {
  border-color: var(--brand-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-accent) 25%, transparent);
}
.auth-form .form-control:disabled {
  background-color: #f0f2f5;
  cursor: not-allowed;
  opacity: 0.7;
}
.auth-form .form-control.form-control-static {
  background-color: #f0f2f5;
}
.auth-form .form-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.auth-form .form-check .form-check-input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--brand-accent);
  margin: 0;
}
.auth-form .form-check .form-check-label {
  font-size: 0.875rem;
  color: #6b7280;
  margin-bottom: 0;
  font-weight: 400;
}

.btn-auth-primary, .btn-auth-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.625rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #fff;
  background-color: var(--brand-accent);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
  text-decoration: none;
}
.btn-auth-primary:hover, .btn-auth-danger:hover {
  background-color: color-mix(in srgb, var(--brand-accent) 85%, #000);
}
.btn-auth-primary:active, .btn-auth-danger:active {
  transform: scale(0.985);
}

.btn-auth-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.625rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #1a1a2e;
  background-color: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
  text-decoration: none;
}
.btn-auth-secondary:hover {
  background-color: #f0f2f5;
  border-color: #d1d5db;
}

.btn-auth-danger {
  background-color: #ef4444;
}
.btn-auth-danger:hover {
  background-color: rgb(235.7842364532, 30.4157635468, 30.4157635468);
}

.btn-auth-link {
  background: none;
  border: none;
  color: var(--brand-accent);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
  text-decoration: none;
}
.btn-auth-link:hover {
  text-decoration: underline;
}

.auth-btn-row {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}
.auth-btn-row > * {
  flex: 1;
}

.auth-btn-stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.auth-alert, .auth-alert-warning, .auth-alert-success, .auth-alert-info, .auth-alert-error {
  padding: 0.875rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  margin-bottom: 1.25rem;
}
.auth-alert strong, .auth-alert-warning strong, .auth-alert-success strong, .auth-alert-info strong, .auth-alert-error strong {
  display: block;
  margin-bottom: 0.25rem;
}
.auth-alert ul, .auth-alert-warning ul, .auth-alert-success ul, .auth-alert-info ul, .auth-alert-error ul {
  margin: 0.25rem 0 0;
  padding-left: 1.25rem;
}

.auth-alert-error {
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  color: rgb(212.3325123153, 18.1674876847, 18.1674876847);
}

.auth-alert-info {
  background-color: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
}

.auth-alert-success {
  background-color: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: rgb(7.8805970149, 91.1194029851, 63.5373134328);
}

.auth-alert-warning {
  background-color: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}

.auth-divider {
  display: flex;
  align-items: center;
  margin: 1.5rem 0;
  color: #6b7280;
  font-size: 0.8125rem;
}
.auth-divider::before, .auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background-color: #e5e7eb;
}
.auth-divider span {
  padding: 0 0.75rem;
}

.auth-providers {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.btn-auth-provider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.625rem 1rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: #1a1a2e;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}
.btn-auth-provider:hover {
  background-color: #f0f2f5;
  border-color: #d1d5db;
}

.scope-section {
  margin-bottom: 1.25rem;
}
.scope-section .scope-section-title {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7280;
  margin-bottom: 0.5rem;
}
.scope-section .scope-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
}
.scope-section .scope-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e5e7eb;
}
.scope-section .scope-item:last-child {
  border-bottom: none;
}
.scope-section .scope-item input[type=checkbox] {
  margin-top: 0.25rem;
  accent-color: var(--brand-accent);
}
.scope-section .scope-item .scope-label {
  flex: 1;
}
.scope-section .scope-item .scope-label strong {
  font-size: 0.9375rem;
  color: #1a1a2e;
}
.scope-section .scope-item .scope-label .scope-description {
  font-size: 0.8125rem;
  color: #6b7280;
  margin-top: 0.125rem;
}
.scope-section .scope-item .scope-label .scope-required {
  font-size: 0.75rem;
  color: #6b7280;
  font-style: italic;
}
.scope-section .scope-item .scope-label .scope-resources {
  font-size: 0.8125rem;
  color: #6b7280;
  margin-top: 0.25rem;
  padding-left: 1rem;
}

.grant-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 1rem;
}
.grant-card .grant-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #e5e7eb;
  background: #fafafa;
}
.grant-card .grant-header .grant-name {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
  font-size: 1rem;
}
.grant-card .grant-header .grant-name img {
  width: 36px;
  height: 36px;
  border-radius: 6px;
}
.grant-card .grant-details {
  list-style: none;
  margin: 0;
  padding: 0;
}
.grant-card .grant-details li {
  padding: 0.625rem 1.25rem;
  border-bottom: 1px solid #e5e7eb;
  font-size: 0.875rem;
}
.grant-card .grant-details li:last-child {
  border-bottom: none;
}
.grant-card .grant-details li label {
  font-weight: 600;
  margin-right: 0.25rem;
}
.grant-card .grant-details li ul {
  margin: 0.25rem 0 0;
  padding-left: 1.25rem;
}

.client-logo {
  text-align: center;
  margin-bottom: 1rem;
}
.client-logo img {
  max-height: 48px;
  width: auto;
}

.auth-user-menu {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 0.875rem;
}
.auth-user-menu .auth-user-trigger {
  color: #6b7280;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  padding: 0.375rem 0.75rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.875rem;
  text-decoration: none;
  transition: background-color 0.2s ease;
}
.auth-user-menu .auth-user-trigger:hover {
  background-color: #f0f2f5;
}

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

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

.body-container {
  width: 100%;
}
