:root {
  --navy: #1F4E79;
  --navy-dark: #16365a;
  --navy-hover: #2a679c;
  --navy-soft: #dce9f5;
  --navy-row: #f2f7fc;
  --border: #8ea9c1;
  --line: #c5d4e2;
  --text: #1a1a1a;
  --muted: #404040;
  --foot: #7f7f7f;
  --bg: #eef3f8;
  --card: #ffffff;
  --danger: #9b2c2c;
  --ok: #1c6b3a;
  --ok-bg: #e8f6ee;
  --warn-bg: #fff6e5;
  --warn: #8a5a00;
  --radius: 12px;
  --shadow: 0 8px 28px rgba(31, 78, 121, 0.08);
  --font: "Apple SD Gothic Neo", "Malgun Gothic", "맑은 고딕", "NanumGothic", "Noto Sans CJK KR", "Noto Sans KR", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
}

body { min-height: 100vh; }

.wrap {
  width: min(720px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 64px;
}

header.hero {
  text-align: center;
  margin-bottom: 22px;
}

header.hero h1 {
  margin: 0 0 8px;
  color: var(--navy);
  font-size: clamp(1.35rem, 4.5vw, 1.85rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.35;
}

header.hero .sub {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid #e3ebf3;
  padding: 22px 22px 24px;
}

.lead {
  margin: 0 0 10px;
  font-size: 0.98rem;
}

.notes {
  margin: 0 0 8px;
  padding-left: 1.15em;
  color: var(--muted);
  font-size: 0.94rem;
}

.notes li { margin: 0 0 4px; }

.fieldset {
  border: 0;
  margin: 0 0 18px;
  padding: 0;
}

.fieldset legend,
.label {
  display: block;
  margin: 0 0 6px;
  color: var(--navy);
  font-weight: 700;
  font-size: 0.95rem;
}

.hint {
  display: block;
  margin: -2px 0 8px;
  color: var(--foot);
  font-size: 0.82rem;
  font-weight: 400;
}

input[type="text"],
input[type="email"],
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  font-family: inherit;
  font-size: 16px;
  color: var(--text);
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(31, 78, 121, 0.15);
}

textarea {
  min-height: 92px;
  resize: vertical;
}

.checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
}

.checks label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.95rem;
  cursor: pointer;
  white-space: nowrap;
}

.checks input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--navy);
}

.other-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 100%;
  width: 100%;
  white-space: nowrap;
}

.other-inline input[type="text"] {
  padding: 7px 10px;
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
}

.consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 6px 0 16px;
  padding: 12px 14px;
  background: var(--navy-row);
  border-radius: 8px;
  border: 1px solid var(--navy-soft);
}

.consent input {
  margin-top: 3px;
  width: 18px;
  height: 18px;
  accent-color: var(--navy);
  flex: 0 0 auto;
}

.consent label { font-size: 0.95rem; }

.fine {
  margin: 0 0 16px;
  color: var(--foot);
  font-size: 0.82rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

button, .btn {
  appearance: none;
  border: 0;
  border-radius: 8px;
  padding: 12px 16px;
  font-family: inherit;
  font-size: 0.98rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-primary {
  background: var(--navy);
  color: #fff;
}

.btn-primary:hover { background: var(--navy-hover); }

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-secondary {
  background: #fff;
  color: var(--navy);
  border: 1.5px solid var(--navy);
}

.btn-secondary:hover { background: var(--navy-soft); }

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}

#status[data-kind="ok"] {
  margin-top: 14px;
  padding: 10px 12px;
  background: var(--ok-bg);
  color: var(--ok);
  border-radius: 8px;
  font-size: 0.92rem;
}

#status[data-kind="warn"] {
  margin-top: 14px;
  padding: 10px 12px;
  background: var(--warn-bg);
  color: var(--warn);
  border-radius: 8px;
  font-size: 0.92rem;
}

#status[data-kind="err"] {
  margin-top: 14px;
  padding: 10px 12px;
  background: #fdecec;
  color: var(--danger);
  border-radius: 8px;
  font-size: 0.92rem;
}

#success {
  display: none;
}

#success.is-open { display: block; }

#success.is-open + #case-form,
form.is-hidden { display: none; }

.success-box h2 {
  margin: 0 0 8px;
  color: var(--navy);
  font-size: 1.35rem;
}

.success-box p { margin: 0 0 10px; }

.hp {
  position: absolute !important;
  left: -9999px !important;
  height: 0 !important;
  overflow: hidden !important;
}

footer.site-foot {
  margin-top: 22px;
  text-align: center;
  color: var(--foot);
  font-size: 0.8rem;
}

/* ===== A4 sheet (Howard form look) ===== */
#sheet-host {
  position: absolute;
  left: -12000px;
  top: 0;
  width: 210mm;
  background: #fff;
}

#sheet {
  width: 210mm;
  height: 297mm;
  background: #fff;
  color: #1a1a1a;
  font-family: "Malgun Gothic", "맑은 고딕", "NanumGothic", "Noto Sans CJK KR", "Apple SD Gothic Neo", sans-serif;
  box-sizing: border-box;
  padding: 18mm 18mm 16mm;
  display: flex;
  flex-direction: column;
}

#sheet .stitle {
  margin: 0;
  text-align: center;
  color: #1F4E79;
  font-size: 20pt;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

#sheet .ssub {
  margin: 6px 0 14px;
  text-align: center;
  color: #404040;
  font-size: 10.5pt;
}

#sheet .slead {
  margin: 0 0 8px;
  font-size: 10pt;
  line-height: 1.5;
}

#sheet .snotes {
  margin: 0 0 12px;
  padding-left: 1.2em;
  font-size: 10pt;
  color: #333;
  line-height: 1.5;
}

#sheet .snotes li { margin: 0 0 2px; }

#sheet table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  flex: 1 1 auto;
}

#sheet th,
#sheet td {
  border: 0.6pt solid #8EA9C1;
  vertical-align: top;
  padding: 6px 8px;
  font-size: 10pt;
  line-height: 1.4;
  word-break: break-word;
}

#sheet thead th {
  background: #DCE9F5;
  color: #1a1a1a;
  font-weight: 700;
  text-align: center;
  vertical-align: middle;
  font-size: 10.5pt;
  padding: 7px 8px;
}

#sheet td.item {
  width: 26%;
  background: #F2F7FC;
  font-weight: 700;
  vertical-align: middle;
}

#sheet td.guide {
  width: 37%;
  font-size: 9.5pt;
  color: #222;
}

#sheet td.ans {
  width: 37%;
  font-size: 10pt;
}

#sheet .marks { margin: 0 0 4px; }
#sheet .marks span { margin-right: 8px; white-space: nowrap; }

#sheet .sfoot {
  margin: 10px 0 0;
  color: #7F7F7F;
  font-size: 8.5pt;
  line-height: 1.45;
}

#sheet .consent-line {
  margin: 4px 0 0;
  font-size: 9pt;
  color: #1a1a1a;
}

@media print {
  body { background: #fff; }
  .wrap, footer.site-foot { display: none !important; }
  #sheet-host {
    position: static;
    left: auto;
    width: auto;
  }
  #sheet {
    margin: 0;
    box-shadow: none;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  @page { size: A4; margin: 0; }
}

@media (max-width: 640px) {
  .wrap { width: calc(100% - 20px); padding: 16px 0 40px; }
  .card { padding: 16px 14px 18px; }
  .actions { flex-direction: column; }
  .actions button, .actions .btn { width: 100%; }
}
