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

:root {
  --ink: #0a0f1a;
  --slate: #151c2e;
  --steel: #1e2740;
  --mist: #8892a8;
  --cloud: #c4cad8;
  --white: #f0f2f7;
  --gold: #d4a853;
  --gold-dim: rgba(212, 168, 83, 0.15);
  --teal: #2dd4bf;
  --teal-dim: rgba(45, 212, 191, 0.1);
  --red: #ef4444;
  --red-dim: rgba(239, 68, 68, 0.12);
  --green: #22c55e;
  --green-dim: rgba(34, 197, 94, 0.12);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', -apple-system, sans-serif;
  background: var(--ink);
  color: var(--cloud);
  line-height: 1.65;
  overflow-x: hidden;
  min-height: 100vh;
}

/* --- NAV --- */
.app-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 0.85rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(10, 15, 26, 0.92);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(136, 146, 168, 0.08);
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.logo {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--white);
  letter-spacing: -0.5px;
  text-decoration: none;
}

.logo span { color: var(--gold); }

.nav-links {
  display: flex;
  gap: 0.25rem;
}

.nav-link {
  font-size: 0.85rem;
  color: var(--mist);
  text-decoration: none;
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
  transition: all 0.2s;
  cursor: pointer;
}

.nav-link:hover, .nav-link.active {
  color: var(--white);
  background: var(--steel);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-user {
  font-size: 0.82rem;
  color: var(--mist);
}

.nav-user strong {
  color: var(--gold);
  font-weight: 500;
}

.btn-logout {
  font-size: 0.78rem;
  color: var(--mist);
  background: none;
  border: 1px solid rgba(136, 146, 168, 0.15);
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-logout:hover {
  color: var(--white);
  border-color: rgba(136, 146, 168, 0.3);
}

/* --- MAIN CONTENT --- */
.app-main {
  padding-top: 4.5rem;
  min-height: 100vh;
  max-width: 1100px;
  margin: 0 auto;
  padding-left: 2rem;
  padding-right: 2rem;
  padding-bottom: 3rem;
}

/* --- PAGE HEADER --- */
.page-header {
  padding: 2rem 0 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
}

.page-header h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.8px;
  line-height: 1.2;
}

.page-header p {
  font-size: 0.95rem;
  color: var(--mist);
  margin-top: 0.35rem;
}

/* --- CARDS --- */
.card {
  background: var(--slate);
  border: 1px solid rgba(136, 146, 168, 0.06);
  border-radius: 14px;
  padding: 1.75rem;
  margin-bottom: 1.25rem;
  transition: border-color 0.3s;
}

.card:hover {
  border-color: rgba(136, 146, 168, 0.12);
}

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

.card-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--white);
  letter-spacing: -0.3px;
}

/* --- STAT GRID --- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--slate);
  border: 1px solid rgba(136, 146, 168, 0.06);
  border-radius: 12px;
  padding: 1.25rem;
}

.stat-card .stat-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--white);
  line-height: 1;
}

.stat-card .stat-label {
  font-size: 0.8rem;
  color: var(--mist);
  margin-top: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* --- BUTTONS --- */
.btn {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.6rem 1.25rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
}

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

.btn-primary:hover {
  background: #c49a48;
}

.btn-secondary {
  background: var(--steel);
  color: var(--cloud);
  border: 1px solid rgba(136, 146, 168, 0.12);
}

.btn-secondary:hover {
  border-color: rgba(136, 146, 168, 0.25);
  color: var(--white);
}

.btn-danger {
  background: var(--red-dim);
  color: var(--red);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.2);
}

.btn-sm {
  font-size: 0.78rem;
  padding: 0.4rem 0.85rem;
}

/* --- FORMS --- */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.82rem;
  color: var(--mist);
  margin-bottom: 0.4rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 0.7rem 1rem;
  background: var(--ink);
  border: 1px solid rgba(136, 146, 168, 0.15);
  border-radius: 8px;
  color: var(--white);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.92rem;
  transition: border-color 0.2s;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--gold);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238892a8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.5rem;
}

.form-textarea {
  min-height: 80px;
  resize: vertical;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* --- TAGS / BADGES --- */
.badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.25rem 0.65rem;
  border-radius: 100px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.badge-gold {
  color: var(--gold);
  background: var(--gold-dim);
}

.badge-teal {
  color: var(--teal);
  background: var(--teal-dim);
}

.badge-green {
  color: var(--green);
  background: var(--green-dim);
}

.badge-red {
  color: var(--red);
  background: var(--red-dim);
}

.badge-mist {
  color: var(--mist);
  background: rgba(136, 146, 168, 0.1);
}

/* --- TABLE --- */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  text-align: left;
  font-size: 0.72rem;
  color: var(--mist);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(136, 146, 168, 0.1);
  font-weight: 500;
}

.data-table td {
  padding: 0.85rem 0;
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(136, 146, 168, 0.05);
  vertical-align: middle;
}

.data-table td:last-child {
  text-align: right;
}

.data-table tr:hover td {
  background: rgba(30, 39, 64, 0.3);
}

/* --- TRUST SCORE BAR --- */
.trust-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.trust-track {
  flex: 1;
  height: 6px;
  background: rgba(136, 146, 168, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.trust-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
}

.trust-fill.high { background: var(--green); }
.trust-fill.medium { background: var(--gold); }
.trust-fill.low { background: var(--red); }

.trust-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--white);
  min-width: 45px;
  text-align: right;
}

/* --- PROOF LOG --- */
.proof-item {
  display: flex;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid rgba(136, 146, 168, 0.06);
}

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

.proof-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gold-dim);
  color: var(--gold);
  font-size: 0.9rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.proof-content {
  flex: 1;
}

.proof-content strong {
  color: var(--white);
  font-weight: 500;
  font-size: 0.92rem;
}

.proof-content p {
  font-size: 0.85rem;
  color: var(--mist);
  margin-top: 0.2rem;
}

.proof-meta {
  display: flex;
  gap: 1rem;
  margin-top: 0.4rem;
  font-size: 0.75rem;
  color: var(--mist);
}

.proof-hash {
  font-family: 'Space Grotesk', monospace;
  font-size: 0.7rem;
  color: var(--mist);
  opacity: 0.6;
}

/* --- MODAL --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 26, 0.8);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.modal {
  background: var(--slate);
  border: 1px solid rgba(136, 146, 168, 0.1);
  border-radius: 16px;
  padding: 2rem;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 1.5rem;
  letter-spacing: -0.3px;
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
}

/* --- SEARCH --- */
.search-bar {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.search-bar .form-input {
  flex: 1;
  min-width: 180px;
}

/* --- RESULT CARDS --- */
.result-card {
  background: var(--slate);
  border: 1px solid rgba(136, 146, 168, 0.06);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  transition: border-color 0.2s;
}

.result-card:hover {
  border-color: rgba(212, 168, 83, 0.15);
}

.result-info h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 0.25rem;
}

.result-info p {
  font-size: 0.85rem;
  color: var(--mist);
}

.result-tags {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.result-scores {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.3rem;
  flex-shrink: 0;
}

/* --- EMPTY STATE --- */
.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--mist);
}

.empty-state .empty-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
  opacity: 0.5;
}

.empty-state h3 {
  font-family: 'Space Grotesk', sans-serif;
  color: var(--white);
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.empty-state p {
  font-size: 0.9rem;
  max-width: 400px;
  margin: 0 auto 1.25rem;
}

/* --- AUTH PAGES --- */
.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.auth-card {
  background: var(--slate);
  border: 1px solid rgba(136, 146, 168, 0.08);
  border-radius: 20px;
  padding: 2.5rem;
  width: 100%;
  max-width: 440px;
}

.auth-card .logo {
  font-size: 1.5rem;
  display: block;
  text-align: center;
  margin-bottom: 0.5rem;
}

.auth-subtitle {
  text-align: center;
  color: var(--mist);
  font-size: 0.92rem;
  margin-bottom: 2rem;
}

.auth-divider {
  text-align: center;
  color: var(--mist);
  font-size: 0.82rem;
  margin-top: 1.5rem;
}

.auth-divider a {
  color: var(--gold);
  text-decoration: none;
  cursor: pointer;
}

.auth-divider a:hover {
  text-decoration: underline;
}

/* --- USER TYPE SELECTOR --- */
.type-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.type-option {
  background: var(--ink);
  border: 2px solid rgba(136, 146, 168, 0.1);
  border-radius: 12px;
  padding: 1rem 0.75rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.type-option:hover {
  border-color: rgba(136, 146, 168, 0.25);
}

.type-option.selected {
  border-color: var(--gold);
  background: var(--gold-dim);
}

.type-option .type-icon {
  font-size: 1.5rem;
  margin-bottom: 0.35rem;
}

.type-option .type-label {
  font-size: 0.8rem;
  color: var(--white);
  font-weight: 500;
}

.type-option .type-desc {
  font-size: 0.7rem;
  color: var(--mist);
  margin-top: 0.15rem;
}

/* --- PROFILE FIELDS --- */
.profile-fields {
  display: none;
}

.profile-fields.visible {
  display: block;
}

/* --- ALERT --- */
.alert {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.alert-error {
  background: var(--red-dim);
  color: var(--red);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert-success {
  background: var(--green-dim);
  color: var(--green);
  border: 1px solid rgba(34, 197, 94, 0.2);
}

/* --- LOADING --- */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  color: var(--mist);
}

.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid rgba(136, 146, 168, 0.2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 0.75rem;
}

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

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
  .app-nav {
    padding: 0.75rem 1.25rem;
  }

  .nav-links {
    display: none;
  }

  .app-main {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .type-selector {
    grid-template-columns: 1fr;
  }

  .stat-grid {
    grid-template-columns: 1fr 1fr;
  }

  .result-card {
    flex-direction: column;
  }

  .search-bar {
    flex-direction: column;
  }
}

/* --- TABS --- */
.tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid rgba(136, 146, 168, 0.08);
  padding-bottom: 0;
}

.tab {
  font-size: 0.85rem;
  color: var(--mist);
  padding: 0.65rem 1rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: 'DM Sans', sans-serif;
}

.tab:hover {
  color: var(--cloud);
}

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

/* --- SECTION DIVIDER --- */
.section-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(136, 146, 168, 0.1), transparent);
  margin: 1.5rem 0;
}
