/* Over the Rainbow Butterfly Garden – supervisor contact site
   Fonts: KB You're Just My Type (headings), Montserrat (everything else)
   Look: teal crumpled paper, white panels with square corners, black outlines (matches otrbg.com) */

@font-face {
  font-family: "KBYoureJustMyType";
  src: url("/assets/KBYoureJustMyType.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face { font-family: "Montserrat"; font-weight: 400; font-display: swap; src: url("/assets/montserrat-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 500; font-display: swap; src: url("/assets/montserrat-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 600; font-display: swap; src: url("/assets/montserrat-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 700; font-display: swap; src: url("/assets/montserrat-latin-700-normal.woff2") format("woff2"); }

:root {
  --teal: #89c3b4;
  --orange: #d07831;
  --ink: #000;
  --muted: #3f3f3f;
  --hair: #cfcfcf;
  --tint: #eef7f4;
  --open: #23784a;
  --alert: #a8281d;
  --alert-bg: #fdecea;
  --warm-bg: #fbeee0;
  --warm-ink: #5c3006;
  --rainbow-red: #d94a38;
  --rainbow-orange: #d8792d;
  --rainbow-yellow: #eab52b;
  --rainbow-green: #b0d23c;
  --display: "KBYoureJustMyType", "Courier New", monospace;
  --body: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--teal) url("/assets/paper-teal.jpg") center top / cover no-repeat;
  color: var(--ink);
  font: 400 1rem/1.6 var(--body);
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (min-width: 900px) { body { background-attachment: fixed; } }

h1, h2, h3 { margin: 0; font-family: var(--display); font-weight: 400; text-transform: uppercase; line-height: 1.1; letter-spacing: 0.01em; }
h1 { font-size: clamp(1.9rem, 6.4vw, 2.7rem); }
h2 { font-size: clamp(1.5rem, 5vw, 2rem); }
p { margin: 0; }

:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
[tabindex="-1"]:focus { outline: none; } /* headings we move focus to for screen readers */

/* ---------- Header ---------- */
.site-header {
  max-width: 1040px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 0;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.5rem;
  flex-wrap: wrap;
}
.brand { display: block; line-height: 0; }
.brand img { width: clamp(210px, 32vw, 320px); height: auto; }
.header-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; }
body[data-view="sent"] .site-link-header { visibility: hidden; }

/* ---------- Layout ---------- */
.wrap { max-width: 1040px; margin: 0 auto; padding: 1.75rem 1.25rem 4rem; }
.wrap.wide { max-width: 1040px; }
.panel {
  position: relative;
  max-width: 740px;
  margin: 0 auto;
  background: #fff;
  padding: 3.1rem 2.5rem 2.6rem;
}
/* four stripes, taken from the arcs in the logo */
.panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 20px;
  background: linear-gradient(to bottom,
    var(--rainbow-red) 0 5px,
    var(--rainbow-orange) 5px 10px,
    var(--rainbow-yellow) 10px 15px,
    var(--rainbow-green) 15px 20px);
}
.panel.login { max-width: 480px; }
.panel.login form { margin-top: 0; padding-top: 0; border-top: 0; }
@media (max-width: 560px) { .panel { padding: 2.6rem 1.25rem 2rem; } }

.sub { margin-top: 0.7rem; font-size: 1rem; }
.rule { border: 0; border-top: 2px solid var(--ink); margin: 1rem 0 1.25rem; }
.lede { max-width: 62ch; }

/* ---------- Clock ---------- */
.clock {
  margin-top: 1.5rem;
  border: 1.5px solid var(--ink);
  padding: 0.85rem 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem 1.4rem;
  flex-wrap: wrap;
}
.clock-time {
  font-family: var(--display);
  font-size: clamp(2rem, 8vw, 2.7rem);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.clock-time small { font-size: 0.45em; margin-left: 0.3em; }
.clock-meta { flex: 1 1 15rem; font-size: 0.95rem; }
.clock-meta .day { font-weight: 700; }
.status { display: flex; align-items: flex-start; gap: 0.5rem; margin-top: 0.15rem; }
.dot { width: 0.7rem; height: 0.7rem; margin-top: 0.42rem; border-radius: 50%; background: #8a8a8a; flex: none; }
.status.open .dot { background: var(--open); }
.status.closed .dot { background: var(--orange); }

/* ---------- Notices ---------- */
.emergency, .lockout, .inline-note {
  margin-top: 1.25rem;
  padding: 0.95rem 1.1rem;
  border-left: 6px solid var(--alert);
  background: var(--alert-bg);
}
.emergency > strong:first-child { display: block; color: var(--alert); font-size: 1.05rem; margin-bottom: 0.2rem; }
.lockout, .inline-note { border-left-color: var(--orange); background: var(--warm-bg); }
.lockout > strong:first-child { display: block; color: var(--warm-ink); font-size: 1.05rem; margin-bottom: 0.2rem; }
.lockout p + p { margin-top: 0.4rem; }
.inline-note { margin-top: 1.25rem; font-weight: 600; color: var(--warm-ink); }
.inline-note strong { color: var(--warm-ink); }

/* ---------- Form ---------- */
form { margin-top: 1.9rem; padding-top: 1.75rem; border-top: 2px solid var(--ink); }
.field { margin-top: 1.25rem; }
form > .field:first-child { margin-top: 0; }
.rule + form { margin-top: 0; padding-top: 0; border-top: 0; }
label { display: block; font-weight: 600; margin-bottom: 0.35rem; }
.hint { display: block; font-weight: 400; font-size: 0.875rem; color: var(--muted); margin-top: 0.1rem; }

input[type="text"], input[type="password"], input[type="date"], input[type="time"], input[type="tel"], input[type="url"], input[type="search"], select, textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid var(--ink);
  border-radius: 0;
  padding: 0.7rem 0.85rem;
  min-height: 3rem;
}
select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2.6rem;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1.2 7 7.2l6-6' fill='none' stroke='%23000' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 0.95rem center;
}
textarea { min-height: 8rem; resize: vertical; }
input:focus, select:focus, textarea:focus { background-color: var(--tint); }

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem; align-items: end; }
@media (max-width: 480px) { .row { grid-template-columns: 1fr; } }

.privacy { margin-top: 0.45rem; font-size: 0.875rem; color: var(--muted); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- File upload (screenshot for Spokechoice lockouts) ---------- */
.file-drop {
  display: block;
  border: 1.5px dashed var(--ink);
  background: var(--tint);
  padding: 1.1rem;
  text-align: center;
  cursor: pointer;
}
.file-drop:hover, .file-drop:focus-within { background: #fff; }
.file-drop input[type="file"] {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap;
}
.file-drop .file-label { font-weight: 600; }
.file-drop .file-sub { display: block; margin-top: 0.25rem; font-size: 0.85rem; color: var(--muted); }
.file-preview {
  margin-top: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border: 1.5px solid var(--ink);
  padding: 0.6rem 0.75rem;
}
.file-preview img { width: 3rem; height: 3rem; object-fit: cover; flex: none; background: #fff; border: 1px solid var(--hair); }
.file-preview .name { font-size: 0.9rem; font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-preview .remove {
  border: 1.5px solid var(--ink); background: #fff; color: var(--alert); font-weight: 700; cursor: pointer; font-size: 0.8rem;
  padding: 0.35rem 0.6rem;
}
.file-preview .remove:hover { background: var(--ink); color: #fff; }
.file-error { margin-top: 0.5rem; font-size: 0.875rem; color: var(--alert); font-weight: 600; }
.file-error:empty { display: none; }

/* ---------- Buttons (outlined like the website's "Apply now") ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: 500 0.95rem/1.2 var(--body);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  background: var(--orange);
  border: 1.5px solid var(--ink);
  border-radius: 0;
  padding: 0.85rem 1.5rem;
  min-height: 3rem;
  cursor: pointer;
}
.btn:hover { background: var(--ink); color: #fff; }
.btn:disabled { opacity: 0.6; cursor: wait; }
.btn.secondary { background: transparent; }
.btn.secondary:hover { background: var(--ink); color: #fff; }
.btn.block { display: flex; width: 100%; margin-top: 1.6rem; }
.btn.small { min-height: 2.5rem; padding: 0.45rem 1rem; font-size: 0.85rem; }

.after-note { margin-top: 0.9rem; font-size: 0.9rem; color: var(--muted); text-align: center; }

.error { margin-top: 1.1rem; color: var(--alert); font-weight: 600; }
.error:empty { display: none; }

/* ---------- After sending ---------- */
.done-card { margin-top: 0.4rem; }
.done-card h2 { margin-bottom: 0.9rem; }
.done-card p + p { margin-top: 0.6rem; }
.done-card .ref { color: var(--muted); font-size: 0.9rem; }
.done-actions { display: flex; gap: 0.7rem; flex-wrap: wrap; margin-top: 1.6rem; }

.admin-link { margin-top: 1.75rem; text-align: center; }
.help-note { margin-top: 1.4rem; font-size: 0.92rem; color: var(--muted); text-align: center; }
.help-note a { color: var(--ink); font-weight: 600; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

/* ---------- Home screen menu ---------- */
.panel.home { max-width: 620px; padding-top: 3.4rem; }
.welcome { text-align: center; font-size: clamp(1.7rem, 6.5vw, 2.3rem); }
.welcome-line { display: block; }
.welcome-logo { display: block; width: min(100%, 400px); height: auto; margin: 0.4rem auto 0; }
.panel.home .rule { margin: 1.1rem 0 1.5rem; }
.ask { text-align: center; font-size: clamp(1.25rem, 4.6vw, 1.6rem); margin-bottom: 1.1rem; }

.choices { display: grid; gap: 0.8rem; }
.choice {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.05rem 1.2rem;
  min-height: 4.6rem;
  background: #fff;
  color: var(--ink);
  border: 1.5px solid var(--ink);
  border-left: 10px solid var(--orange); /* orange is the accent */
  text-decoration: none;
}
@media (hover: hover) { .choice:hover { background: var(--ink); color: #fff; } }
.choice .ico {
  width: 2.1rem; height: 2.1rem; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}
.choice .txt { display: grid; gap: 0.15rem; min-width: 0; }
.choice .t { font-family: var(--display); font-size: clamp(1.25rem, 4.8vw, 1.55rem); text-transform: uppercase; line-height: 1.1; }
.choice .s { font-size: 0.9rem; line-height: 1.35; }
.home-out { margin-top: 1.5rem; padding-top: 1.5rem; border-top: 2px solid var(--ink); }

/* ---------- "Have you downloaded the app?" screen ---------- */
.gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  overflow-y: auto;
  display: flex;
  background: var(--teal) url("/assets/paper-teal.jpg") center top / cover no-repeat;
  padding: 1.25rem;
  padding-top: calc(1.25rem + env(safe-area-inset-top, 0px));
  padding-bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
}
html.skip-gate .gate { display: none; }
.gate-card { margin: auto; width: 100%; max-width: 500px; text-align: center; padding-top: 3.2rem; }
.gate-logo { display: block; width: min(100%, 300px); height: auto; margin: 0 auto 1.25rem; }
.gate-card h1 { font-size: clamp(1.7rem, 7vw, 2.2rem); }
.gate-text { margin: 0.9rem auto 0; max-width: 40ch; }
.gate-card .btn.block { margin-top: 1.4rem; }
.gate-card .btn.block + .gate-steps,
.gate-card .btn.block + .gate-done { margin-top: 1rem; }
.gate-steps { text-align: left; border: 1.5px solid var(--ink); background: var(--tint); padding: 1rem 1.1rem; font-size: 0.92rem; }
.gate-steps ol { margin: 0; padding-left: 1.3rem; }
.gate-steps li + li { margin-top: 0.45rem; }
.gate-steps p { margin-top: 0.75rem; color: var(--muted); }
.gate-done { font-weight: 600; border-left: 6px solid var(--orange); background: var(--warm-bg); padding: 0.8rem 1rem; text-align: left; }
.gate-note { margin-top: 1rem; font-size: 0.875rem; color: var(--muted); }

/* ---------- Supervisor inbox ---------- */
.page-title { margin: 0.4rem 0 1.4rem; }

.notify-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem 0.9rem;
  flex-wrap: wrap;
  border: 1.5px solid var(--ink);
  background: #fff;
  padding: 0.85rem 1.1rem;
  margin-bottom: 1.1rem;
}
.notify-bar label { margin: 0; font-weight: 600; font-size: 0.9rem; white-space: nowrap; }
.notify-bar select {
  width: auto;
  min-height: 2.5rem;
  padding: 0.4rem 2.4rem 0.4rem 0.75rem;
  font-size: 0.9rem;
}
.notify-bar .bell { font-size: 1.15rem; line-height: 1; flex: none; }
.notify-bar .status-text { font-size: 0.85rem; color: var(--muted); flex: 1 1 14rem; }
.notify-bar .test-sound {
  min-height: 2.3rem;
  padding: 0.4rem 0.9rem;
  font-size: 0.8rem;
}

/* Top-level switch between the Requests inbox and the Heads Up Reports list */
.section-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; margin-bottom: 1.4rem; }
.section-nav .tab { font-family: var(--display); font-weight: 400; font-size: clamp(1.1rem, 4vw, 1.4rem); text-transform: uppercase; padding: 0.85rem 0.75rem; min-height: 3.4rem; }
.section-nav .tab .n { font-family: var(--body); font-size: 0.85rem; }

.tabs { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.9rem; }
.tab {
  font: 600 0.95rem/1.2 var(--body);
  padding: 0.6rem 1rem;
  border: 1.5px solid var(--ink);
  border-radius: 0;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}
.tab:hover { background: var(--tint); }
.tab[aria-pressed="true"] { background: var(--ink); color: #fff; }
.tab .n {
  display: inline-block;
  min-width: 1.5rem;
  margin-left: 0.5rem;
  padding: 0.05rem 0.4rem;
  background: var(--orange);
  color: var(--ink);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

#list { margin-top: 1.4rem; }
.req {
  background: #fff;
  border: 1.5px solid var(--ink);
  margin-bottom: 0.8rem;
}
.req[data-status="new"] { border-left: 9px solid var(--orange); }
.req[data-status="done"] { border-left: 9px solid #8a8a8a; }
.req summary {
  list-style: none;
  cursor: pointer;
  padding: 0.95rem 1.1rem;
  display: grid;
  gap: 0.2rem;
}
.req summary::-webkit-details-marker { display: none; }
.req summary:hover { background: var(--tint); }
.req .top { display: flex; justify-content: space-between; gap: 0.25rem 1rem; align-items: baseline; flex-wrap: wrap; }
.req .name { font-weight: 700; font-size: 1.05rem; }
.req .when { color: var(--muted); font-size: 0.9rem; }
.req .kind { font-weight: 600; }
.req .preview { color: var(--muted); font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.req[open] .preview { display: none; }

.req .body { padding: 0 1.1rem 1.1rem; border-top: 1px solid var(--hair); }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.4rem 1.1rem; margin: 1rem 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; word-break: break-word; }
.msg { white-space: pre-wrap; background: var(--tint); padding: 0.85rem 1rem; margin-bottom: 1rem; }
.attachment { margin-bottom: 1rem; }
.attachment .att-label { display: block; font-size: 0.9rem; color: var(--muted); font-weight: 600; margin-bottom: 0.4rem; }
.attachment a { display: inline-block; border: 1.5px solid var(--ink); line-height: 0; }
.attachment img { max-width: 220px; max-height: 220px; display: block; }
.actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.8rem; align-items: center; }
select.move { width: auto; min-height: 2.5rem; padding: 0.35rem 2.4rem 0.35rem 0.75rem; font-size: 0.9rem; }
.handled { color: var(--muted); font-size: 0.9rem; margin-top: 0.7rem; }

.empty { background: #fff; text-align: center; color: var(--muted); padding: 2.5rem 1rem; }

/* ---------- Heads Up Reports (admin) ---------- */
.hu-intro { max-width: 62ch; margin-bottom: 1.1rem; }
.box { background: #fff; border: 1.5px solid var(--ink); padding: 1.25rem 1.25rem 1.4rem; margin-bottom: 1.4rem; }
.box h2 { font-size: 1.35rem; margin-bottom: 0.9rem; }
.box form { margin-top: 0; padding-top: 0; border-top: 0; }
.box .btn.block { margin-top: 1.25rem; }
.hu-tools { display: flex; align-items: center; gap: 0.6rem 1rem; flex-wrap: wrap; margin-bottom: 0.9rem; }
.hu-tools input[type="search"] { flex: 1 1 14rem; width: auto; }
.hu-count { color: var(--muted); font-size: 0.9rem; font-weight: 600; }

.hu { background: #fff; border: 1.5px solid var(--ink); border-left: 9px solid var(--rainbow-green); margin-bottom: 0.7rem; padding: 0.95rem 1.1rem; }
.hu .who { font-weight: 700; font-size: 1.05rem; }
.hu .phone { color: var(--muted); font-variant-numeric: tabular-nums; }
.hu .link { margin-top: 0.3rem; font-size: 0.85rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hu .actions { margin-top: 0.8rem; }
.hu form { margin: 0; padding: 0; border: 0; }
.hu .btn.danger { color: var(--alert); }
.hu .btn.danger:hover { background: var(--alert); color: #fff; }

/* ---------- Toast (new-submission notification) ---------- */
.toast-stack {
  position: fixed;
  left: 0; right: 0;
  bottom: calc(1.1rem + env(safe-area-inset-bottom, 0px));
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 0 1rem;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  max-width: 26rem;
  width: 100%;
  background: var(--ink);
  color: #fff;
  border: 1.5px solid var(--ink);
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-size: 0.92rem;
}
.toast .dot2 { width: 0.6rem; height: 0.6rem; background: var(--orange); flex: none; }
.toast button {
  margin-left: auto; background: transparent; border: 0; color: #fff; opacity: 0.7; cursor: pointer; font-size: 1rem; padding: 0.2rem;
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
