/* Kiosk: a fixed light look that matches the printed CFRM card.
   Sized for a 10.5" tablet in landscape; also works in portrait. */
:root {
  --bg: #ffffff;
  --ink: #1d2733;
  --muted: #5d6b79;
  --line: #d9e0e7;
  --soft: #f3f6f9;
  --brand: #1cabe2;          /* UNICEF cyan, used for the header rule */
  --excellent: #2f9e44;      /* face colours from the mockup */
  --good: #f08c00;
  --poor: #e03131;
  --primary: #1565c0;
  --danger: #c62828;
  --font: "Noto Sans", "Noto Sans Myanmar", "Padauk", "Myanmar Text", "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  display: flex;
  flex-direction: column;
  user-select: none;
  -webkit-user-select: none;
  overscroll-behavior: none;
  padding: env(safe-area-inset-top, 0px) 16px env(safe-area-inset-bottom, 0px);
}
[hidden] { display: none !important; }

.en { display: block; }
.my { display: block; font-size: 0.82em; color: var(--muted); line-height: 1.7; }

/* Header with the two logos */
.brand {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 8px 12px;
  border-bottom: 3px solid var(--brand);
}
.logo img { height: 64px; width: auto; display: block; }
.logo-text { display: flex; flex-direction: column; font-weight: 800; font-size: 34px; line-height: 1; }
.logo-text small { font-size: 14px; font-weight: 500; margin-top: 4px; }
.logo-text.unicef { color: #1cabe2; }
.logo-text.rtm { color: #1f3c88; font-style: italic; font-family: Georgia, serif; text-align: right; }

.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(16px, 3vh, 32px);
  padding-block: 24px;
  text-align: center;
}
.q { margin: 0; font-size: clamp(26px, 4vw, 42px); font-weight: 700; text-wrap: balance; }
.q .my { font-weight: 500; }
.hint { margin: 0; color: var(--muted); font-size: 18px; }
.hint span { display: inline; }

/* Rating faces */
.faces {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(16px, 4vw, 56px);
  transition: opacity .3s;
}
.faces.cooling { opacity: .35; pointer-events: none; }
.face {
  --c: var(--ink);
  appearance: none;
  border: 3px solid var(--c);
  background: var(--bg);
  border-radius: 24px;
  width: clamp(180px, 26vw, 300px);
  padding: 20px 12px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font: inherit;
  font-size: clamp(22px, 2.6vw, 30px);
  font-weight: 700;
  color: var(--c);
  cursor: pointer;
  transition: transform .12s, background .12s;
}
.face .my { color: var(--c); font-weight: 600; }
.face:active { transform: scale(.96); background: var(--soft); }
.face:focus-visible { outline: 4px solid var(--primary); outline-offset: 4px; }
.face svg { width: 70%; max-width: 180px; height: auto; }
.face svg circle:first-child { fill: none; stroke: var(--c); stroke-width: 7; }
.face svg .eye { fill: var(--c); }
.face svg path { fill: none; stroke: var(--c); stroke-width: 7; stroke-linecap: round; }
.face.excellent { --c: var(--excellent); }
.face.good { --c: var(--good); }
.face.poor { --c: var(--poor); }

/* Chosen rating shown small on the area screen */
.picked { display: flex; align-items: center; gap: 12px; font-size: 22px; font-weight: 700; }
.picked svg { width: 56px; height: 56px; }
.picked svg circle:first-child { fill: none; stroke: currentColor; stroke-width: 8; }
.picked svg .eye { fill: currentColor; }
.picked svg path { fill: none; stroke: currentColor; stroke-width: 8; stroke-linecap: round; }

/* Area choices */
.areas { display: flex; flex-wrap: wrap; justify-content: center; gap: 20px; }
.area {
  appearance: none;
  position: relative;
  min-width: clamp(200px, 24vw, 280px);
  padding: 24px 24px 20px 72px;
  border: 3px solid var(--line);
  border-radius: 18px;
  background: var(--bg);
  font: inherit;
  font-size: 26px;
  font-weight: 700;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.area .tick {
  position: absolute;
  left: 22px;
  top: 50%;
  translate: 0 -50%;
  width: 34px;
  height: 34px;
  border: 3px solid var(--muted);
  border-radius: 8px;
}
.area[aria-pressed="true"] { border-color: var(--primary); background: #e8f1fc; }
.area[aria-pressed="true"] .tick { background: var(--primary); border-color: var(--primary); }
.area[aria-pressed="true"] .tick::after {
  content: "";
  position: absolute;
  left: 9px; top: 2px;
  width: 9px; height: 18px;
  border: solid #fff;
  border-width: 0 4px 4px 0;
  rotate: 45deg;
}
.area:focus-visible { outline: 4px solid var(--primary); outline-offset: 4px; }

/* Buttons */
.actions { display: flex; gap: 16px; justify-content: center; }
.actions.wrap { flex-wrap: wrap; }
.btn {
  appearance: none;
  border: 3px solid var(--primary);
  border-radius: 14px;
  padding: 16px 36px;
  font: inherit;
  font-size: 24px;
  font-weight: 700;
  cursor: pointer;
  background: var(--bg);
  color: var(--primary);
}
.btn span { display: inline; }
.btn .my { color: inherit; }
.btn.primary { background: var(--primary); color: #fff; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn:active { transform: scale(.97); }
.btn:focus-visible { outline: 4px solid var(--ink); outline-offset: 3px; }

/* Thank you */
.thanks .check { width: 160px; height: 160px; }
.thanks .check circle { fill: none; stroke: var(--excellent); stroke-width: 6; }
.thanks .check path { fill: none; stroke: var(--excellent); stroke-width: 8; stroke-linecap: round; stroke-linejoin: round; }

/* Setup, PIN and admin panels */
.panel { max-width: 560px; width: 100%; margin: 0 auto; align-items: stretch; text-align: left; justify-content: flex-start; padding-top: 48px; }
.panel h1 { margin: 0; font-size: 30px; }
.panel p { margin: 0; color: var(--muted); font-size: 17px; line-height: 1.5; }
.panel form { display: flex; flex-direction: column; gap: 10px; }
.panel label { font-weight: 600; margin-top: 8px; }
.panel input {
  font: inherit;
  font-size: 22px;
  padding: 12px 14px;
  border: 2px solid var(--line);
  border-radius: 10px;
  user-select: text;
  -webkit-user-select: text;
}
.panel input:focus { outline: none; border-color: var(--primary); }
.panel .btn { font-size: 20px; padding: 12px 24px; }
.panel .actions { justify-content: flex-start; margin-top: 8px; }
.error { color: var(--danger) !important; font-weight: 600; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 8px 24px; margin: 0; font-size: 18px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; }
.confirm { border: 2px solid var(--danger); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }

/* Hidden admin hotspot (top-right corner) */
#hotspot { position: fixed; top: 0; right: 0; width: 90px; height: 90px; z-index: 10; }

/* Small connection dot, bottom-right */
.status-dot {
  position: fixed;
  right: 14px;
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--line);
}
.status-dot.online { background: var(--excellent); }
.status-dot.offline { background: var(--good); }

@media (orientation: portrait) {
  .faces { flex-direction: column; align-items: center; }
  .face {
    display: grid;
    grid-template-columns: 110px 1fr;
    align-content: center;
    column-gap: 20px;
    width: min(560px, 100%);
    padding: 14px 24px;
    text-align: left;
  }
  .face svg { width: 110px; grid-row: 1 / 3; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
