:root {
  /* Backgrounds */
  --bg:             #121212;
  --bg-surface:     #1a1a1a;
  --bg-surface-alt: #141414;
  --bg-hover:       rgba(255, 255, 255, 0.04);
  --bg-input:       rgba(255, 255, 255, 0.06);

  /* Borders */
  --border:         rgba(255, 255, 255, 0.08);
  --border-subtle:  rgba(255, 255, 255, 0.05);
  --border-focus:   rgba(255, 255, 255, 0.28);

  /* Text */
  --text-primary:   #ffffff;
  --text-secondary: #aaaaaa;
  --text-muted:     #666666;

  /* Accent */
  --accent:         #6ecf6e;
  --accent-bg:      rgba(110, 207, 110, 0.08);
  --accent-border:  rgba(110, 207, 110, 0.25);

  /* Semantic */
  --error:          #e65a5a;
  --error-bg:       rgba(230, 90, 90, 0.1);
  --error-border:   rgba(230, 90, 90, 0.2);
  --success:        var(--accent);
  --success-bg:     var(--accent-bg);
  --success-border: var(--accent-border);

  /* Radius */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 10px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Manrope', sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg);
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.main {
  flex: 1;
  padding: 2rem;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}
.nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0.5rem 1.5rem;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition:
    color 0.2s ease,
    border-color 0.2s ease;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
}

.nav a:hover {
  color: var(--text-primary);
  border-bottom-color: rgba(255, 255, 255, 0.3);
}
input.error {
  border-color: var(--error);
  box-shadow: inset 0 0 5px var(--error-bg);
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: opacity 0.15s, background 0.15s;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary            { background: var(--text-primary); color: #0d0d0d; }
.btn-primary:hover      { background: #e0e0e0; }
.btn-secondary          { background: var(--bg-input); color: var(--text-secondary); border: 1px solid var(--border); }
.btn-secondary:hover    { background: rgba(255, 255, 255, 0.12); color: var(--text-primary); }
.btn-danger             { background: #c62828; color: #fff; }
.btn-danger:hover       { opacity: 0.85; }
.btn-success            { background: #2e7d32; color: #fff; }
.btn-success:hover      { opacity: 0.85; }

/* ── Form globals ────────────────────────────────────────── */
.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}
.form-input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: inherit;
  transition: border-color 0.15s;
}
.form-input:focus {
  outline: none;
  border-color: var(--border-focus);
}

/* ── Flash messages ──────────────────────────────────────── */
.msg {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  margin-bottom: 1rem;
}
.msg-error   { background: var(--error-bg);   color: var(--error);   border: 1px solid var(--error-border); }
.msg-success { background: var(--success-bg); color: var(--success); border: 1px solid var(--success-border); }

/* ── Modal (shared) ──────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  width: 90%;
  max-width: 480px;
}
.modal-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 1.25rem;
}
