/* REMI — shared styles. Change the brand colors here. */
:root {
  --orange: #ff6a00;
  --orange-dark: #e25c00;
  --orange-soft: #fff1e6;
  --brown: #3b2314;
  --charcoal: #1c1917;
  --muted: #6f625a;
  --line: #e9e2dc;
  --bg: #ffffff;
  --bg-soft: #faf7f4;
  --grey: #d9d2cc;
  --red: #b42318;
  --radius: 16px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--charcoal);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.5;
}
[hidden] { display: none !important; }
h1, h2, h3 { color: var(--brown); line-height: 1.15; margin: 0; letter-spacing: -0.02em; }
button, input, select, textarea { font: inherit; color: inherit; }

/* ---------- Logo ---------- */
.logo { display: inline-flex; align-items: center; gap: 10px; }
.logo img { height: 44px; width: auto; display: block; }
.logo-mark {
  display: inline-grid; place-items: center;
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--orange); color: #fff; font-weight: 800; font-size: 24px;
}
.logo-word { font-weight: 800; font-size: 26px; letter-spacing: 0.04em; color: var(--brown); }
.logo.big img { height: 72px; }
.logo.big .logo-mark { width: 64px; height: 64px; font-size: 34px; border-radius: 16px; }
.logo.big .logo-word { font-size: 38px; }

/* ---------- Buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 999px; cursor: pointer;
  background: var(--orange); color: #fff; font-weight: 700;
  padding: 12px 24px; text-decoration: none;
}
.btn:hover { background: var(--orange-dark); }
.btn:disabled { opacity: 0.6; cursor: default; }
.btn.big { width: 100%; padding: 18px 24px; font-size: 20px; }
.btn.ghost { background: #fff; color: var(--brown); border: 2px solid var(--line); }
.btn.ghost:hover { border-color: var(--brown); background: #fff; }

input[type="text"], input[type="tel"], input[type="email"], input[type="password"],
input[type="search"], select, textarea {
  width: 100%; padding: 14px 16px; background: #fff;
  border: 2px solid var(--line); border-radius: 14px; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--orange); }
textarea { min-height: 120px; resize: vertical; }
:focus-visible { outline: 3px solid rgba(255, 106, 0, 0.45); outline-offset: 2px; }

/* ---------- Public page ---------- */
.wrap { max-width: 680px; margin: 0 auto; padding: 32px 20px 64px; }
.hero { padding: 24px 0 8px; }
.hero h1 { font-size: clamp(40px, 9vw, 60px); margin-top: 36px; }
.hero p { font-size: 19px; color: var(--muted); margin: 18px 0 8px; }
.hero small { color: var(--orange-dark); font-weight: 700; font-size: 15px; }

.q { padding: 28px 0; border-top: 1px solid var(--line); }
.q:first-of-type { border-top: 0; }
.q label.title, .q .title { display: block; font-weight: 700; font-size: 19px; color: var(--brown); margin-bottom: 12px; }
.q .req { color: var(--orange); }
.q .opt { font-weight: 500; font-size: 14px; color: var(--muted); margin-left: 6px; }
.q .help { font-size: 14px; color: var(--muted); margin: 8px 0 0; }
.q .err { font-size: 15px; color: var(--red); font-weight: 600; margin: 10px 0 0; }

.q.key {
  background: var(--orange-soft); border: 2px solid var(--orange);
  border-radius: var(--radius); padding: 28px 22px; margin: 20px 0;
}
.q.key .title { font-size: 23px; }
.q.key + .q { border-top: 0; }

.yn { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.yn button, .chips button {
  background: #fff; border: 2px solid var(--line); border-radius: 999px;
  cursor: pointer; font-weight: 600;
}
.yn button { padding: 16px; font-size: 19px; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chips button { padding: 10px 16px; font-size: 16px; }
.yn button:hover, .chips button:hover { border-color: var(--orange); }
.yn button[aria-pressed="true"], .chips button[aria-pressed="true"] {
  background: var(--orange); border-color: var(--orange); color: #fff;
}
.other-box { margin-top: 14px; }

.form-msg {
  background: #fef3f2; border: 1px solid #fecdca; color: var(--red);
  border-radius: 14px; padding: 14px 16px; margin: 0 0 16px; font-weight: 600;
}
.privacy { font-size: 14px; color: var(--muted); text-align: center; margin-top: 22px; }

/* Thank-you screen */
.thanks { text-align: center; padding: 56px 0; }
.thanks h1 { font-size: clamp(44px, 10vw, 64px); margin: 28px 0 16px; }
.thanks p { font-size: 19px; color: var(--muted); margin: 8px auto; max-width: 460px; }
.thanks .strong { color: var(--brown); font-weight: 700; }
.thanks .btn { margin-top: 32px; padding: 16px 36px; font-size: 18px; }
.check { width: 96px; height: 96px; margin: 36px auto 0; display: block; }
.check circle { fill: none; stroke: var(--orange); stroke-width: 4; stroke-dasharray: 289; stroke-dashoffset: 289; animation: draw 0.6s ease-out forwards; }
.check path { fill: none; stroke: var(--orange); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 70; stroke-dashoffset: 70; animation: draw 0.4s 0.5s ease-out forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .check circle, .check path { animation: none; stroke-dashoffset: 0; } }

/* ---------- Owner: login ---------- */
.login { max-width: 380px; margin: 0 auto; padding: 80px 20px; text-align: center; }
.login form { margin-top: 36px; text-align: left; display: grid; gap: 14px; }
.login label { font-weight: 700; color: var(--brown); font-size: 15px; display: grid; gap: 6px; }

/* ---------- Owner: dashboard ---------- */
.topbar { background: var(--brown); color: #fff; position: sticky; top: 0; z-index: 5; }
.topbar-in { max-width: 1200px; margin: 0 auto; padding: 14px 20px 0; }
.topbar h1 { color: #fff; font-size: 22px; }
.topbar h1 span { color: var(--orange); }
.nav { display: flex; gap: 4px; overflow-x: auto; margin-top: 12px; }
.nav button {
  background: none; border: 0; color: #e7dcd4; cursor: pointer; white-space: nowrap;
  padding: 10px 14px; font-weight: 600; font-size: 15px; border-bottom: 3px solid transparent;
}
.nav button:hover { color: #fff; }
.nav button.active { color: #fff; border-bottom-color: var(--orange); }
.nav .logout { margin-left: auto; }

.dash { max-width: 1200px; margin: 0 auto; padding: 28px 20px 64px; }
.dash h2 { font-size: 26px; margin-bottom: 18px; }
.dash h3 { font-size: 17px; margin-bottom: 14px; }
.row-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.row-head h2 { margin: 0; }
.sub { color: var(--muted); font-size: 14px; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.card { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.kpi .label { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; color: var(--muted); text-transform: uppercase; }
.kpi .value { font-size: 40px; font-weight: 800; color: var(--brown); line-height: 1.1; margin-top: 8px; overflow-wrap: anywhere; }
.kpi .value.text { font-size: 24px; }
.kpi .sub { margin-top: 6px; }
.kpi.accent { background: var(--orange); border-color: var(--orange); }
.kpi.accent .label, .kpi.accent .sub { color: #fff; }
.kpi.accent .value { color: #fff; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-bottom: 14px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.donut { display: flex; align-items: center; gap: 16px; }
.donut svg { width: 110px; height: 110px; flex: none; transform: rotate(-90deg); }
.legend { list-style: none; padding: 0; margin: 0; font-size: 14px; display: grid; gap: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 8px; }
.legend b { color: var(--brown); }

.bars { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: minmax(110px, 38%) 1fr 34px; gap: 10px; align-items: center; font-size: 14px; }
.bar-track { background: #fff; border: 1px solid var(--line); border-radius: 999px; height: 16px; overflow: hidden; }
.bar-fill { background: var(--orange); height: 100%; border-radius: 999px; }
.bar-row .n { font-weight: 700; color: var(--brown); text-align: right; }
.empty { color: var(--muted); font-size: 15px; }

.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 16px; }
.filters label { font-size: 12px; font-weight: 700; color: var(--muted); display: grid; gap: 4px; text-transform: uppercase; letter-spacing: 0.04em; }
.filters input, .filters select { padding: 10px 12px; font-size: 15px; border-radius: 12px; text-transform: none; letter-spacing: 0; font-weight: 400; }
.filters .search { grid-column: 1 / -1; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--bg-soft); color: var(--brown); font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.click { cursor: pointer; }
tbody tr.click:hover { background: var(--orange-soft); }
td.nowrap { white-space: nowrap; }
td.wide { min-width: 200px; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-weight: 700; font-size: 12px; }
.pill.yes { background: var(--orange); color: #fff; }
.pill.no { background: var(--brown); color: #fff; }
.pill.na { background: var(--grey); color: var(--charcoal); }

.modal { position: fixed; inset: 0; background: rgba(28, 25, 23, 0.55); display: grid; place-items: center; padding: 16px; z-index: 20; }
.modal-box { background: #fff; border-radius: 20px; max-width: 560px; width: 100%; max-height: 90vh; overflow: auto; padding: 28px; }
.modal-box h2 { margin-bottom: 4px; }
.modal-box dl { margin: 18px 0 22px; display: grid; gap: 14px; }
.modal-box dt { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.modal-box dd { margin: 2px 0 0; overflow-wrap: anywhere; white-space: pre-wrap; }

.notice { background: var(--orange-soft); border: 1px solid var(--orange); border-radius: 14px; padding: 14px 16px; margin-bottom: 18px; }
