/* ============================================================
   Shared stylesheet – accent colour tokens are injected by
   base.html as inline :root overrides per domain.
   Default fallback accent: VRoute violet.
   ============================================================ */

:root {
  /* Brand – overridden per domain in base.html */
  --accent:      #7c3aed;
  --accent-dark: #6d28d9;
  --focus-ring:  rgba(124, 58, 237, .18);

  /* Palette */
  --bg:          #f0f2f5;
  --surface:     #ffffff;
  --text:        #111827;
  --text-muted:  #6b7280;
  --border:      #e5e7eb;

  /* Feedback */
  --error:       #dc2626;
  --error-bg:    #fee2e2;
  --success:     #16a34a;
  --success-bg:  #dcfce7;

  /* Tokens */
  --radius:      0.5rem;
  --shadow:      0 1px 3px rgba(0,0,0,.10), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:   0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
}

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

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

/* ----- Typography ----- */
h1 { font-size: 1.75rem; font-weight: 700; }
h2 { font-size: 1.375rem; font-weight: 600; }
h3 { font-size: 1.125rem; font-weight: 600; }
p  { margin: 0; }
.text-muted { color: var(--text-muted); font-size: 0.875rem; }

/* ----- Buttons ----- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color .15s, color .15s, border-color .15s;
  text-decoration: none;
}

.btn-primary {
  width: 100%;
  padding: 0.65rem 1.25rem;
  background-color: var(--accent);
  color: #fff;
}
.btn-primary:hover:not(:disabled) { background-color: var(--accent-dark); }
.btn-primary:disabled { opacity: 0.65; cursor: not-allowed; }

.btn-outline {
  background-color: transparent;
  color: var(--accent);
  border-color: var(--accent);
}
.btn-outline:hover {
  background-color: var(--accent);
  color: #fff;
}

/* ----- Alerts ----- */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  margin-bottom: 1rem;
}
.alert-error   { background-color: var(--error-bg);   color: var(--error); }
.alert-success { background-color: var(--success-bg); color: var(--success); }

/* ----- Forms ----- */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin-bottom: 1rem;
}
.form-group label {
  font-size: 0.875rem;
  font-weight: 500;
}
.form-group input {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9375rem;
  background-color: var(--surface);
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.form-group input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

/* ----- Welcome / Index Layout ----- */
.page-index {
  display: flex;
  justify-content: center;
  align-items: center;
}
.welcome-container {
  width: 100%;
  max-width: 480px;
  padding: 1.5rem;
}
.welcome-card {
  background-color: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 2.5rem 2rem;
  text-align: center;
}
.welcome-card h1 {
  color: var(--accent);
  margin-bottom: 0.75rem;
}
.welcome-subtitle {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 2rem;
  line-height: 1.5;
}

/* ----- Auth Layout ----- */
.page-login {
  display: flex;
  justify-content: center;
  align-items: center;
}
.auth-container {
  width: 100%;
  max-width: 420px;
  padding: 1.5rem;
}
.auth-card {
  background-color: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 2rem;
}
.auth-header {
  text-align: center;
  margin-bottom: 1.75rem;
}
.auth-header h1 {
  color: var(--accent);
  margin-bottom: 0.25rem;
}
.auth-header p { color: var(--text-muted); font-size: 0.9rem; }

/* ----- Navbar ----- */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  background-color: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.navbar-brand {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
}
.navbar .btn-outline {
  width: auto;
}

/* ----- Container ----- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* ----- Page Header ----- */
.page-header { margin-bottom: 1.75rem; }

/* ----- Stats Grid ----- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.stat-card {
  background-color: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  border-left: 4px solid var(--accent);
}
.stat-label {
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.375rem;
}
.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
}

/* ----- Content Sections ----- */
.content-section {
  background-color: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.content-section h3 {
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

/* ----- Activity List ----- */
.activity-list { display: flex; flex-direction: column; gap: 0.5rem; }
.activity-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.625rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.activity-item:last-child { border-bottom: none; }
.activity-text { flex: 1; }
.activity-date {
  color: var(--text-muted);
  font-size: 0.8125rem;
  white-space: nowrap;
  margin-left: 1rem;
}

/* ----- Responsive ----- */
@media (max-width: 480px) {
  .auth-card { padding: 1.5rem; }
  .welcome-card { padding: 1.75rem 1.25rem; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .navbar { padding: 0.625rem 1rem; }
  .container { padding: 1.25rem 1rem; }
}
