/* PubAxis accounts - main styles */
:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --text: #1a1f2e;
  --text-muted: #6b7280;
  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --danger: #ef4444;
  --success: #22c55e;
  --warning: #f59e0b;
  --border: #e5e7eb;
  --radius: 8px;
  --header-bg: #0f1117;
  --header-text: #f3f4f6;
  --max-width: 960px;
}

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

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

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Header */
.site-header {
  background: var(--header-bg);
  color: var(--header-text);
  padding: 0 1.5rem;
  border-bottom: 1px solid #1a2a42;
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.logo {
  color: var(--header-text);
  font-weight: 700;
  font-size: 1.1rem;
}

.logo:hover { text-decoration: none; opacity: 0.9; }

.header-nav { display: flex; gap: 1rem; }
.header-nav a { color: var(--header-text); opacity: 0.8; font-size: 0.9rem; }
.header-nav a:hover { opacity: 1; text-decoration: none; }

/* Main */
.page-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem;
  flex: 1;
  width: 100%;
}

/* Footer */
.site-footer {
  text-align: center;
  padding: 1.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
}

/* Flash Messages */
.flash {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  border: 1px solid;
  word-break: break-word;
}

.flash-error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.flash-success { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.flash-info { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.flash-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }

/* Auth Box */
.auth-box {
  max-width: 420px;
  margin: 2rem auto;
  background: var(--surface);
  padding: 2rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.auth-box h1 {
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
}

.auth-links {
  margin-top: 1rem;
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
}

/* Consent Box */
.consent-box { max-width: 500px; }
.scope-list { margin: 1rem 0; }
.scope-list h3 { font-size: 0.95rem; margin-bottom: 0.5rem; }
.scope-list ul { padding-left: 1.5rem; }
.scope-list li { margin-bottom: 0.25rem; }
.consent-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}
.consent-actions .btn { flex: 1; text-align: center; }
.consent-footer { margin-top: 1rem; font-size: 0.85rem; text-align: center; }

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

.form-group label {
  display: block;
  margin-bottom: 0.25rem;
  font-weight: 500;
  font-size: 0.9rem;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  background: var(--surface);
  color: var(--text);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

textarea { resize: vertical; font-family: inherit; }

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, opacity 0.15s;
}

.btn:hover { text-decoration: none; opacity: 0.9; }

.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-danger { background: var(--danger); color: white; }
.btn-full { width: 100%; text-align: center; }
.btn-sm { padding: 0.25rem 0.5rem; font-size: 0.8rem; }
.btn-link { background: none; border: none; color: var(--accent); cursor: pointer; font-size: inherit; padding: 0; }
.btn-link:hover { text-decoration: underline; }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.card h2 { margin-bottom: 1rem; font-size: 1.2rem; }

/* Badges */
.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 500;
}

.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fef2f2; color: #991b1b; }

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  padding: 0.5rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

th { font-weight: 600; background: var(--bg); }
code { background: var(--bg); padding: 0.1rem 0.4rem; border-radius: 4px; font-size: 0.85rem; }

/* Profile */
.profile-page { max-width: 640px; }

.profile-header {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}

.profile-avatar img,
.avatar-placeholder {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
}

.avatar-placeholder {
  background: var(--accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
}

.profile-info h1 { font-size: 1.5rem; margin-bottom: 0.25rem; }

.profile-actions {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.social-links {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.social-link {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.profile-meta { color: var(--text-muted); font-size: 0.85rem; }

.avatar-form { margin-bottom: 1.5rem; }
.avatar-upload { display: flex; align-items: center; gap: 0.75rem; }
.current-avatar { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; }

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
}

/* Pagination */
.pagination {
  display: flex;
  gap: 0.25rem;
  margin-top: 1rem;
}

.pagination a {
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.85rem;
}

.pagination a.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* Utility */
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }

/* Responsive */
@media (max-width: 640px) {
  .profile-header { flex-direction: column; align-items: center; text-align: center; }
  .header-inner { flex-direction: column; height: auto; padding: 0.75rem 0; gap: 0.5rem; }
  .auth-links { flex-direction: column; gap: 0.5rem; text-align: center; }
}
