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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f5f7fa;
  color: #1a1a2e;
  min-height: 100vh;
}

.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 40px 20px;
}

.container.wide { max-width: 720px; }

h1 { font-size: 1.75rem; margin-bottom: 8px; }
h2 { font-size: 1.25rem; margin-bottom: 16px; color: #333; }

.subtitle {
  color: #666;
  margin-bottom: 32px;
}

/* Card */
.card {
  background: #fff;
  border-radius: 12px;
  padding: 32px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* Tabs */
.tabs {
  display: flex;
  gap: 0;
  margin-bottom: 24px;
  border-bottom: 2px solid #e5e7eb;
}

.tab {
  flex: 1;
  padding: 10px 0;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #666;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.tab:hover { color: #333; }
.tab.active { color: #635bff; border-bottom-color: #635bff; }

/* Forms */
.form-group {
  margin-bottom: 20px;
}

label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: #333;
}

input[type="email"],
input[type="password"] {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.15s;
}

input:focus {
  outline: none;
  border-color: #635bff;
  box-shadow: 0 0 0 3px rgba(99,91,255,0.1);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
  width: 100%;
}

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

.btn-primary {
  background: #635bff;
  color: #fff;
}
.btn-primary:hover:not(:disabled) { background: #5046e5; }

.btn-passkey {
  background: #1a1a2e;
  color: #fff;
}
.btn-passkey:hover:not(:disabled) { background: #2d2d4a; }

.btn-danger {
  background: #ef4444;
  color: #fff;
  padding: 6px 14px;
  font-size: 0.85rem;
  width: auto;
}
.btn-danger:hover:not(:disabled) { background: #dc2626; }

.btn-outline {
  background: transparent;
  color: #635bff;
  border: 1px solid #635bff;
}
.btn-outline:hover:not(:disabled) { background: rgba(99,91,255,0.05); }

.btn-sm {
  padding: 6px 14px;
  font-size: 0.85rem;
  width: auto;
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0;
  color: #999;
  font-size: 0.85rem;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e5e7eb;
}

/* Alert / Status */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-bottom: 16px;
  display: none;
}
.alert.error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; display: block; }
.alert.success { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; display: block; }
.alert.info { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; display: block; }

/* Passkey list */
.passkey-list {
  list-style: none;
}

.passkey-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  margin-bottom: 8px;
}

.passkey-info { flex: 1; }

.passkey-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.passkey-meta {
  font-size: 0.8rem;
  color: #666;
  margin-top: 4px;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: #666;
}

/* Header bar */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.header h1 { margin-bottom: 0; }

/* Loading spinner */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* Responsive */
@media (max-width: 600px) {
  .container { padding: 20px 16px; }
  .card { padding: 24px 20px; }
}
