:root {
  --bg: #0f172a;
  --bg-glow: #1e293b;
  --card-bg: rgba(30, 41, 59, 0.6);
  --card-border: rgba(255, 255, 255, 0.1);
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --accent: #06b6d4;
  --accent-2: #3b82f6;
  --success: #22c55e;
  --error: #ef4444;
  --console-bg: #020617;
}

:root[data-domain="passkey-b.com"] {
  --accent: #a855f7;
  --accent-2: #d946ef;
}

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

html, body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

body {
  background: radial-gradient(ellipse at 50% 0%, var(--bg-glow) 0%, var(--bg) 70%);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* Header */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--card-border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  font-weight: 700;
}

.brand svg {
  width: 32px;
  height: 32px;
  color: var(--accent);
}

.domain-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 1rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 600;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
}

.domain-badge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Grid */
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

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

/* Cards */
.card {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 1.5rem;
  transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.card h2 {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card h2 .icon {
  font-size: 1.25rem;
}

.card p {
  color: var(--text-muted);
  font-size: 0.9375rem;
  margin-bottom: 1.25rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  color: white;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  width: 100%;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3), 0 0 30px var(--accent);
}

.btn:active {
  transform: translateY(0);
}

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

.btn-secondary {
  background: transparent;
  border: 1px solid var(--card-border);
  color: var(--text);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.05);
  box-shadow: none;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  background: rgba(0, 0, 0, 0.2);
  padding: 4px;
  border-radius: 10px;
}

.tab {
  flex: 1;
  padding: 0.5rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.tab.active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

/* Result pills */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.875rem;
  border-radius: 8px;
  font-size: 0.8125rem;
  font-family: 'SF Mono', Monaco, monospace;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--card-border);
  margin-top: 0.75rem;
  word-break: break-all;
}

.pill.success {
  border-color: var(--success);
  color: var(--success);
}

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

/* Trust Section */
.trust-card {
  text-align: center;
  margin-bottom: 1.5rem;
}

.trust-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 1.5rem 0;
}

.trust-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--card-border);
  min-width: 140px;
}

.trust-node .shield {
  font-size: 2rem;
}

.trust-node .label {
  font-size: 0.875rem;
  font-weight: 600;
}

.trust-connector {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.trust-connector .line {
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  position: relative;
}

.trust-connector .line::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  50% { transform: translate(-50%, -50%) scale(1.5); opacity: 0.5; }
}

.trust-connector .text {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.json-preview {
  text-align: left;
  background: var(--console-bg);
  border-radius: 10px;
  padding: 1rem;
  font-family: 'SF Mono', Monaco, monospace;
  font-size: 0.8125rem;
  line-height: 1.6;
  color: #a5f3fc;
  overflow-x: auto;
  margin-top: 1rem;
}

.json-preview .key { color: #93c5fd; }
.json-preview .string { color: #a5f3fc; }
.json-preview .brace { color: #94a3b8; }

/* Console */
.console-card {
  margin-bottom: 2rem;
}

.console {
  background: var(--console-bg);
  border-radius: 10px;
  padding: 1rem;
  font-family: 'SF Mono', Monaco, monospace;
  font-size: 0.8125rem;
  line-height: 1.6;
  height: 280px;
  overflow-y: auto;
  color: #cbd5e1;
}

.console .entry {
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.console .timestamp {
  color: #64748b;
  font-size: 0.75rem;
}

.console .label {
  font-weight: 600;
}

.console .label.send { color: var(--accent); }
.console .label.recv { color: var(--accent-2); }
.console .label.info { color: #fbbf24; }
.console .label.success { color: var(--success); }
.console .label.error { color: var(--error); }

.console pre {
  margin: 0.25rem 0 0 0;
  white-space: pre-wrap;
  word-break: break-all;
  color: #94a3b8;
}

/* Credentials list */
.credentials-list {
  margin-top: 1rem;
}

.credentials-list .cred-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.625rem 0.875rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--card-border);
  margin-bottom: 0.5rem;
  font-size: 0.8125rem;
  font-family: 'SF Mono', Monaco, monospace;
}

.credentials-list .cred-item .rp-tag {
  padding: 0.125rem 0.5rem;
  border-radius: 4px;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  background: var(--accent);
  color: white;
}

.empty-state {
  text-align: center;
  padding: 1.5rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}
