/* AVSC Cleanliness Feedback — Techo Airport design system
   Mobile-first single-page form. Palette + type from cards_template/_ds. */

:root {
  --cream:   #FBF8F2;
  --stone:   #F2EBDD;
  --sand:    #E6DDC9;
  --bronze:  #8F6C2C;
  --bronze-dark: #6B4F1C;
  --ink:     #1C1A15;
  --muted:   #6D6A60;
  --rule:    rgba(143, 108, 44, 0.25);

  --serif:    "Cormorant Garamond", serif;
  --sans:     "Outfit", system-ui, -apple-system, sans-serif;
  --kh-sans:  "Noto Sans Khmer", "Noto Sans", sans-serif;
  --kh-serif: "Noto Serif Khmer", "Noto Sans Khmer", serif;
  --zh-sans:  "Noto Sans SC", "Outfit", sans-serif;
  --zh-serif: "Noto Serif SC", "Cormorant Garamond", serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.page {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 0 40px;
  min-height: 100vh;
}

/* ---------- Hero ---------- */
.hero {
  text-align: center;
}

.hero-photo {
  position: relative;
  width: 100%;
  aspect-ratio: 5 / 3;
  overflow: hidden;
  background: var(--stone);
}

.hero-photo > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero > .logo {
  display: block;
  width: 132px;
  height: auto;
  margin: 22px auto 14px;
}

.eyebrow {
  margin: 14px 22px 8px;
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bronze);
  line-height: 1.5;
}

.headline {
  margin: 0 22px 4px;
  font-weight: 500;
  font-size: 20px;
  line-height: 1.32;
  letter-spacing: -0.005em;
}

.headline .km,
.headline .zh,
.headline .en { display: block; }
.headline .km { font-family: var(--kh-serif); font-weight: 500; }
.headline .zh { font-family: var(--zh-serif); font-weight: 500; }
.headline .en { font-family: var(--serif); font-weight: 500; }

.eyebrow .km { font-family: var(--kh-sans); display: block; }
.eyebrow .zh { font-family: var(--zh-sans); display: block; }
.eyebrow .en { display: block; }

/* ---------- Form ---------- */
.survey {
  padding: 26px 22px 0;
  border-top: 1px solid var(--rule);
  margin-top: 22px;
}

.q {
  margin: 0 0 26px;
  padding: 0;
  border: none;
}

.q legend {
  width: 100%;
  padding: 0 0 14px;
  font-size: 14.5px;
  line-height: 1.45;
  color: var(--ink);
}

.q legend .km { display: block; font-family: var(--kh-sans); font-weight: 500; font-size: 14.5px; }
.q legend .zh { display: block; font-family: var(--zh-sans); font-weight: 400; color: var(--muted); margin-top: 2px; }
.q legend .en { display: block; font-family: var(--sans); font-weight: 500; font-size: 13px; color: var(--muted); margin-top: 2px; }

/* ---------- Stars (thumb-friendly: 52px each, ~6px gap) ---------- */
.stars {
  display: flex;
  gap: 4px;
  justify-content: space-between;
  max-width: 320px;
}

.star-btn {
  width: 52px;
  height: 52px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--sand);
  transition: color 120ms ease, transform 100ms ease;
  -webkit-tap-highlight-color: transparent;
}

.star-btn:active { transform: scale(0.88); }
.star-btn.is-on { color: var(--bronze); }
.star-btn:focus-visible {
  outline: 2px solid var(--bronze);
  outline-offset: 2px;
  border-radius: 4px;
}

.star-btn svg {
  width: 44px;
  height: 44px;
  display: block;
}

/* ---------- Textarea ---------- */
textarea,
input[type="text"] {
  width: 100%;
  padding: 12px 14px;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 8px;
  -webkit-appearance: none;
  appearance: none;
}

textarea {
  resize: vertical;
  min-height: 80px;
}

textarea:focus,
input[type="text"]:focus {
  outline: none;
  border-color: var(--bronze);
  box-shadow: 0 0 0 3px rgba(143, 108, 44, 0.12);
}

/* ---------- Photo input ---------- */
.photo-zone {
  background: #fff;
  border: 1px dashed var(--bronze);
  border-radius: 8px;
  padding: 10px;
}

.photo-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 8px;
  margin: 0 0 10px;
}

.photo-thumbs:empty { display: none; }
.photo-thumbs:empty + .photo-button { margin: 0; }

.thumb {
  position: relative;
  aspect-ratio: 1;
  background: var(--stone);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--rule);
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.thumb-x {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 50%;
  background: rgba(28,26,21,0.78);
  color: #fff;
  font-size: 16px;
  line-height: 1;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0 1px;
  -webkit-tap-highlight-color: transparent;
}

.thumb-x:active { transform: scale(0.92); }

.photo-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 14px;
  width: 100%;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--bronze-dark);
  background: transparent;
  border: none;
  border-radius: 6px;
  flex-wrap: wrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.photo-button:active { background: var(--stone); }

.photo-button .km,
.photo-button .zh,
.photo-button .en { display: inline; }
.photo-button .km { font-family: var(--kh-sans); }
.photo-button .zh { font-family: var(--zh-sans); }
.photo-button .km::after,
.photo-button .zh::after { content: " · "; opacity: 0.5; }

/* ---------- Submit ---------- */
.submit {
  width: 100%;
  margin-top: 4px;
  padding: 17px;
  font-family: var(--sans);
  font-size: 15.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--cream);
  background: var(--bronze);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 120ms ease, transform 100ms ease;
  -webkit-tap-highlight-color: transparent;
}

.submit:active { transform: scale(0.985); }
.submit:hover  { background: var(--bronze-dark); }
.submit:disabled { opacity: 0.5; cursor: not-allowed; }

.submit .km,
.submit .zh,
.submit .en { display: inline; }
.submit .km { font-family: var(--kh-sans); }
.submit .zh { font-family: var(--zh-sans); }
.submit .km::after,
.submit .zh::after { content: " · "; opacity: 0.6; }

.status {
  margin: 14px 0 0;
  min-height: 1.5em;
  font-size: 13px;
  text-align: center;
  color: var(--muted);
  line-height: 1.5;
}

.status.is-error { color: #B43B2A; }

/* ---------- Thanks ---------- */
.thanks {
  padding: 70px 22px 60px;
  text-align: center;
}

.thanks .sparkle {
  font-size: 32px;
  color: var(--bronze);
  margin-bottom: 18px;
}

.thanks h2 {
  margin: 0 0 14px;
  font-size: 26px;
  font-weight: 500;
}

.thanks h2 .km { display: block; font-family: var(--kh-serif); }
.thanks h2 .zh { display: block; font-family: var(--zh-serif); }
.thanks h2 .en { display: block; font-family: var(--serif); }

.thanks p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.65;
}

.thanks p .km { display: block; font-family: var(--kh-sans); }
.thanks p .zh { display: block; font-family: var(--zh-sans); }
.thanks p .en { display: block; }

/* ---------- Footer ---------- */
.footer {
  margin: 32px 22px 0;
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.footer .sparkle-svg {
  vertical-align: -1px;
  margin: 0 2px;
}

/* ---------- Narrow phones (<360px) ---------- */
@media (max-width: 359px) {
  .star-btn { width: 46px; height: 46px; }
  .star-btn svg { width: 34px; height: 34px; }
  .stars { gap: 2px; }
  .eyebrow { font-size: 10px; }
  .headline { font-size: 18px; }
}

/* ---------- Tablet/desktop framing ---------- */
@media (min-width: 481px) {
  body {
    background:
      linear-gradient(rgba(28,26,21,0.04), rgba(28,26,21,0.06)),
      var(--cream);
  }
  .page {
    margin: 24px auto;
    background: var(--cream);
    box-shadow: 0 1px 2px rgba(28,26,21,0.06), 0 8px 24px rgba(28,26,21,0.08);
    border-radius: 12px;
    overflow: hidden;
  }
  .hero-photo { aspect-ratio: 16 / 9; }
}
