/* Mobile-first. Colours and shapes follow phanganbunkhouse.com.
   Fonts are served from public/fonts/ (SIL OFL); nothing is loaded from other sites. */

@font-face {
  font-family: "Mulish";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/mulish-latin-500-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308,
    U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Mulish";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/mulish-latin-600-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308,
    U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Mulish";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/mulish-latin-700-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308,
    U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Mulish";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("/fonts/mulish-latin-800-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308,
    U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Open Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/open-sans-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308,
    U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Open Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/open-sans-latin-600-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308,
    U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #ffffff;
  --surface: #f7fafd;
  --surface-strong: #ddeaf6;
  --card: #ffffff;
  --text: #2c3c4a;
  --heading: #040b11;
  --muted: #666666;
  --border: #dddddd;
  --border-strong: #cccccc;
  --primary: #235784;
  --primary-dark: #1a4367;
  --yellow: #f7aa00; /* decoration and "new" markers only, never a text colour */
  --error: #b3261e;
  --radius: 8px;
  --shadow: 0 0.5rem 1.75rem rgb(35 87 132 / 0.12);
  --font-head: "Mulish", "Segoe UI", Roboto, sans-serif;
  --font-body: "Open Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

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

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.6 var(--font-body);
}

h1,
h2,
h3 {
  color: var(--heading);
  font-family: var(--font-head);
  font-weight: 800;
  line-height: 1.2;
}

h3 {
  font-weight: 700;
}

h1 {
  margin: 0 0 0.75rem;
  font-size: 1.875rem;
}

a {
  color: var(--primary);
}

a:hover {
  color: var(--primary-dark);
}

:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

/* Header and footer */

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--card);
}

.site-header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  max-width: 64rem;
  min-height: 4.25rem;
  margin: 0 auto;
  padding: 0.75rem 1rem;
}

/* Brand logo, used in every header and on the QR poster (public/logo.svg, 1091 x 310).
   The text inside .wordmark stays for screen readers. */
.wordmark {
  flex: none;
  display: block;
  height: 2.75rem;
  aspect-ratio: 1091 / 310;
  margin: 0;
  background: url("/logo.svg") center / contain no-repeat;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.wordmark > span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.admin .site-header .wordmark {
  height: 2.25rem;
}

.site-footer {
  padding: 1.5rem 1rem;
  background: var(--primary);
  color: #fff;
  font-family: var(--font-head);
  font-size: 0.95rem;
  font-weight: 600;
  text-align: center;
}

.site-footer p {
  margin: 0;
}

main {
  flex: 1 0 auto;
}

.page {
  width: 100%;
  max-width: 36rem;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

/* Hero band of the guest form */

.hero {
  padding: 2rem 1rem 3.5rem;
  background: linear-gradient(160deg, var(--surface) 0%, var(--surface-strong) 100%);
}

.hero-inner {
  max-width: 34rem;
  margin: 0 auto;
}

.hero h1 {
  margin: 0;
  font-size: 2.125rem;
}

.hero h1::after {
  display: block;
  width: 3.5rem;
  height: 0.3rem;
  margin-top: 0.6rem;
  border-radius: 99px;
  background: var(--yellow);
  content: "";
}

.lead {
  margin: 1.25rem 0 0;
  padding-left: 0.875rem;
  border-left: 3px solid var(--primary);
}

.page-form {
  position: relative;
  margin-top: -2rem;
  padding-top: 0;
}

.notice {
  margin: 0 0 1.5rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  background: var(--surface-strong);
  color: var(--heading);
  font-size: 0.9rem;
}

.card {
  padding: 1.25rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}

.field {
  margin: 0 0 1.5rem;
  padding: 0;
  border: 0;
  min-width: 0;
}

.label {
  display: block;
  margin-bottom: 0.5rem;
  padding: 0;
  color: var(--heading);
  font-family: var(--font-head);
  font-weight: 700;
}

.optional,
.hint,
.counter {
  color: var(--muted);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.875rem;
}

/* Category tiles: real radio buttons, visually replaced by the box next to them. */
.choices {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}

.choice {
  position: relative;
  display: flex;
}

.choice input {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.choice-box {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  min-height: 5.5rem;
  padding: 0.75rem 0.25rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--heading);
  font-family: var(--font-head);
  font-size: 0.95rem;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  user-select: none;
}

.icon {
  flex: none;
  width: 1.75rem;
  height: 1.75rem;
  fill: none;
  stroke: var(--primary);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.choice-box:hover {
  border-color: var(--primary);
}

.choice input:checked + .choice-box {
  border-color: var(--primary);
  background: var(--surface-strong);
  box-shadow: 0 0 0 1px var(--primary);
}

.choice input:focus-visible + .choice-box {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
}

textarea {
  display: block;
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--card);
  color: inherit;
  font: inherit;
  resize: vertical;
}

textarea::placeholder {
  color: var(--muted);
}

textarea:focus {
  border-color: var(--primary);
  outline: 2px solid var(--primary);
  outline-offset: 0;
}

.counter {
  margin: 0.25rem 0 0;
  text-align: right;
}

.file-input {
  max-width: 100%;
  font: inherit;
  font-size: 0.95rem;
}

/* With JavaScript the native file input is replaced by a large button. */
.js .file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.file-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.9rem;
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--primary);
  font-family: var(--font-head);
  font-weight: 700;
  text-align: center;
  cursor: pointer;
}

.file-button:hover {
  border-color: var(--primary);
}

.file-button .icon {
  width: 1.4rem;
  height: 1.4rem;
}

.file-input:focus-visible + .file-button {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

.preview img {
  display: block;
  max-width: 100%;
  max-height: 18rem;
  margin: 0 auto;
  border-radius: var(--radius);
}

.preview p {
  margin: 0.5rem 0;
  text-align: center;
  overflow-wrap: anywhere;
}

.error {
  margin: 0.5rem 0 0;
  color: var(--error);
  font-size: 0.95rem;
}

.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.button {
  display: block;
  width: 100%;
  padding: 0.85rem 1.25rem;
  border: 2px solid var(--primary);
  border-radius: var(--radius);
  background: var(--primary);
  color: #fff;
  font-family: var(--font-head);
  font-size: 1.0625rem;
  font-weight: 800;
  line-height: 1.4;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.button:hover {
  border-color: var(--primary-dark);
  background: var(--primary-dark);
  color: #fff;
}

.button:disabled {
  opacity: 0.6;
  cursor: progress;
}

.button-secondary {
  background: var(--card);
  color: var(--primary);
}

.button-secondary:hover {
  border-color: var(--primary);
  background: var(--surface-strong);
  color: var(--primary-dark);
}

/* Thanks and error pages */

.guest-surface {
  background: var(--surface);
}

.page-message {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 2.5rem;
  text-align: center;
}

.page-message .card {
  padding: 2rem 1.25rem;
}

.page-message .card > :last-child {
  margin-bottom: 0;
}

.page-message .button {
  margin-top: 1.5rem;
}

.big-icon {
  width: 4rem;
  height: 4rem;
  margin: 0 auto 0.75rem;
  padding: 0.85rem;
  border-radius: 50%;
  background: var(--surface-strong);
  stroke-width: 2.5;
}

@media (min-width: 40rem) {
  .page {
    padding-top: 2.5rem;
  }

  .page-form {
    padding-top: 0;
  }

  .card {
    padding: 1.75rem;
  }

  .hero {
    padding: 3.5rem 1rem 4.5rem;
  }

  .hero h1 {
    font-size: 3rem;
  }
}

@media (min-width: 48rem) {
  body {
    font-size: 1.125rem;
  }

  .site-header-inner {
    padding-inline: 1.5rem;
  }

  .wordmark,
  .admin .site-header .wordmark {
    height: 3.5rem;
  }

  .admin-nav {
    gap: 1rem;
  }
}

/* Admin panel */

.admin {
  background: var(--surface);
}

.admin .card {
  box-shadow: 0 0.2rem 0.75rem rgb(35 87 132 / 0.08);
}

.admin-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
  font-family: var(--font-head);
}

/* Phones: keeps the logo and the admin links on one line. */
@media (max-width: 29.99rem) {
  .admin .site-header-inner {
    column-gap: 0.4rem;
  }

  .admin .site-header .wordmark {
    height: 1.9rem;
  }

  .admin-nav {
    gap: 0.35rem;
  }

  .admin-nav .topbar-link {
    padding-inline: 0.1rem;
  }
}

.page-admin {
  max-width: 52rem;
}

.page-login {
  max-width: 26rem;
}

.input {
  max-width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
}

.input:focus {
  border-color: var(--primary);
}

.page-login .input {
  width: 100%;
}

.topbar-link {
  padding: 0.5rem 0.25rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.topbar-icon {
  display: block;
  width: 1.4rem;
  height: 1.4rem;
  fill: none;
  stroke: currentcolor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.input-wide {
  display: block;
  width: 100%;
}

.push-status {
  margin-bottom: 0;
}

.device {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.device-text {
  display: grid;
  flex: 1 1 14rem;
  min-width: 0;
  overflow-wrap: anywhere;
}

.button-small {
  width: auto;
  padding: 0.5rem 1rem;
  font-size: 0.95rem;
}

.admin-nav .button-small {
  padding: 0.4rem 0.65rem;
  font-size: 0.875rem;
  white-space: nowrap;
}

.button-danger {
  border-color: var(--error);
  background: var(--card);
  color: var(--error);
}

.button-danger:hover {
  border-color: var(--error);
  background: #fbeae9;
  color: var(--error);
}

.filters,
.inline,
.meta,
.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.filters {
  align-items: flex-end;
  gap: 0.75rem;
  margin-top: 1rem;
}

.filters label {
  display: grid;
  gap: 0.25rem;
  color: var(--heading);
  font-family: var(--font-head);
  font-size: 0.9rem;
  font-weight: 600;
}

.filters > a {
  padding: 0.6rem 0;
}

/* Badges: statuses are filled and categories outlined, so the two never read alike. */

.badge {
  display: inline-block;
  padding: 0.1rem 0.65rem;
  border: 1px solid transparent;
  border-radius: 99px;
  font-family: var(--font-head);
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}

.badge-complaint {
  border-color: #e2b9b4;
  background: #fff8f7;
  color: #8f342a;
}

.badge-suggestion {
  border-color: #b5d5c4;
  background: #f6fbf8;
  color: #2b634a;
}

.badge-other {
  border-color: var(--border-strong);
  background: var(--card);
  color: #55606b;
}

.badge-new {
  background: var(--yellow);
  color: var(--heading);
}

.badge-in_progress {
  background: var(--surface-strong);
  color: var(--primary);
}

.badge-resolved {
  background: #e7ebe8;
  color: #46534b;
}

.badge-count {
  padding-block: 0.25rem;
  background: var(--yellow);
  color: var(--heading);
  font-size: 0.85rem;
  text-decoration: none;
}

.badge-count:hover {
  color: var(--heading);
  text-decoration: underline;
}

.messages {
  display: grid;
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.message-row {
  display: flex;
  gap: 0.75rem;
  color: inherit;
  text-decoration: none;
}

.message-row:hover {
  border-color: var(--primary);
  color: inherit;
}

.message-row.is-new {
  border-left: 5px solid var(--yellow);
}

.message-text {
  display: grid;
  flex: 1;
  align-content: start;
  gap: 0.5rem;
  min-width: 0;
}

.excerpt {
  overflow-wrap: anywhere;
}

.thumb {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: var(--radius);
  object-fit: cover;
}

.pager {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  margin-top: 1.5rem;
}

.pager > :last-child {
  text-align: right;
}

.section {
  margin-top: 1rem;
}

.section-button {
  margin-top: 0.75rem;
}

.message-body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.photo {
  display: block;
  margin-top: 1rem;
}

.photo img {
  display: block;
  max-width: 100%;
  max-height: 28rem;
  border-radius: var(--radius);
}

/* QR poster: shown on screen as it will print on A4. */

.poster {
  width: 100%;
  max-width: 36rem;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
  text-align: center;
}

.poster .wordmark {
  height: auto;
  max-width: 20rem;
  margin: 0 auto 1.5rem;
}

.poster h1 {
  font-size: 2.125rem;
}

.poster-lead {
  margin: 0;
  font-size: 1.2rem;
}

/* The QR code stays black on white, whatever the page colours are. */
.poster-qr {
  max-width: 24rem;
  margin: 1.5rem auto;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.poster-qr svg {
  display: block;
  width: 100%;
  height: auto;
}

.poster-url {
  margin: 0 0 2rem;
  color: var(--primary);
  font-family: var(--font-head);
  font-size: 1.125rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

@page {
  size: A4;
  margin: 15mm;
}

@media print {
  body,
  body.admin {
    display: block;
    min-height: 0;
    background: #fff;
  }

  .site-header,
  .site-footer,
  .poster-print {
    display: none !important;
  }

  .poster {
    max-width: none;
    padding: 4mm 0 0;
    break-inside: avoid;
  }

  .poster .wordmark {
    width: 120mm;
    max-width: 100%;
    margin-bottom: 10mm;
  }

  .poster h1 {
    margin-bottom: 4mm;
    font-size: 32pt;
  }

  .poster-lead {
    font-size: 16pt;
  }

  .poster-qr {
    width: 130mm;
    max-width: 100%;
    margin: 10mm auto 8mm;
    padding: 5mm;
    border: 0.5mm solid var(--border-strong);
    box-shadow: none;
  }

  .poster-url {
    margin: 0;
    font-size: 15pt;
  }
}
