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

:root {
  --color-primary: #1e40af;
  --color-primary-light: #3b82f6;
  --color-primary-dark: #1e3a8a;
  --color-success: #059669;
  --color-success-light: #d1fae5;
  --color-error: #dc2626;
  --color-error-light: #fee2e2;
  --color-warning: #d97706;
  --color-warning-light: #fef3c7;
  --color-bg: #f8fafc;
  --color-surface: #ffffff;
  --color-text: #0f172a;
  --color-text-secondary: #475569;
  --color-border: #e2e8f0;
  --radius: 8px;
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1rem;
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--color-border);
}

.card-header h2 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-text);
}

.card-icon {
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary);
  color: white;
  border-radius: 50%;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.nav {
  background: var(--color-primary-dark);
  color: white;
  padding: 0.75rem 0;
}

.nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  font-weight: 700;
  font-size: 1.125rem;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

.nav-links a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.15s;
}

.nav-links a:hover,
.nav-links a.active {
  color: white;
}

.hero {
  text-align: center;
  padding: 3rem 1rem;
}

.hero h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-primary-dark);
  margin-bottom: 0.5rem;
}

.hero p {
  color: var(--color-text-secondary);
  font-size: 1.0625rem;
  max-width: 540px;
  margin: 0 auto;
}

.steps {
  display: flex;
  gap: 1rem;
  margin: 2rem 0;
  justify-content: center;
  flex-wrap: wrap;
}

.step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
}

.step.active {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

.step.completed {
  background: var(--color-success-light);
  color: var(--color-success);
  border-color: var(--color-success);
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: currentColor;
  color: white;
  font-size: 0.6875rem;
  font-weight: 600;
}

.step.completed .step-number {
  background: var(--color-success);
  color: white;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: 0.25rem;
}

.form-group .hint {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  margin-top: 0.25rem;
}

.form-input {
  width: 100%;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  transition: border-color 0.15s, box-shadow 0.15s;
  background: var(--color-surface);
  color: var(--color-text);
}

.form-input:focus {
  outline: none;
  border-color: var(--color-primary-light);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-input.error {
  border-color: var(--color-error);
}

.error-message {
  color: var(--color-error);
  font-size: 0.8125rem;
  margin-top: 0.25rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s, box-shadow 0.15s;
  text-decoration: none;
}

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

.btn-primary {
  background: var(--color-primary);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: var(--color-primary-dark);
}

.btn-secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border-color: var(--color-border);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--color-bg);
}

.btn-success {
  background: var(--color-success);
  color: white;
}

.btn-success:hover:not(:disabled) {
  background: #047857;
}

.btn-danger {
  background: var(--color-error);
  color: white;
}

.btn-danger:hover:not(:disabled) {
  background: #b91c1c;
}

.btn-webauthn {
  background: #1e293b;
  color: white;
  padding: 0.875rem 1.5rem;
  font-size: 0.9375rem;
  width: 100%;
}

.btn-webauthn:hover:not(:disabled) {
  background: #0f172a;
}

.btn-full {
  width: 100%;
}

.btn-oidc {
  width: 100%;
  margin-bottom: 0.5rem;
}

.btn-group {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.btn-group .btn {
  flex: 1;
}

.divider {
  display: flex;
  align-items: center;
  margin: 1.25rem 0;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--color-border);
}

.divider span {
  padding: 0 0.75rem;
  color: var(--color-text-secondary);
  font-size: 0.8125rem;
}

.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

.alert-info {
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #93c5fd;
}

.alert-success {
  background: var(--color-success-light);
  color: #065f46;
  border: 1px solid #6ee7b7;
}

.alert-error {
  background: var(--color-error-light);
  color: #991b1b;
  border: 1px solid #fca5a5;
}

.alert-warning {
  background: var(--color-warning-light);
  color: #92400e;
  border: 1px solid #fcd34d;
}

.spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.view { display: none; }
.view.active { display: block; }

.passkey-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.identity-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.identity-card dt {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.identity-card dd {
  font-size: 0.9375rem;
  margin-bottom: 0.5rem;
}

.webauthn-credential {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem;
  background: var(--color-bg);
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
}

.webauthn-credential-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.webauthn-credential-badge {
  font-size: 0.6875rem;
  padding: 0.125rem 0.375rem;
  border-radius: 9999px;
  font-weight: 500;
}

.badge-active {
  background: var(--color-success-light);
  color: #065f46;
}

.link-list {
  list-style: none;
}

.link-list li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--color-border);
}

.link-list li:last-child {
  border-bottom: none;
}

.link-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-decoration: none;
  color: var(--color-text);
}

.link-list a:hover {
  color: var(--color-primary);
}

.hidden {
  display: none !important;
}

.text-center { text-align: center; }
.text-muted { color: var(--color-text-secondary); }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }

@media (max-width: 640px) {
  .hero h1 { font-size: 1.5rem; }
  .identity-card { grid-template-columns: 1fr; }
  .btn-group { flex-direction: column; }
  .steps { gap: 0.5rem; }
  .step { font-size: 0.75rem; padding: 0.375rem 0.75rem; }
}