:root {
  --green: #1b5e20;
  --green-dark: #124116;
  --green-soft: #e8f5e9;
  --red: #c62828;
  --blue: #1565c0;
  --ink: #1c1c1c;
  --muted: #5c6570;
  --line: #c5d0c6;
  --paper: #fffdf8;
  --page: #eef3ee;
  --shadow: 0 10px 30px rgba(18, 65, 22, 0.08);
  --radius: 10px;
  --max: 980px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top right, #d7ead8 0, transparent 28%),
    linear-gradient(180deg, #f4f7f4 0%, var(--page) 100%);
  font-family: "Segoe UI", "Noto Sans", Calibri, Arial, sans-serif;
  line-height: 1.45;
}

img {
  max-width: 100%;
  height: auto;
}

.skip {
  position: absolute;
  left: -999px;
}

.skip:focus {
  left: 12px;
  top: 12px;
  background: #fff;
  padding: 8px 12px;
  z-index: 10;
}

.masthead {
  background: #fff;
  border-bottom: 4px solid var(--green);
  box-shadow: var(--shadow);
}

.masthead-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 14px 20px 10px;
  display: flex;
  gap: 16px;
  align-items: center;
}

.masthead img {
  width: min(100%, 720px);
}

.wrap {
  max-width: var(--max);
  margin: 22px auto 48px;
  padding: 0 16px;
}

.notice {
  background: #fff8e1;
  border: 1px solid #f0d77a;
  border-left: 5px solid #f9a825;
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 18px;
  color: #5d4a00;
}

.sheet {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 22px 28px;
}

.form-title {
  text-align: center;
  margin: 0 0 6px;
  letter-spacing: 0.08em;
  color: var(--green-dark);
}

.form-sub {
  text-align: center;
  margin: 0 0 18px;
  color: var(--muted);
  font-style: italic;
}

.grid {
  display: grid;
  gap: 14px 16px;
}

.grid.two {
  grid-template-columns: 1fr 1fr;
}

.grid.three {
  grid-template-columns: 1fr 1fr 1fr;
}

.photo-row {
  display: grid;
  grid-template-columns: 1fr 150px;
  gap: 16px;
  align-items: start;
}

.photo-box {
  border: 2px dashed var(--green);
  background: #fff;
  min-height: 180px;
  border-radius: 8px;
  padding: 8px;
  text-align: center;
}

.photo-box img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 4px;
  display: none;
}

.photo-box.has-image img {
  display: block;
}

.photo-box p {
  margin: 18px 8px 8px;
  font-size: 13px;
  color: var(--muted);
}

fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 0 0 18px;
  padding: 14px 16px 16px;
  background: #fff;
}

legend {
  font-weight: 700;
  color: #fff;
  background: var(--green);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 14px;
}

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 5px;
}

.req::after {
  content: " *";
  color: var(--red);
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="number"],
input[type="url"],
input[type="file"],
select,
textarea {
  width: 100%;
  border: 1px solid #b7c3b8;
  border-radius: 6px;
  padding: 8px 10px;
  font: inherit;
  background: #fff;
  color: var(--ink);
}

textarea {
  min-height: 72px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--green);
  border-color: var(--green);
}

.hint {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.table-wrap {
  overflow-x: auto;
}

table.repeat {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
  font-size: 13px;
}

table.repeat th,
table.repeat td {
  border: 1px solid var(--line);
  padding: 6px;
  vertical-align: top;
}

table.repeat th {
  background: var(--green-soft);
  text-align: left;
  font-size: 12px;
}

table.repeat input,
table.repeat select {
  padding: 6px 7px;
}

.row-actions {
  width: 44px;
  text-align: center;
}

button {
  font: inherit;
  cursor: pointer;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 6px;
  padding: 10px 16px;
  font-weight: 700;
}

.btn-add {
  background: var(--green-soft);
  color: var(--green-dark);
  margin-top: 8px;
}

.btn-remove {
  background: #fdecea;
  color: var(--red);
  border: 0;
  border-radius: 4px;
  width: 30px;
  height: 30px;
  font-size: 18px;
  line-height: 1;
}

.btn-primary {
  background: var(--green);
  color: #fff;
  font-size: 16px;
  padding: 12px 22px;
}

.btn-primary:hover {
  background: var(--green-dark);
}

.btn-ghost {
  background: transparent;
  color: var(--green-dark);
  border: 1px solid var(--green);
}

.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-top: 8px;
}

.check {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-weight: 500;
  font-size: 14px;
}

.check input {
  width: auto;
  margin-top: 4px;
}

.declaration {
  background: #f7faf7;
  border-left: 4px solid var(--green);
}

.site-footer {
  max-width: var(--max);
  margin: 0 auto 30px;
  padding: 0 16px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

@media (max-width: 800px) {
  .grid.two,
  .grid.three,
  .photo-row {
    grid-template-columns: 1fr;
  }
}

@media print {
  body {
    background: #fff;
  }
  .notice,
  .btn,
  .actions,
  .site-footer,
  input[type="file"] {
    display: none !important;
  }
  .sheet,
  fieldset {
    box-shadow: none;
    border-color: #000;
  }
}
