:root {
  --gold: #d4af37;
  --gold-light: #f3d688;
  --gold-dim: #a8792a;
  --silver: #c7ccd4;
  --silver-light: #f2f4f7;
  --silver-dim: #8b909c;
  --bg: #07070a;
  --bg-elevated: #0d0e13;
  --panel: #13141b;
  --panel-hover: #17181f;
  --border: #262834;
  --border-light: #34364280;
}

* { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 900px 500px at 50% -10%, rgba(212, 175, 55, 0.07), transparent 60%),
    radial-gradient(ellipse 700px 500px at 100% 0%, rgba(120, 130, 150, 0.05), transparent 55%);
  background-attachment: fixed;
}

/* ---------- brand typography ---------- */
.brand-gold {
  background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 45%, var(--gold-dim) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand-silver {
  background: linear-gradient(135deg, var(--silver-light) 0%, var(--silver) 50%, var(--silver-dim) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.gold-text { color: var(--gold); }
.brand-heading {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 800;
}
.brand-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--gold-dim);
}
.brand-divider::before, .brand-divider::after {
  content: '';
  height: 1px;
  width: 46px;
  background: linear-gradient(90deg, transparent, var(--gold-dim));
}
.brand-divider::after { background: linear-gradient(90deg, var(--gold-dim), transparent); }

/* ---------- logo ---------- */
.brand-logo-icon {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.35), 0 4px 14px rgba(0, 0, 0, 0.5);
}

/* ---------- nav ---------- */
.nav-btn {
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 14px;
  color: #9aa0ab;
  background: transparent;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}
.nav-btn:hover { color: #fff; background: var(--panel-hover); }
.nav-btn.active {
  color: #14161d;
  background: linear-gradient(135deg, var(--gold-light), var(--gold) 60%, var(--gold-dim));
  font-weight: 700;
  box-shadow: 0 2px 12px rgba(212, 175, 55, 0.25);
}

.role-pill { color: var(--gold); text-transform: capitalize; font-weight: 600; }

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  transition: border-color 0.15s ease;
}

.input, .input-sm {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  color: #fff;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input:focus, .input-sm:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.12); }
.input-sm { width: auto; }

.label { display: block; font-size: 12px; color: #8b909c; margin-bottom: 4px; letter-spacing: 0.02em; }

.btn-gold {
  background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 55%, var(--gold-dim) 100%);
  color: #1a1408;
  font-weight: 700;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
  box-shadow: 0 2px 10px rgba(212, 175, 55, 0.18);
  transition: filter 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}
.btn-gold:hover { filter: brightness(1.08); box-shadow: 0 4px 16px rgba(212, 175, 55, 0.32); }
.btn-gold:active { transform: translateY(1px); }
.btn-gold:disabled { opacity: 0.5; cursor: not-allowed; filter: none; box-shadow: none; }

.btn-outline {
  border: 1px solid var(--border);
  color: #d1d5db;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  background: transparent;
  transition: all 0.15s ease;
}
.btn-outline:hover { border-color: var(--gold); color: var(--gold-light); background: rgba(212, 175, 55, 0.06); }

.role-btn {
  border: 1px solid var(--border);
  padding: 10px;
  border-radius: 8px;
  font-size: 13px;
  color: #d1d5db;
  background: var(--bg-elevated);
  transition: all 0.15s ease;
}
.role-btn:hover { border-color: var(--gold); color: var(--gold-light); background: rgba(212, 175, 55, 0.06); }

.btn-outline.active-toggle {
  border-color: var(--gold);
  color: var(--gold-light);
  background: rgba(212, 175, 55, 0.12);
}

/* board */
.board-col {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  min-height: 200px;
}
.board-col-header {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9aa0ab;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.task-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.1s ease;
}
.task-card:hover { border-color: var(--gold); transform: translateY(-1px); }
.task-card[draggable="true"] { cursor: grab; }
.task-card.dragging { opacity: 0.4; }
.task-card .title { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.task-card .meta { display: flex; gap: 6px; flex-wrap: wrap; }

.drop-zone { min-height: 40px; border-radius: 8px; transition: background 0.12s ease; }
.drop-zone.drop-zone-active { background: rgba(212, 175, 55, 0.08); outline: 2px dashed rgba(212, 175, 55, 0.4); outline-offset: -4px; }

.attachment-delete-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.7);
  color: #fca5a5;
  font-size: 11px;
  line-height: 20px;
  text-align: center;
  opacity: 0;
  transition: opacity 0.12s ease;
}
.group:hover .attachment-delete-btn { opacity: 1; }

.badge {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-weight: 700;
}
.badge-low { background: #1f2937; color: #9ca3af; }
.badge-medium { background: #1e3a5f; color: #7dd3fc; }
.badge-high { background: #5c3a12; color: #fbbf24; }
.badge-critical { background: #5c1212; color: #fca5a5; }
.badge-cat { background: #241f38; color: #c4b5fd; }
.badge-published { background: #14532d; color: #86efac; }
.badge-pending { background: #5c4a12; color: #fde68a; }
.badge-discarded { background: #3a3a3a; color: #a1a1aa; }
.badge-draft { background: #1f2937; color: #9ca3af; }
.badge-source-meteo { background: #1e2a5f; color: #a5b4fc; }
.badge-source-internal { background: #4a3510; color: var(--gold); }
.badge-subtasks { background: #1f2937; color: #d1d5db; }

/* ---------- dev-facing markdown-lite (comments, internal notes) ---------- */
.code-block {
  background: #05050a;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  white-space: pre;
  margin: 6px 0;
}
.inline-code {
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  color: var(--gold-light);
}
.md-list { margin: 4px 0 4px 18px; list-style: disc; }
.md-body { line-height: 1.5; }

/* ---------- subtask checklist ---------- */
.subtask-row { padding: 4px 0; }
.subtask-row .subtask-toggle { accent-color: var(--gold); width: 15px; height: 15px; }
.subtask-done { color: #6b7280; text-decoration: line-through; }
.subtask-delete-btn {
  width: 20px; height: 20px; border-radius: 999px;
  color: #6b7280; font-size: 11px; line-height: 20px; text-align: center;
  opacity: 0; transition: opacity 0.12s ease, color 0.12s ease;
}
.subtask-row:hover .subtask-delete-btn { opacity: 1; }
.subtask-delete-btn:hover { color: #fca5a5; }

/* modal */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(4, 4, 6, 0.75);
  backdrop-filter: blur(2px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 16px; overflow-y: auto; z-index: 50;
}
.modal-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.hidden { display: none !important; }

textarea.input { resize: vertical; }

.comment-item { border-top: 1px solid var(--border); padding-top: 8px; margin-top: 8px; font-size: 13px; }
.avatar-sm { width: 22px; height: 22px; border-radius: 999px; display: inline-block; vertical-align: middle; margin-right: 6px; background: #333; }

/* ---------- login screen hero ---------- */
.login-ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(180deg, rgba(7,7,10,0.55) 0%, rgba(7,7,10,0.88) 55%, var(--bg) 100%),
    url('/img/hero-bg-source.jpg');
  background-size: cover;
  background-position: center 30%;
  filter: saturate(1.05);
}

.login-card {
  background: rgba(19, 20, 27, 0.88);
  backdrop-filter: blur(6px);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(212, 175, 55, 0.12);
}

/* ---------- public changelog page ---------- */
.public-hero {
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(212, 175, 55, 0.15);
  margin-bottom: 28px;
}
.public-hero img { width: 100%; display: block; }
