:root {
  --brand-indigo: #667eea;
  --brand-violet: #764ba2;
  --surface: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
}

/* Shared gradient backgrounds */
.oauth-gradient {
  background: linear-gradient(135deg, var(--brand-indigo) 0%, var(--brand-violet) 100%);
}

.oauth-soft-gradient {
  background:
    radial-gradient(circle at 10% 20%, #dde9ff 0%, transparent 45%),
    radial-gradient(circle at 90% 85%, #d6f5ea 0%, transparent 42%),
    #eef3f7;
}

/* Shared card treatment */
.oauth-card {
  background: var(--surface);
  border-radius: 0.875rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.oauth-card-soft {
  background: var(--surface);
  border-radius: 0.875rem;
  box-shadow: 0 8px 30px rgba(18, 32, 40, 0.12);
}

.oauth-status-box {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 0.625rem;
  background: #f4f7fb;
  white-space: pre-wrap;
  line-height: 1.4;
}

.oauth-status-ok { border-left: 4px solid #0c8f62; }
.oauth-status-warn { border-left: 4px solid #b35f00; }
.oauth-status-bad { border-left: 4px solid #bc2a2a; }

/* Compatibility with existing JS status class toggling */
.ok { border-left: 4px solid #0c8f62; }
.warn { border-left: 4px solid #b35f00; }
.bad { border-left: 4px solid #bc2a2a; }

.oauth-error {
  color: #b91c1c;
  background: #fee2e2;
  border-radius: 0.5rem;
  padding: 0.75rem;
}

.oauth-success {
  color: #166534;
  background: #dcfce7;
  border-radius: 0.5rem;
  padding: 0.75rem;
}

.oauth-spinner {
  border: 3px solid #f3f3f3;
  border-top: 3px solid var(--brand-indigo);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 1rem auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Browser compatibility fallback widths */
.oauth-page-width {
  width: min(92vw, 700px);
}

@media (max-width: 640px) {
  .oauth-page-width {
    width: 92vw;
  }
}

@media (min-width: 641px) and (max-width: 1024px) {
  .oauth-page-width {
    width: min(88vw, 760px);
  }
}

@media (min-width: 1025px) {
  .oauth-page-width {
    width: min(760px, 72vw);
  }
}