/* Trang góp ý: nền sáng, đỏ làm điểm nhấn, một cột cho điện thoại (người dùng vào từ QR). */
@font-face { font-family: "Be Vietnam Pro"; font-weight: 400; font-display: swap; src: url("/static/fonts/be-vietnam-pro-vietnamese-400-normal.woff2") format("woff2"); unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB; }
@font-face { font-family: "Be Vietnam Pro"; font-weight: 400; font-display: swap; src: url("/static/fonts/be-vietnam-pro-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+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Be Vietnam Pro"; font-weight: 500; font-display: swap; src: url("/static/fonts/be-vietnam-pro-vietnamese-500-normal.woff2") format("woff2"); unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB; }
@font-face { font-family: "Be Vietnam Pro"; font-weight: 500; font-display: swap; src: url("/static/fonts/be-vietnam-pro-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+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Be Vietnam Pro"; font-weight: 600; font-display: swap; src: url("/static/fonts/be-vietnam-pro-vietnamese-600-normal.woff2") format("woff2"); unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB; }
@font-face { font-family: "Be Vietnam Pro"; font-weight: 600; font-display: swap; src: url("/static/fonts/be-vietnam-pro-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+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Be Vietnam Pro"; font-weight: 700; font-display: swap; src: url("/static/fonts/be-vietnam-pro-vietnamese-700-normal.woff2") format("woff2"); unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB; }
@font-face { font-family: "Be Vietnam Pro"; font-weight: 700; font-display: swap; src: url("/static/fonts/be-vietnam-pro-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+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }

:root {
  color-scheme: light;
  --bg: #F5F2F0;
  --surface: #FFFFFF;
  --ink: #1F1A1B;
  --muted: #6B6163;
  --line: #E4DCDA;
  --accent: #C4122F;
  --accent-dark: #A00E26;
  --accent-soft: #FBE9EC;
  --ok: #1B7447;
  --ok-soft: #E5F3EB;
  --star: #E0A100;
  --radius: 16px;
  --font: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
}
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.app {
  height: 100%;
  height: 100dvh;
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

/* ---------- thanh trên ---------- */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  padding-top: calc(10px + env(safe-area-inset-top));
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.mark {
  width: 30px; height: 30px; flex: none;
  border-radius: 9px 9px 9px 3px;
  background: var(--accent);
  position: relative;
}
.mark::after {
  content: ""; position: absolute; left: 8px; right: 8px; top: 10px; height: 2px;
  background: #fff; border-radius: 2px;
  box-shadow: 0 6px 0 #fff;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-text strong { font-size: 16px; font-weight: 700; }
.brand-text span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { display: flex; gap: 8px; flex: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 40px; padding: 0 14px;
  border-radius: 999px; border: 1px solid transparent;
  font-size: 14px; font-weight: 600; text-decoration: none;
  cursor: pointer; background: none;
  transition: background-color .15s, border-color .15s;
}
.btn-ghost { color: var(--muted); }
.btn-ghost:hover { background: var(--bg); color: var(--ink); }
.btn-line { border-color: var(--line); background: var(--surface); }
.btn-line:hover { border-color: var(--ink); }
.btn-solid { background: var(--accent); color: #fff; }
.btn-solid:hover { background: var(--accent-dark); }
.btn-wide { width: 100%; min-height: 48px; font-size: 16px; }
.btn[disabled] { opacity: .55; cursor: default; }

/* ---------- trò chuyện ---------- */
.view { flex: 1; min-height: 0; }
.view-chat { display: flex; flex-direction: column; }
.thread {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: 18px 16px 8px;
  display: flex; flex-direction: column; gap: 10px;
  overscroll-behavior: contain;
}
.msg {
  max-width: 86%;
  padding: 11px 14px;
  border-radius: var(--radius);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.msg-agent {
  align-self: flex-start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-bottom-left-radius: 5px;
}
.msg-user {
  align-self: flex-end;
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 5px;
}
.msg-error {
  align-self: flex-start;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 14px;
}
.saved {
  align-self: stretch;
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--ok-soft);
  color: var(--ok);
  font-size: 14px;
  line-height: 1.45;
}
.saved svg { flex: none; margin-top: 2px; }
.saved b { display: block; font-weight: 600; }
.saved span { color: #2C4A3A; overflow-wrap: anywhere; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 2px 0 6px; }
.chip {
  min-height: 40px; padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 14px; font-weight: 500;
  cursor: pointer; text-align: left;
}
.chip:hover { border-color: var(--accent); color: var(--accent-dark); }

.typing { display: inline-flex; gap: 5px; align-items: center; min-height: 24px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); opacity: .35; animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; }
.typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }

.dock {
  padding: 8px 16px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom));
  background: var(--bg);
}
.composer {
  display: flex; align-items: flex-end; gap: 8px;
  padding: 6px 6px 6px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
}
.composer:focus-within { border-color: var(--accent); }
.composer textarea {
  flex: 1; min-width: 0;
  border: 0; outline: 0; resize: none; background: none;
  padding: 9px 0; max-height: 140px;
  line-height: 1.45;
}
.send {
  width: 42px; height: 42px; flex: none;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: var(--accent); color: #fff; cursor: pointer;
}
.send[disabled] { background: var(--line); color: #fff; cursor: default; }
.note { margin: 8px 4px 0; font-size: 12px; line-height: 1.45; color: var(--muted); }

/* ---------- form và màn kết thúc ---------- */
.view-pad { overflow-y: auto; padding: 20px 16px calc(24px + env(safe-area-inset-bottom)); }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 22px 20px;
}
.card h1 { margin: 0 0 4px; font-size: 22px; line-height: 1.25; font-weight: 700; text-wrap: balance; }
.lead { margin: 0 0 18px; color: var(--muted); }
.field { display: flex; flex-direction: column; gap: 6px; margin: 0 0 14px; border: 0; padding: 0; min-width: 0; }
.field label, .field legend { font-size: 14px; font-weight: 600; padding: 0; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface);
}
.field textarea { resize: vertical; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .row-2 { grid-template-columns: 1fr; gap: 0; } }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-error { margin: 0 0 12px; padding: 10px 12px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-dark); font-size: 14px; }

.stars { display: flex; gap: 4px; }
.star {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border: 0; background: none; cursor: pointer;
  color: var(--line);
  border-radius: 10px;
}
.star svg { width: 30px; height: 30px; }
.star.on { color: var(--star); }
.stars-lg { justify-content: center; }
.stars-lg .star { width: 52px; height: 52px; }
.stars-lg .star svg { width: 38px; height: 38px; }

.card-center { text-align: center; }
.tick {
  width: 56px; height: 56px; margin: 4px auto 14px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--ok-soft); color: var(--ok);
}
.rate { margin: 6px 0 20px; padding: 16px 12px; border-radius: 16px; background: var(--bg); }
.rate p { margin: 0 0 8px; font-weight: 500; }
.rate .rate-thanks { margin: 8px 0 0; color: var(--ok); font-size: 14px; }
.done-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.done-actions .btn { min-height: 46px; padding: 0 20px; }
.noscript { padding: 16px; text-align: center; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
