:root {
  --bg-color: #0f172a;
  --card-bg: #1e293b;
  --card-border: #334155;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --secondary: #6366f1;
  --secondary-hover: #4f46e5;
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --success: #10b981;
  --warning: #f59e0b;
  --input-bg: #090d16;
  --radius: 8px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* 3-Minute Clipboard Auto-Clear Banner */
.clipboard-banner {
  background: #1e1b4b;
  border-bottom: 2px solid #6366f1;
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
}

.banner-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 16px;
  font-size: 0.95rem;
  font-weight: 500;
}

.progress-container {
  width: 100%;
  height: 4px;
  background: #312e81;
}

.progress-bar {
  height: 100%;
  background: #818cf8;
  width: 0%;
  transition: width 0.4s ease;
}

.btn-clear-now {
  background: #4338ca;
  color: #fff;
  border: 1px solid #6366f1;
  cursor: pointer;
  border-radius: 4px;
  padding: 4px 10px;
}

.btn-clear-now:hover {
  background: #4f46e5;
}

/* Layout */
.app-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 16px;
  width: 100%;
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--card-border);
  margin-bottom: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand h1 {
  font-size: 1.5rem;
  font-weight: 700;
}

.badge {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 600;
}

.badge-zero-knowledge {
  background: #064e3b;
  color: #6ee7b7;
  border: 1px solid #059669;
}

.badge-success {
  background: #065f46;
  color: #a7f3d0;
}

.badge-neutral {
  background: #334155;
  color: #cbd5e1;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-name {
  font-weight: 500;
  color: var(--text-muted);
}

/* Cards & Views */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 24px;
}

.view-card {
  max-width: 650px;
  margin: 40px auto;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 6px;
  color: #e2e8f0;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  background: var(--input-bg);
  border: 1px solid var(--card-border);
  border-radius: 6px;
  color: var(--text-main);
  font-size: 0.95rem;
  transition: border-color 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
}

.form-range {
  width: 100%;
  accent-color: var(--primary);
}

.masked-input {
  letter-spacing: 2px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  background: var(--secondary);
  color: #fff;
}
.btn-secondary:hover {
  background: var(--secondary-hover);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover {
  background: var(--danger-hover);
}

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

.btn-sm {
  padding: 6px 12px;
  font-size: 0.85rem;
}

.btn-block {
  width: 100%;
}

/* Alerts */
.alert {
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 0.9rem;
  margin-bottom: 18px;
}

.alert-error {
  background: #451a1a;
  border: 1px solid #7f1d1d;
  color: #fca5a5;
}

.alert-success {
  background: #064e3b;
  border: 1px solid #047857;
  color: #6ee7b7;
}

.alert-info {
  background: #1e3a8a;
  border: 1px solid #1d4ed8;
  color: #bfdbfe;
}

/* Auth split */
.auth-split {
  display: flex;
  gap: 24px;
  margin-top: 24px;
}

.auth-column {
  flex: 1;
}

.auth-divider {
  display: flex;
  align-items: center;
  color: var(--text-muted);
  font-weight: 600;
}

/* Dashboard Toolbar */
.dashboard-toolbar {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
}

.search-box {
  flex: 1;
}

.keys-card {
  padding: 0;
  overflow: hidden;
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--card-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.key-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--card-border);
}

.key-item:last-child {
  border-bottom: none;
}

.key-title {
  font-weight: 600;
  font-size: 1rem;
}

.key-date {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: block;
  margin-top: 2px;
}

.key-actions {
  display: flex;
  gap: 8px;
}

.empty-list {
  padding: 32px;
  text-align: center;
  color: var(--text-muted);
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 16px;
}

.modal-content {
  width: 100%;
  max-width: 550px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

.tabs-nav {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--card-border);
  margin-bottom: 18px;
}

.tab {
  background: transparent;
  border: none;
  padding: 8px 14px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tab-pane {
  margin-bottom: 18px;
}

.paste-box {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0;
}

.highlight-card {
  background: #172554;
  border-color: #1e40af;
  margin: 16px 0;
  text-align: center;
}

.pairing-code {
  font-family: monospace;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 4px;
  color: #93c5fd;
  margin: 12px 0;
}

.status-indicator {
  font-size: 0.85rem;
  color: #bfdbfe;
}

.section-divider {
  border-top: 1px solid var(--card-border);
  margin: 20px 0;
}

.device-list {
  list-style: none;
  margin-top: 10px;
}

.device-item, .request-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--card-border);
  gap: 10px;
}

.device-item:last-child, .request-item:last-child {
  border-bottom: none;
}

.text-muted {
  color: var(--text-muted);
}

.small {
  font-size: 0.85rem;
}
