:root {
  --bg: #fff7e8;
  --card: #ffffff;
  --ink: #263238;
  --muted: #607d8b;

  --sunshine: #ffd166;
  --mint: #8edbb0;
  --sky: #a8d8ff;
  --peach: #ffb5a7;
  --lavender: #cdb4db;

  /* brand (from the Hocus Pocus logo) */
  --brand-purple: #3a1c5e;
  --brand-purple-2: #5a2d8a;
  --brand-gold: #ffd23f;

  --border: #f0dfc8;
  --shadow: 0 10px 28px rgba(72, 55, 36, 0.12);

  font-size: 18px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 12% 10%, rgba(255, 209, 102, 0.28), transparent 24rem),
    radial-gradient(circle at 88% 18%, rgba(168, 216, 255, 0.32), transparent 22rem),
    radial-gradient(circle at 30% 95%, rgba(142, 219, 176, 0.25), transparent 26rem),
    var(--bg);
  color: var(--ink);
  line-height: 1.55;
  min-height: 100vh;
}

/* subtle starry-dot pattern (echoes the logo's stars) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.16;
  z-index: 0;
  background-image:
    radial-gradient(circle, var(--brand-gold) 2px, transparent 3px),
    radial-gradient(circle, var(--lavender) 2px, transparent 3px),
    radial-gradient(circle, var(--brand-purple-2) 1.5px, transparent 3px);
  background-size: 80px 80px, 110px 110px, 140px 140px;
  background-position: 0 0, 30px 40px, 70px 20px;
}

.page {
  position: relative;
  z-index: 1;
  max-width: 1040px;
  margin: 0 auto;
  padding: 28px 20px 80px;
}

a { color: #1f7a52; }

/* ---------- top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 800; }
.brand .logo, .brand .logo-img {
  width: 50px; height: 50px; border-radius: 14px;
  display: grid; place-items: center; font-size: 1.5rem;
  box-shadow: var(--shadow);
}
.brand .logo { background: var(--brand-purple); color: #fff; }
.logo-img { object-fit: contain; }
.brand small { display: block; font-weight: 600; color: var(--muted); font-size: 0.8rem; }
.whoami { font-size: 0.95rem; color: var(--muted); text-align: right; }
.whoami b { color: var(--ink); }

/* ---------- hero ---------- */
.hero {
  background: var(--card);
  border: 3px solid var(--border);
  border-radius: 32px;
  padding: 34px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "☀️";
  position: absolute; right: 28px; top: 22px; font-size: 3rem; opacity: 0.85;
}

/* branded purple hero (dashboard) */
.hero.hero--brand {
  background:
    radial-gradient(circle at 85% 20%, rgba(255,210,63,0.18), transparent 40%),
    linear-gradient(135deg, var(--brand-purple), var(--brand-purple-2));
  border-color: #2a1247;
  color: #fff;
}
.hero.hero--brand h1 { color: #fff; }
.hero.hero--brand .lead { color: rgba(255,255,255,0.92); }
.hero.hero--brand::after { content: "✨"; }

.hero-logo {
  display: block; width: 92px; height: 92px; border-radius: 20px;
  margin: 0 0 16px; box-shadow: 0 8px 22px rgba(0,0,0,0.25); object-fit: contain;
}

h1 { font-size: clamp(1.8rem, 4.5vw, 3rem); line-height: 1.05; margin: 0 0 12px; letter-spacing: -0.03em; }
h2 { font-size: 1.5rem; margin: 0 0 12px; }
.lead { font-size: 1.15rem; color: #37474f; max-width: 760px; }

.reassurance { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: #fff3c4; border: 2px solid #ffe08a; border-radius: 999px;
  padding: 9px 14px; font-weight: 700; font-size: 0.95rem;
}
.hero.hero--brand .badge {
  background: rgba(255,255,255,0.14); border-color: var(--brand-gold); color: #fff;
}

/* ---------- board grid ---------- */
.board-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  margin-top: 28px;
}
.section-card {
  background: var(--card);
  border: 3px solid var(--border);
  border-radius: 28px;
  padding: 24px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  text-align: left;
  font: inherit;
  color: inherit;
  display: flex; flex-direction: column; gap: 8px;
}
.section-card:hover { transform: translateY(-3px); box-shadow: 0 16px 34px rgba(72,55,36,0.18); }
.section-card h2 { margin: 4px 0 2px; }
.section-card p { margin: 0; color: var(--muted); font-size: 0.98rem; }
.section-icon {
  width: 58px; height: 58px; border-radius: 18px;
  display: grid; place-items: center; font-size: 1.8rem; margin-bottom: 6px;
}
.icon-email { background: #e8f4ff; }
.icon-systems { background: #fff1b8; }
.icon-website { background: #ddf7e8; }
.icon-devices { background: #f1e6ff; }
.icon-photos { background: #ffe4df; }
.icon-wifi { background: #e5f6ff; }

.card-foot { display:flex; align-items:center; justify-content: space-between; margin-top: 6px; gap: 8px; }
.mgmt-tag { font-size: 0.8rem; font-weight: 700; color: var(--muted); }

/* ---------- status pills ---------- */
.status {
  display: inline-flex; align-items: center; border-radius: 999px;
  padding: 6px 12px; font-size: 0.85rem; font-weight: 800;
}
.status-none      { background: #eef1f3; color: #5b6b75; }
.status-progress  { background: #e8f4ff; color: #17496b; }
.status-checking  { background: #fff0c2; color: #6a4b00; }
.status-complete  { background: #ddf7e8; color: #185d39; }
.status-action    { background: #ffe1dc; color: #7a2418; }

/* ---------- buttons ---------- */
button, .button {
  appearance: none; border: 0; border-radius: 999px;
  padding: 14px 22px; font-size: 1.02rem; font-weight: 800; cursor: pointer;
  min-height: 50px; font-family: inherit;
}
.primary  { background: var(--brand-gold); color: var(--brand-purple); }
.secondary{ background: #efe6fb; color: var(--brand-purple); }
.quiet    { background: #f3ead9; color: #4b3b2a; }
.link-btn { background: none; min-height: auto; padding: 6px 4px; color: #6a3aa0; font-weight: 700; }
button:hover { filter: brightness(0.97); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }

/* ---------- forms ---------- */
.form-card {
  background: var(--card);
  border: 3px solid var(--border);
  border-radius: 28px;
  padding: 28px;
  box-shadow: var(--shadow);
  margin-top: 22px;
}
.question { margin-bottom: 26px; }
.question:last-child { margin-bottom: 0; }
label.q { display: block; font-weight: 800; margin-bottom: 8px; font-size: 1.05rem; }
.optional-tag { font-weight: 600; color: var(--muted); font-size: 0.85rem; }
.help { color: var(--muted); font-size: 0.98rem; margin: 0 0 10px; }

input[type="text"], input[type="number"], select, textarea {
  width: 100%;
  border: 2px solid #d8e0e6;
  border-radius: 16px;
  padding: 14px 16px;
  font: inherit;
  background: #fffdf8;
  color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 3px solid #d6c2ef; border-color: #8a5cc0; }
textarea { min-height: 110px; resize: vertical; }
input.is-notsure, textarea.is-notsure, select.is-notsure { opacity: 0.5; }

.choice-row { display: flex; flex-wrap: wrap; gap: 10px; }
.choice {
  border: 2px solid #d8e0e6; background: #fffdf8;
  border-radius: 999px; padding: 11px 16px; font-weight: 700; cursor: pointer; font-size: 0.98rem;
}
.choice:hover { border-color: #8a5cc0; }
.choice.selected { border-color: #6a3aa0; background: #efe6fb; color: var(--brand-purple); }

.meta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 10px; }
.notsure-chip {
  border: 2px solid #e0c9a6; background: #fff7e8; color: #6a4b00;
  border-radius: 999px; padding: 7px 13px; font-weight: 700; cursor: pointer; font-size: 0.9rem;
}
.notsure-chip.on { background: var(--sunshine); border-color: #e7b53f; }
.confidence { display: flex; align-items: center; gap: 6px; font-size: 0.88rem; color: var(--muted); }
.confidence select { width: auto; min-height: auto; padding: 6px 10px; border-radius: 12px; }

.photo-stub {
  border: 2px dashed #bdd7ee; border-radius: 16px; padding: 16px;
  background: #f8fbff; color: var(--muted); text-align: center; font-weight: 600;
}

/* ---------- repeatable records ---------- */
.record {
  border: 2px solid var(--border); border-radius: 22px; padding: 20px;
  margin-bottom: 18px; background: #fffdf9;
}
.record-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.record-head h3 { margin: 0; font-size: 1.15rem; }
.record-num { color: var(--muted); font-weight: 700; }

/* ---------- notices ---------- */
.notice {
  background: #fff3c4; border-left: 8px solid var(--sunshine);
  border-radius: 16px; padding: 16px 18px; margin: 20px 0;
}
.notice.soft { background: #f8fbff; border-left-color: var(--sky); }

.save-status {
  position: fixed; right: 18px; bottom: 18px;
  background: #185d39; color: #fff; font-weight: 800;
  padding: 10px 16px; border-radius: 999px; box-shadow: var(--shadow);
  opacity: 0; transform: translateY(8px); transition: opacity 0.2s, transform 0.2s; z-index: 10;
}
.save-status.show { opacity: 1; transform: translateY(0); }
.save-status.is-error { background: #7a2418; }

/* notes (comments) + history */
.nh { margin-top: 12px; }
.nh-panel {
  margin-top: 10px; padding: 14px; border-radius: 16px;
  background: #faf7ff; border: 2px solid #e7defa;
}
.comment-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.comment {
  background: #fff; border: 1px solid #e7defa; border-radius: 12px; padding: 10px 12px;
}
.comment-text { font-weight: 600; }
.note-add { display: flex; gap: 8px; flex-wrap: wrap; }
.note-add input { flex: 1 1 220px; }
.note-add .secondary { min-height: 44px; padding: 10px 16px; }
.history { background: #f8fbff; border: 2px dashed #bdd7ee; border-radius: 14px; padding: 12px; margin-top: 12px; }

.gate-error { color: #7a2418; font-weight: 700; min-height: 1.3em; margin: 6px 0 0; }

.section-header { display: flex; align-items: center; gap: 14px; margin: 6px 0 4px; }
.section-header .section-icon { margin: 0; }
.crumbs { margin-bottom: 14px; }

.status-picker { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 6px; }
.status-picker .choice { padding: 8px 13px; font-size: 0.9rem; }

@media (max-width: 640px) {
  :root { font-size: 17px; }
  .hero, .section-card, .form-card { border-radius: 22px; padding: 22px; }
  .hero::after { display: none; }
  .btn-row button, .btn-row .button { width: 100%; }
}
