/* Upton Technologies CSAT survey — mobile-first, self-contained.
   All assets (fonts, logo) are bundled locally; no third-party requests. */

/* Fonts — self-hosted (see public/fonts/) ------------------------------- */
@font-face {
  font-family: "Chakra Petch";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/chakra-petch-600.woff2") format("woff2");
}
@font-face {
  font-family: "Chakra Petch";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/chakra-petch-700.woff2") format("woff2");
}
@font-face {
  /* Variable file covering the full weight range */
  font-family: "Red Hat Display";
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("fonts/red-hat-display.woff2") format("woff2");
}

:root {
  --green: #2F5637;        /* primary */
  --green-dark: #21402a;
  --green-darker: #1a3321;
  --accent: #ABCC59;       /* lime accent */
  --ink: #1E1E1E;
  --muted: #5f6b62;
  --line: #d9ddd9;
  --bg: #E6E6E6;
  --card: #ffffff;
  --amber: #d99a14;
  --red: #cf3b3b;
  --radius: 16px;
  --head: "Chakra Petch", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --body: "Red Hat Display", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--body);
  font-weight: 500;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: clamp(16px, 4vw, 48px);
}

.card {
  width: 100%;
  max-width: 480px;
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .08), 0 12px 36px rgba(31, 64, 42, .14);
  margin-top: clamp(8px, 5vh, 56px);
}

/* Hero (dark green band) ------------------------------------------------- */
.hero {
  background: linear-gradient(160deg, var(--green) 0%, var(--green-darker) 100%);
  color: #fff;
  text-align: center;
  padding: clamp(26px, 7vw, 40px) clamp(20px, 5vw, 36px) clamp(22px, 6vw, 32px);
}

.hero__logo { width: 168px; height: auto; }

.hero__title {
  font-family: var(--head);
  font-weight: 700;
  font-size: clamp(1.9rem, 7vw, 2.6rem);
  letter-spacing: .5px;
  margin: 16px 0 6px;
}

.hero__subtitle {
  margin: 0;
  font-size: 1rem;
  color: rgba(255, 255, 255, .82);
}

/* Body ------------------------------------------------------------------- */
.body { padding: clamp(22px, 6vw, 34px); }

.muted { color: var(--muted); font-weight: 500; }

/* Faces ------------------------------------------------------------------ */
.faces {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.face {
  appearance: none;
  cursor: pointer;
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 16px 6px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  transition: border-color .15s, color .15s, transform .1s, box-shadow .15s, background .15s;
}

.face:hover { border-color: #b7c0b7; color: var(--ink); }
.face:active { transform: scale(.97); }

.face__icon {
  width: clamp(40px, 14vw, 52px);
  height: clamp(40px, 14vw, 52px);
  display: block;
}

/* Stroke-based, line-art faces (inherit `color` → currentColor) */
.face__icon circle:first-of-type,
.face__icon .mouth {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
}
.face__icon .eye { fill: currentColor; stroke: none; }

.face__label {
  font-size: .85rem;
  font-weight: 600;
}

.face:focus-visible {
  outline: 3px solid rgba(47, 86, 55, .35);
  outline-offset: 2px;
}

/* Selected state — tinted by sentiment */
.face[aria-checked="true"] { background: #f5f8ee; }
.face[aria-checked="true"] .face__label { color: var(--ink); }

.face[data-rating="3"][aria-checked="true"] {
  color: var(--green);
  border-color: var(--green);
  box-shadow: 0 0 0 1px var(--green) inset;
  background: #f1f6ef;
}
.face[data-rating="2"][aria-checked="true"] {
  color: var(--amber);
  border-color: var(--amber);
  box-shadow: 0 0 0 1px var(--amber) inset;
  background: #fdf8ec;
}
.face[data-rating="1"][aria-checked="true"] {
  color: var(--red);
  border-color: var(--red);
  box-shadow: 0 0 0 1px var(--red) inset;
  background: #fdf2f2;
}

/* Comment ---------------------------------------------------------------- */
.comment { display: block; margin-bottom: 20px; }

.comment__label {
  display: block;
  font-size: .92rem;
  font-weight: 600;
  margin-bottom: 8px;
}

textarea {
  width: 100%;
  font: inherit;
  font-weight: 500;
  color: var(--ink);
  padding: 12px;
  border: 2px solid var(--line);
  border-radius: 10px;
  resize: vertical;
  min-height: 94px;
  background: #fff;
}

textarea:focus-visible {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(47, 86, 55, .15);
}

/* Submit ----------------------------------------------------------------- */
.submit {
  width: 100%;
  border: 0;
  border-radius: 10px;
  background: var(--green);
  color: #fff;
  font-family: var(--head);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: .3px;
  padding: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: background .15s, opacity .15s;
}

.submit:hover:not(:disabled) { background: var(--green-dark); }
.submit:focus-visible { outline: 3px solid rgba(47, 86, 55, .4); outline-offset: 2px; }
.submit:disabled { opacity: .45; cursor: not-allowed; }

.submit__spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, .4);
  border-top-color: #fff;
  border-radius: 50%;
  display: none;
  animation: spin .7s linear infinite;
}

body[data-submitting] .submit { cursor: wait; }
body[data-submitting] .submit__spinner { display: inline-block; }
body[data-submitting] .face,
body[data-submitting] textarea { pointer-events: none; opacity: .65; }

@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .submit__spinner { animation-duration: 2s; }
  .face:active { transform: none; }
}

/* Error ------------------------------------------------------------------ */
.error {
  background: #fdf2f2;
  border: 1px solid #f0c4c4;
  color: #a12626;
  border-radius: 10px;
  padding: 11px 13px;
  margin: 0 0 16px;
  font-size: .92rem;
  font-weight: 500;
}

/* Success ---------------------------------------------------------------- */
.body--success { text-align: center; padding-top: clamp(28px, 8vw, 40px); }

.success__mark {
  width: 76px;
  height: 76px;
  margin: 0 auto 8px;
  color: var(--green);
}
.success__mark svg { width: 100%; height: 100%; }
.success__mark circle { fill: none; stroke: currentColor; stroke-width: 2.5; opacity: .35; }
.success__mark .check {
  fill: none;
  stroke: currentColor;
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.success__title {
  font-family: var(--head);
  font-weight: 700;
  font-size: clamp(1.4rem, 5vw, 1.7rem);
  margin: 14px 0 6px;
}

/* Footer ----------------------------------------------------------------- */
.foot {
  text-align: center;
  padding: 16px;
  border-top: 1px solid var(--line);
  font-size: .8rem;
}
