/* Common styles for all apps */

:root {
  --bg: #0f1219;
  --bg-elevated: #181d2a;
  --border: #2a3142;
  --text: #e9edf3;
  --text-secondary: #8b95a5;
  --accent: #7ee787;
  --accent-hover: #6dd677;
  --danger: #f87171;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f4f6f9;
    --bg-elevated: #ffffff;
    --border: #e2e6ed;
    --text: #0d1321;
    --text-secondary: #5f6b7a;
    --accent: #0ea5e9;
    --accent-hover: #0c8bcb;
    --danger: #dc2626;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  }
}

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

html, body {
  height: 100%;
}

body {
  margin: 0;
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* Layout */
.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

.container--narrow {
  max-width: 480px;
}

/* Typography */
h1, h2, h3 {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.5px;
}

h1 {
  font-size: clamp(1.6rem, 2.5vw + 1rem, 2.4rem);
  margin-bottom: 8px;
}

h2 {
  font-size: 1.4rem;
  margin-bottom: 16px;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 1.05rem;
  margin-bottom: 32px;
}

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  color: #0d1321;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, transform 0.15s;
}

.btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

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

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

.btn--secondary:hover {
  border-color: var(--accent);
  background: var(--bg-elevated);
}

.btn--danger {
  background: var(--danger);
  color: white;
}

.btn--small {
  padding: 8px 16px;
  font-size: 0.85rem;
}

/* Forms */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  font: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 20%, transparent);
}

.form-input::placeholder {
  color: var(--text-secondary);
}

/* Alerts */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-size: 0.95rem;
}

.alert--error {
  background: color-mix(in oklab, var(--danger) 15%, transparent);
  color: var(--danger);
  border: 1px solid color-mix(in oklab, var(--danger) 30%, transparent);
}

.alert--success {
  background: color-mix(in oklab, var(--accent) 15%, transparent);
  color: var(--accent);
  border: 1px solid color-mix(in oklab, var(--accent) 30%, transparent);
}

/* Header with back link */
.page-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 32px;
}

.back-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: var(--text-secondary);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
}

.back-link:hover {
  border-color: var(--accent);
  color: var(--accent);
}

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

.text-center {
  text-align: center;
}

.mt-4 { margin-top: 32px; }
.mb-4 { margin-bottom: 32px; }
