/* ============================================================
   Capital Community Print — shared stylesheet for all pages
   ============================================================ */

:root {
  --bg: #f4f6fb;
  --glass: rgba(255, 255, 255, 0.72);
  --glass-strong: rgba(255, 255, 255, 0.92);
  --glass-border: rgba(255, 255, 255, 0.85);
  --line: rgba(15, 23, 42, 0.08);
  --ink: #0f172a;
  --muted: #64748b;
  --accent: #4f46e5;
  --gradient: linear-gradient(135deg, #0ea5e9 0%, #6366f1 55%, #d946ef 100%);
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --ring: 0 0 0 3px rgba(99, 102, 241, 0.25);
  --ok: #15803d;
  --ok-bg: rgba(34, 197, 94, 0.14);
  --error: #b91c1c;
  --error-bg: rgba(239, 68, 68, 0.12);
  --warn: #b45309;
  --radius: 12px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

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

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  font-size: 15px;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 0%, rgba(14, 165, 233, 0.16), transparent 40%),
    radial-gradient(circle at 92% 8%, rgba(217, 70, 239, 0.13), transparent 42%),
    radial-gradient(circle at 50% 100%, rgba(99, 102, 241, 0.1), transparent 50%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

[hidden] { display: none !important; }

a { color: var(--accent); }
h1 { font-size: 26px; margin: 8px 0 16px; letter-spacing: -0.01em; }
h2 { font-size: 18px; margin: 24px 0 12px; }

.container { width: 100%; max-width: 960px; margin: 0 auto; padding: 24px 16px; flex: 1; }

/* ── Animations ────────────────────────────────────────────── */
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@keyframes pop {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: none; }
}

.animate > * { animation: rise 0.45s var(--ease) both; }
.animate > :nth-child(2) { animation-delay: 0.05s; }
.animate > :nth-child(3) { animation-delay: 0.1s; }
.animate > :nth-child(4) { animation-delay: 0.15s; }
.animate > :nth-child(5) { animation-delay: 0.2s; }
.animate > :nth-child(n+6) { animation-delay: 0.25s; }

/* ── Header / footer (frosted glass) ───────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
}
/* On phones the wrapped header is tall, so let it scroll away. */
@media (max-width: 640px) {
  .site-header { position: relative; }
}
.site-header::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 2px;
  background: var(--gradient);
  opacity: 0.7;
}

.header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  text-decoration: none;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
/* Small CMYK "ink dot" logo. */
.brand::before {
  content: "";
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: conic-gradient(#0ea5e9, #d946ef, #facc15, #0ea5e9);
  transition: transform 0.6s var(--ease);
}
.brand:hover::before { transform: rotate(180deg); }

.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.nav a { text-decoration: none; font-weight: 500; position: relative; }
.nav a::after {
  content: "";
  position: absolute;
  inset: auto 0 -4px 0;
  height: 2px;
  background: var(--gradient);
  transform: scaleX(0);
  transition: transform 0.25s var(--ease);
}
.nav a:hover::after { transform: scaleX(1); }

.user-picker { flex-direction: row; align-items: center; gap: 8px; color: var(--muted); font-weight: 400; }

.site-footer {
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--glass-border);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  padding: 14px 16px;
}
.site-footer p { margin: 0; }

/* ── Glass surfaces ────────────────────────────────────────── */
.panel, .fields, .table-wrap, .help {
  background: var(--glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.panel { padding: 18px; margin: 16px 0; }
.panel h2 { margin-top: 0; }

/* ── Forms ─────────────────────────────────────────────────── */
label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: 13px; }

input, select, textarea, button { font: inherit; }

input, select, textarea {
  padding: 9px 10px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.85);
  font-weight: 400;
  transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: #6366f1; box-shadow: var(--ring); }

button {
  padding: 9px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--gradient);
  background-size: 160% 160%;
  background-position: 0 0;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
  transition: transform 0.15s var(--ease), box-shadow 0.2s, background-position 0.4s;
}
button:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(99, 102, 241, 0.35); background-position: 100% 0; }
button:active { transform: none; }
button:focus-visible { outline: none; box-shadow: var(--ring); }

button.ghost {
  background: rgba(255, 255, 255, 0.6);
  color: var(--accent);
  border: 1px solid rgba(99, 102, 241, 0.3);
  box-shadow: none;
}
button.ghost:hover { background: rgba(99, 102, 241, 0.08); }
button.small { padding: 6px 14px; font-size: 13px; }

.stack { display: flex; flex-direction: column; gap: 16px; max-width: 560px; }
.stack button { align-self: flex-start; }

.filters { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }

.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

.message { padding: 10px 14px; border-radius: 10px; margin: 0 0 16px; animation: pop 0.25s var(--ease); }
.message.success { background: var(--ok-bg); color: var(--ok); }
.message.error { background: var(--error-bg); color: var(--error); }

/* ── How-to panels ─────────────────────────────────────────── */
.help { margin: 0 0 20px; overflow: hidden; }
.help summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.help summary::-webkit-details-marker { display: none; }
.help summary::before {
  content: "?";
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--gradient);
  color: #fff;
  font-size: 13px;
}
.help summary::after { content: "\25BE"; margin-left: auto; color: var(--muted); transition: transform 0.25s var(--ease); }
.help[open] summary::after { transform: rotate(180deg); }
.help[open] ol { animation: rise 0.3s var(--ease); }
.help ol { margin: 0; padding: 0 18px 14px 42px; color: var(--muted); line-height: 1.65; }
.help strong { color: var(--ink); }
.help .note { color: var(--warn); }

/* ── Tables + details ──────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr {
  animation: rise 0.35s var(--ease) both;
  animation-delay: calc(min(var(--i, 0), 12) * 35ms);
  transition: background 0.2s;
}
tbody tr:hover { background: rgba(99, 102, 241, 0.06); }
td.empty { color: var(--muted); text-align: center; }

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  background: rgba(100, 116, 139, 0.12);
  color: var(--muted);
}
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-submitted { background: rgba(14, 165, 233, 0.13); color: #0369a1; }
.status-assigned { background: rgba(99, 102, 241, 0.14); color: #4338ca; }
.status-in-progress { background: rgba(245, 158, 11, 0.16); color: #b45309; }
.status-completed { background: rgba(34, 197, 94, 0.15); color: #15803d; }

.fields {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 10px 18px;
  padding: 18px;
  margin: 0;
}
.fields dt { font-weight: 600; color: var(--muted); }
.fields dd { margin: 0; white-space: pre-wrap; }

/* ── Guided tour ───────────────────────────────────────────── */
.tour { position: fixed; inset: 0; z-index: 100; }

.tour-spotlight {
  position: fixed;
  border-radius: var(--radius);
  box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.55);
  outline: 2px solid rgba(255, 255, 255, 0.9);
  pointer-events: none;
  transition: top 0.3s var(--ease), left 0.3s var(--ease), width 0.3s var(--ease), height 0.3s var(--ease);
}

.tour-card {
  position: fixed;
  width: min(340px, calc(100vw - 24px));
  padding: 20px 18px 16px;
  background: var(--glass-strong);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25);
  overflow: hidden;
  animation: pop 0.25s var(--ease);
  transition: top 0.3s var(--ease), left 0.3s var(--ease);
}
.tour-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--gradient); }
.tour-step { margin: 0 0 4px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--accent); }
.tour-title { margin: 0 0 6px; font-size: 17px; }
.tour-text { margin: 0 0 14px; color: var(--muted); line-height: 1.5; }
.tour-actions { display: flex; gap: 8px; justify-content: flex-end; }
.tour-actions [data-tour="skip"] { margin-right: auto; }

/* ── Respect reduced-motion preferences ────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
