/* ペット写真の応募フォーム（iframe の中で使う。背景は白・余白 16px） */
:root {
  --green: #3e7d3a;
  --green-dark: #2f5f2c;
  --text: #2b2b2b;
  --muted: #6b6b6b;
  --line: #d6d6d0;
  --bg-soft: #f6f7f2;
  --red: #c0392b;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: #fff; color: var(--text); }
body {
  font-family: system-ui, -apple-system, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", Meiryo, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  padding: 16px;
  overflow-x: hidden;
}
main { max-width: 640px; margin: 0 auto; }
form { display: grid; gap: 18px; }
.field { display: grid; gap: 6px; margin: 0; padding: 0; border: 0; min-width: 0; }
.field > label, .field > legend, .label { font-weight: 600; padding: 0; }
.req, .opt {
  display: inline-block; margin-left: 8px; padding: 0 6px; border-radius: 4px;
  font-size: 12px; font-weight: 600; line-height: 1.6; vertical-align: 1px;
}
.req { background: var(--red); color: #fff; }
.opt { background: #e7e7e2; color: var(--muted); }
input:not([type]), input[type="email"], textarea {
  width: 100%; font: inherit; color: inherit; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
}
input:focus, textarea:focus { outline: 2px solid var(--green); outline-offset: 1px; border-color: var(--green); }
textarea { resize: vertical; }
.note { margin: 0; font-size: 13px; color: var(--muted); }
.err { margin: 0; font-size: 14px; color: var(--red); }
.err:empty { display: none; }
.invalid input:not([type="radio"]):not([type="checkbox"]), .invalid textarea { border-color: var(--red); }

.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px;
  border: 1px solid var(--line); border-radius: 999px; cursor: pointer; background: #fff;
}
.choice:has(input:checked) { border-color: var(--green); background: #eef5ec; color: var(--green-dark); font-weight: 600; }
.choice input { accent-color: var(--green); margin: 0; }
#petTypeOther { margin-top: 4px; }

.thumbs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.thumbs:empty { display: none; }
.thumb { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--bg-soft); border: 1px solid var(--line); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .noimg { display: grid; place-items: center; height: 100%; padding: 6px; font-size: 12px; color: var(--muted); text-align: center; word-break: break-all; }
.thumb button {
  position: absolute; top: 4px; right: 4px; width: 30px; height: 30px; border-radius: 50%;
  border: 0; background: rgba(0, 0, 0, .6); color: #fff; font-size: 18px; line-height: 1; cursor: pointer;
}
.pick {
  display: flex; align-items: center; justify-content: center; min-height: 52px; padding: 10px;
  border: 2px dashed var(--line); border-radius: 8px; color: var(--green-dark); font-weight: 600; cursor: pointer; background: var(--bg-soft);
}
.pick:hover { border-color: var(--green); }
.pick input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.pick:focus-within { outline: 2px solid var(--green); outline-offset: 2px; }
.pick[hidden] { display: none; }

.check { display: flex; align-items: flex-start; gap: 10px; font-weight: 600; cursor: pointer; flex-wrap: wrap; }
.check input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--green); flex: none; }
.agree { padding: 14px; border-radius: 8px; background: var(--bg-soft); }
.agree .note a { color: var(--green-dark); }

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

.submit {
  width: 100%; padding: 14px; border: 0; border-radius: 10px; font: inherit; font-size: 17px; font-weight: 700;
  background: var(--green); color: #fff; cursor: pointer;
}
.submit:hover { background: var(--green-dark); }
.submit:disabled { background: #9db69a; cursor: default; }
.progress { margin: 0; text-align: center; color: var(--muted); font-size: 14px; }
.form-error { margin: 0; padding: 10px 12px; border-radius: 8px; background: #fdecea; color: var(--red); font-size: 14px; }

.done { text-align: center; padding: 32px 0; }
.done-mark { font-size: 44px; }
.done h2 { margin: 8px 0 12px; font-size: 22px; color: var(--green-dark); }
.done p { margin: 0; }
