/* CARUSO FEEDBACK — pagina pubblica. Palette ripresa dal cartello approvato. */
:root {
  --cream: #fbf7ef;
  --paper: #fffdf8;
  --band: #f3eadb;
  --wine: #7a1119;
  --wine-2: #9c1c25;
  --gold: #b8954a;
  --gold-soft: #d9c49a;
  --ink: #2b2422;
  --muted: #6b605a;
  --green: #2f8f46;
  --red: #c8202c;
  --danger-bg: #fbe9e9;
  --radius: 14px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans Thai", "Sukhumvit Set", "Thonburi", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font: 16px/1.5 var(--sans);
}
.public { padding: 12px 12px calc(24px + env(safe-area-inset-bottom)); }

.sheet {
  position: relative;
  max-width: 560px;
  margin: 0 auto;
  background: var(--paper);
  border: 2px solid var(--gold);
  border-radius: 4px;
  box-shadow: 0 0 0 4px var(--paper), 0 0 0 5px var(--gold-soft), 0 10px 30px rgba(80, 50, 20, .08);
  padding: 8px 8px 20px;
}

.brand {
  background: var(--band);
  padding: 18px 16px 14px;
  text-align: center;
}
.brand img { width: min(250px, 72%); height: auto; display: inline-block; }

.lang { display: flex; justify-content: flex-end; padding: 10px 6px 0; }
.lang a {
  display: inline-block;
  font-size: 14px;
  color: var(--wine);
  background: rgba(255, 253, 248, .9);
  border: 1px solid var(--gold-soft);
  border-radius: 999px;
  padding: 6px 12px;
  text-decoration: none;
  min-height: 34px;
}
.lang a:focus-visible, .lang a:hover { border-color: var(--wine); }

.intro { text-align: center; padding: 2px 14px 4px; }
h1 {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 700;
  color: var(--wine);
  font-size: clamp(30px, 9vw, 42px);
  line-height: 1.15;
  margin: 4px 0 10px;
}
.lang-th h1 { font-family: var(--sans); font-style: normal; font-size: clamp(26px, 7.5vw, 36px); }

.rule { display: flex; align-items: center; gap: 12px; margin: 0 auto 14px; max-width: 420px; color: var(--gold); }
.rule::before, .rule::after { content: ""; flex: 1; height: 1px; background: var(--gold-soft); }
.rule-flag span {
  width: 76px; height: 5px; border-radius: 3px;
  background: linear-gradient(90deg, var(--green) 0 33.3%, #fff 33.3% 66.6%, var(--red) 66.6%);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .06);
}
.lead { font-family: var(--serif); font-size: 19px; margin: 0 0 6px; }
.lang-th .lead { font-family: var(--sans); font-size: 18px; }
.note { margin: 0; color: var(--muted); font-style: italic; font-size: 15px; }
.lang-th .note { font-style: normal; }

/* ---- modulo ---- */
.report { padding: 6px 12px 0; }
.field { border: 0; margin: 22px 0 0; padding: 0; min-width: 0; }
legend, .label {
  display: block;
  font-weight: 600;
  color: var(--wine);
  margin-bottom: 10px;
  padding: 0;
  font-size: 17px;
}

.chips { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.chip { position: relative; display: block; cursor: pointer; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span {
  display: flex; align-items: center; justify-content: center; text-align: center;
  min-height: 52px; height: 100%;
  padding: 8px 10px;
  border: 1.5px solid var(--gold-soft);
  border-radius: 12px;
  background: #fff;
  font-size: 15px;
  line-height: 1.25;
  transition: background .15s, border-color .15s, color .15s;
}
.chip input:checked + span { background: var(--wine); border-color: var(--wine); color: #fff; font-weight: 600; }
.chip input:focus-visible + span { outline: 3px solid var(--gold); outline-offset: 2px; }

textarea {
  display: block;
  width: 100%;
  min-height: 132px;
  resize: vertical;
  font: inherit;
  font-size: 16px; /* evita lo zoom automatico su iOS */
  color: var(--ink);
  background: #fff;
  border: 1.5px solid var(--gold-soft);
  border-radius: 12px;
  padding: 12px 14px;
}
textarea:focus { outline: none; border-color: var(--wine); box-shadow: 0 0 0 3px rgba(122, 17, 25, .12); }
.hint-row { display: flex; justify-content: space-between; gap: 12px; margin-top: 6px; }
.hint { color: var(--muted); font-size: 13.5px; margin: 6px 0 0; }
.hint-row .hint { margin: 0; }
.counter { color: var(--muted); font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }

.photo-button {
  position: relative;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px;
  border: 1.5px dashed var(--gold);
  border-radius: 12px;
  background: #fff;
  color: var(--wine);
  font-weight: 600;
  cursor: pointer;
}
.photo-button input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.photo-button:focus-within { outline: 3px solid var(--gold); outline-offset: 2px; }
.photo-preview { position: relative; margin-bottom: 10px; }
.photo-preview img { display: block; width: 100%; max-height: 300px; object-fit: contain; background: var(--band); border-radius: 12px; }
.photo-remove {
  position: absolute; top: 8px; right: 8px;
  font: inherit; font-size: 14px;
  background: rgba(43, 36, 34, .78); color: #fff;
  border: 0; border-radius: 999px; padding: 8px 14px; cursor: pointer;
}
.photo-error { color: var(--wine-2); font-weight: 600; font-size: 14px; margin: 8px 0 0; }

.submit {
  display: block; width: 100%;
  margin: 28px 0 0;
  min-height: 56px;
  font: inherit; font-size: 19px; font-weight: 600;
  font-family: var(--serif); font-style: italic; letter-spacing: .2px;
  color: #fff;
  background: linear-gradient(180deg, var(--wine-2), var(--wine));
  border: 0; border-radius: 999px;
  box-shadow: 0 4px 12px rgba(122, 17, 25, .25);
  cursor: pointer;
}
.lang-th .submit { font-family: var(--sans); font-style: normal; }
.submit:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.submit[disabled] { opacity: .7; cursor: progress; }

.alert {
  margin: 16px 12px 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--danger-bg);
  border: 1px solid #e7b9b9;
  color: #5e0d13;
}
.alert ul { margin: 6px 0 0; padding-left: 20px; }

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

/* ---- conferma ---- */
.thanks { padding-top: 26px; padding-bottom: 8px; }
.check {
  width: 72px; height: 72px; margin: 0 auto 6px;
  display: grid; place-items: center;
  border-radius: 50%;
  color: #fff; background: var(--wine);
  box-shadow: 0 0 0 5px var(--band);
}
.again {
  display: inline-block; margin-top: 12px;
  color: var(--wine); font-weight: 600;
  border: 1.5px solid var(--wine); border-radius: 999px;
  padding: 10px 20px; text-decoration: none;
}

.foot { text-align: center; padding: 26px 16px 0; color: var(--muted); }
.foot p { margin: 0; font-family: var(--serif); font-style: italic; }
.lang-th .foot p { font-family: var(--sans); font-style: normal; }
.rule-leaf { margin-bottom: 8px; }

@media (min-width: 600px) {
  .public { padding-top: 32px; }
  .sheet { padding: 10px 10px 26px; }
  .report { padding: 6px 26px 0; }
  .chips { gap: 10px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
