:root {
  --ink: #111827;
  --muted: #667085;
  --line: #e4e7ec;
  --paper: #ffffff;
  --soft: #f5f6f8;
  --danger: #c43232;
  --success: #16794b;
}

* { box-sizing: border-box; }
html { background: #eef0f3; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 0%, rgba(255,255,255,.95), transparent 34%),
    linear-gradient(180deg, #e7e9ed 0%, #f6f7f8 32%, #eef0f3 100%);
  font-family: -apple-system, BlinkMacSystemFont, "Noto Sans Thai", "Segoe UI", sans-serif;
  min-height: 100vh;
}

button, input, textarea { font: inherit; }
.page { width: min(100%, 680px); margin: 0 auto; padding: 18px 14px 48px; }
.hero {
  color: #fff;
  background: linear-gradient(145deg, #0b0c0f, #252932);
  border-radius: 28px;
  padding: 26px 22px 24px;
  box-shadow: 0 18px 42px rgba(17,24,39,.18);
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  right: -76px;
  top: -80px;
  border: 34px solid rgba(255,255,255,.06);
  border-radius: 50%;
}
.eyebrow { font-size: 12px; letter-spacing: .14em; color: #cfd4dc; font-weight: 750; }
h1 { margin: 8px 0 6px; font-size: clamp(27px, 7vw, 38px); letter-spacing: -.035em; line-height: 1.15; }
.hero p { margin: 0; color: #d8dce2; line-height: 1.6; font-size: 14px; max-width: 480px; }
.privacy-pill {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  margin-top: 17px;
  padding: 8px 11px;
  border-radius: 999px;
  background: rgba(255,255,255,.1);
  font-size: 12px;
  color: #f1f3f5;
}
.card {
  background: var(--paper);
  border: 1px solid rgba(17,24,39,.06);
  border-radius: 26px;
  padding: 22px 18px;
  margin-top: 14px;
  box-shadow: 0 10px 30px rgba(17,24,39,.07);
}
.field { margin-bottom: 23px; }
.field:last-child { margin-bottom: 0; }
label, legend { display: block; font-weight: 750; font-size: 15px; margin-bottom: 9px; }
.required { color: var(--danger); }
.hint { color: var(--muted); font-size: 12px; margin: -3px 0 9px; line-height: 1.55; }
textarea, input[type="tel"], input[type="datetime-local"] {
  width: 100%;
  border: 1px solid var(--line);
  background: #fbfbfc;
  border-radius: 15px;
  padding: 13px 14px;
  outline: none;
  color: var(--ink);
  transition: border-color .18s, box-shadow .18s, background .18s;
}
textarea { resize: vertical; min-height: 126px; line-height: 1.58; }
textarea:focus, input:focus { border-color: #9299a5; box-shadow: 0 0 0 4px rgba(17,24,39,.06); background: #fff; }
fieldset { border: 0; padding: 0; margin: 0; }
.choices { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: #fff;
  color: #344054;
  font-size: 14px;
  font-weight: 650;
  transition: .18s;
}
.choice input:checked + span { background: var(--ink); color: #fff; border-color: var(--ink); box-shadow: 0 8px 18px rgba(17,24,39,.18); }
.upload {
  display: block;
  border: 1.5px dashed #c5cad2;
  border-radius: 17px;
  padding: 18px 12px;
  text-align: center;
  background: #fafbfc;
  cursor: pointer;
}
.upload strong { display: block; font-size: 14px; margin-bottom: 3px; }
.upload small { color: var(--muted); }
#images { display: none; }
.previews { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.preview { position: relative; aspect-ratio: 1; border-radius: 13px; overflow: hidden; background: var(--soft); }
.preview img { width: 100%; height: 100%; object-fit: cover; }
.preview button {
  position: absolute;
  right: 5px;
  top: 5px;
  width: 27px;
  height: 27px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(0,0,0,.68);
  cursor: pointer;
}
.submit {
  width: 100%;
  min-height: 55px;
  border: 0;
  border-radius: 17px;
  color: #fff;
  background: var(--ink);
  font-weight: 800;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(17,24,39,.18);
}
.submit:disabled { opacity: .55; cursor: wait; }
.fineprint { text-align: center; color: var(--muted); font-size: 11px; line-height: 1.55; margin: 14px 20px 0; }
.notice { display: none; border-radius: 15px; padding: 12px 13px; margin: 0 0 16px; font-size: 13px; line-height: 1.5; }
.notice.show { display: block; }
.notice.error { color: #8f2626; background: #fff0f0; border: 1px solid #ffd0d0; }
.loading {
  position: fixed;
  inset: 0;
  background: rgba(245,246,248,.97);
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 13px;
}
.spinner { width: 34px; height: 34px; border: 3px solid #d9dde3; border-top-color: #111827; border-radius: 50%; animation: spin .75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.success-view { display: none; min-height: 74vh; align-items: center; justify-content: center; text-align: center; }
.success-card { background: #fff; border-radius: 28px; padding: 34px 22px; width: 100%; box-shadow: 0 18px 45px rgba(17,24,39,.1); }
.check { width: 68px; height: 68px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 18px; background: #e8f7ef; color: var(--success); font-size: 32px; font-weight: 900; }
.success-card h2 { margin: 0 0 8px; }
.case { display: inline-block; padding: 10px 15px; border-radius: 12px; background: var(--soft); font-weight: 850; letter-spacing: .04em; margin: 14px 0; }
.close { width: 100%; min-height: 50px; margin-top: 12px; border: 1px solid var(--line); border-radius: 15px; background: #fff; font-weight: 750; }

@media (min-width: 560px) {
  .page { padding-top: 28px; }
  .card { padding: 28px; }
  .choices { grid-template-columns: repeat(3, 1fr); }
}
