:root {
  --ink: #151513;
  --muted: #716f68;
  --line: #d9d6ce;
  --line-strong: #b8b4aa;
  --surface: #fffefa;
  --surface-soft: #f7f5ef;
  --paper: #eeece5;
  --accent: #2457f5;
  --accent-dark: #173fc4;
  --accent-soft: #e8edff;
  --amber: #8f5c18;
  --amber-soft: #fff6df;
  --danger: #b9342d;
  --danger-soft: #fff0ed;
  --shadow-card: 0 1px 0 rgba(21, 21, 19, 0.05), 0 18px 50px rgba(21, 21, 19, 0.04);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  background: var(--paper);
}

body {
  min-height: 100vh;
  padding: 0 28px 72px;
  background: var(--paper);
}

button,
input,
select {
  font: inherit;
}

button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: var(--accent-dark);
}

.page-wrap {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

.body-container {
  width: 100%;
}

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 78px;
  border-bottom: 1px solid var(--line-strong);
}

.wordmark {
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.13em;
  text-decoration: none;
}

.wordmark span {
  color: var(--accent);
}

.masthead p {
  display: flex;
  margin: 0;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.03em;
}

.status-dot {
  width: 7px;
  height: 7px;
  background: #21a465;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(33, 164, 101, 0.1);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 410px;
  padding: 66px 0 62px;
  align-items: end;
  gap: 72px;
  border-bottom: 1px solid var(--line-strong);
}

.hero-copy {
  max-width: 820px;
}

.eyebrow {
  margin: 0 0 22px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  max-width: 820px;
  color: var(--ink);
  font-size: clamp(54px, 7vw, 92px);
  font-weight: 760;
  letter-spacing: -0.07em;
  line-height: 0.98;
}

h1 em {
  color: var(--accent);
  font-family: Georgia, "Noto Serif TC", serif;
  font-weight: 500;
}

.hero-description {
  max-width: 590px;
  margin: 32px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.8;
}

.year-badge {
  display: flex;
  width: 176px;
  min-height: 176px;
  padding: 22px;
  align-items: flex-start;
  justify-content: space-between;
  flex-direction: column;
  color: #fff;
  background: var(--accent);
}

.year-badge span,
.year-badge small {
  color: rgba(255, 255, 255, 0.75);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.year-badge strong {
  margin: auto 0 8px;
  color: #fff;
  font-size: 54px;
  font-weight: 700;
  letter-spacing: -0.07em;
  line-height: 1;
}

.notice-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 0;
  margin: 0;
  border-bottom: 1px solid var(--line-strong);
}

.notice {
  display: flex;
  gap: 16px;
  padding: 25px 28px 25px 0;
  background: transparent;
}

.notice + .notice {
  padding-left: 28px;
  border-left: 1px solid var(--line);
}

.notice-icon {
  flex: 0 0 24px;
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  background: var(--accent);
  border-radius: 50%;
}

.notice-device .notice-icon {
  color: var(--ink);
  background: #d7d3c8;
}

.notice strong {
  display: block;
  margin: 1px 0 4px;
  font-size: 13px;
}

.notice p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.step-nav {
  position: sticky;
  z-index: 20;
  top: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  margin: 34px 0 18px;
  background: rgba(238, 236, 229, 0.92);
  border: 1px solid var(--line-strong);
  backdrop-filter: blur(14px);
}

.step-nav a {
  display: flex;
  min-width: 0;
  padding: 14px 18px;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  border-right: 1px solid var(--line);
  transition: color 160ms ease, background 160ms ease;
}

.step-nav a:last-child {
  border-right: 0;
}

.step-nav a:hover,
.step-nav a:focus-visible {
  color: var(--ink);
  background: var(--surface);
  outline: 0;
}

.step-nav span {
  color: var(--accent);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.section {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px 30px;
  margin: 0 0 18px;
  padding: 38px 40px 42px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 2px;
  box-shadow: var(--shadow-card);
  scroll-margin-top: 78px;
}

.section-title {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 10px;
  padding-bottom: 28px;
  color: var(--ink);
  font-size: 24px;
  font-weight: 760;
  border-bottom: 1px solid var(--line);
}

.section-title > span {
  display: grid;
  flex: 0 0 auto;
  width: auto;
  height: auto;
  place-items: center;
  color: var(--accent);
  font-size: 11px;
  letter-spacing: 0.12em;
  background: none;
}

.section-title small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 450;
  letter-spacing: 0;
}

.input-group {
  display: flex;
  min-width: 0;
  margin: 0;
  align-items: stretch;
  flex-direction: column;
  gap: 9px;
}

.input-group.full-width,
.calculation-group,
.resource-links,
.attachment-note {
  grid-column: 1 / -1;
}

.input-group label {
  width: auto;
  color: #3d3b36;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
  text-align: left;
}

.input-group input,
.input-group select {
  width: 100%;
  min-width: 0;
  min-height: 50px;
  padding: 12px 14px;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.4;
  text-align: left;
  background: #fff;
  border: 1px solid #cbc7bd;
  border-radius: 2px;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.input-group input:hover,
.input-group select:hover {
  border-color: #88847b;
}

.input-group input:focus,
.input-group select:focus {
  outline: none;
  background: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(36, 87, 245, 0.12);
}

.input-group input::placeholder {
  color: #9a978f;
}

.input-group input[type="file"] {
  padding: 6px;
  color: var(--muted);
  background: #fff;
}

.input-group input[type="file"]::file-selector-button {
  margin-right: 12px;
  padding: 8px 12px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  background: var(--surface-soft);
  border: 0;
  border-radius: 1px;
  cursor: pointer;
}

#healthInsurance-group {
  display: none;
}

#bank option,
#practiceCategory option {
  text-align: left;
}

.resource-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: -6px;
}

.resource-links br {
  display: none;
}

.resource-links a {
  display: inline-flex;
  padding: 8px 12px;
  align-items: center;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  background: var(--accent-soft);
  border: 1px solid #d3dcff;
  border-radius: 999px;
  transition: transform 160ms ease, background 160ms ease;
}

.resource-links a::after {
  margin-left: 6px;
  content: "↗";
}

.resource-links a:hover {
  background: #dbe3ff;
  transform: translateY(-1px);
}

.calculate-result {
  width: 100%;
  padding: 18px 20px;
  color: #fff;
  font-size: 15px;
  font-weight: 650;
  line-height: 2;
  text-align: left;
  white-space: pre-line;
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 2px;
}

.attachment-note {
  margin: -4px 0 0;
  padding: 13px 15px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
  background: var(--surface-soft);
  border-left: 2px solid var(--accent);
  border-radius: 0;
}

.clear-images-button {
  align-self: flex-start;
  padding: 10px 14px;
  color: var(--danger);
  font-size: 13px;
  font-weight: 800;
  background: var(--danger-soft);
  border: 1px solid rgba(194, 65, 61, 0.18);
  border-radius: 2px;
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease;
}

.clear-images-button:hover {
  background: #ffe3e0;
  transform: translateY(-1px);
}

.preview-heading {
  display: flex;
  margin: 80px 0 24px;
  align-items: end;
  justify-content: space-between;
}

.preview-heading .eyebrow {
  margin-bottom: 7px;
  color: var(--accent);
}

h2 {
  margin: 0;
  color: var(--ink);
  font-size: 40px;
  font-weight: 760;
  letter-spacing: -0.05em;
}

.preview-heading > span {
  padding: 7px 11px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
}

.preview-mobile-note {
  padding: 12px 14px;
  color: var(--amber);
  font-size: 12px;
  line-height: 1.6;
  background: var(--amber-soft);
  border-radius: 2px;
}

.preview-scroll {
  width: 100%;
  padding: 42px 32px;
  overflow-x: auto;
  background: #d8d5cd;
  border: 1px solid #cbc7bd;
  border-radius: 2px;
  box-shadow: inset 0 1px 8px rgba(21, 21, 19, 0.06);
}

#form-simulater {
  width: 1040px;
  margin: 0 auto;
  padding: 30px 20px;
  background: #fff;
  box-shadow: 0 18px 40px rgba(21, 21, 19, 0.14);
}

.print-actions {
  display: flex;
  margin: 22px 0 0;
  padding: 24px 26px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 2px;
  box-shadow: var(--shadow-card);
}

.print-actions p {
  margin: 0;
  font-size: 12px;
  line-height: 1.65;
}

.submit-btn {
  flex: 0 0 auto;
  min-width: 210px;
  padding: 14px 22px;
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  background: var(--accent);
  border: 0;
  border-radius: 2px;
  box-shadow: none;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.submit-btn::before {
  margin-right: 8px;
  content: "↧";
}

.submit-btn:hover:not(:disabled) {
  background: var(--accent-dark);
  box-shadow: none;
  transform: translateY(-1px);
}

.submit-btn:focus-visible,
.clear-images-button:focus-visible,
.resource-links a:focus-visible {
  outline: 3px solid rgba(36, 87, 245, 0.24);
  outline-offset: 3px;
}

.submit-btn:disabled {
  cursor: wait;
  opacity: 0.65;
}

.mb-0 {
  margin-bottom: 0;
}

.mt-15 {
  margin-top: 0;
}

@media (min-width: 800px) {
  .mobile {
    display: none;
  }
}

@media (max-width: 799px) {
  body {
    padding: 0 14px 42px;
  }

  .masthead {
    min-height: 64px;
  }

  .masthead p {
    font-size: 10px;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: 0;
    padding: 48px 0 36px;
    align-items: flex-start;
    gap: 32px;
  }

  h1 {
    font-size: clamp(48px, 14vw, 68px);
    letter-spacing: -0.07em;
  }

  .hero-description {
    font-size: 15px;
  }

  .year-badge {
    min-height: 86px;
    width: 100%;
    padding: 17px 20px;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: end;
  }

  .year-badge span {
    align-self: start;
  }

  .year-badge strong {
    grid-column: 2;
    grid-row: 1 / 3;
    margin: 0;
    font-size: 48px;
  }

  .notice-grid,
  .section {
    grid-template-columns: 1fr;
  }

  .notice-grid {
    padding: 10px 0;
  }

  .notice,
  .notice + .notice {
    padding: 16px 0;
    border-left: 0;
  }

  .notice + .notice {
    border-top: 1px solid var(--line);
  }

  .step-nav {
    position: static;
    display: flex;
    margin: 22px 0 14px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
  }

  .step-nav a {
    flex: 0 0 auto;
    min-width: 138px;
    scroll-snap-align: start;
  }

  .section {
    gap: 20px;
    padding: 26px 20px 30px;
    border-radius: 2px;
  }

  .section-title,
  .input-group.full-width,
  .calculation-group,
  .resource-links,
  .attachment-note {
    grid-column: 1;
  }

  .section-title {
    font-size: 20px;
  }

  .preview-heading {
    margin-top: 58px;
  }

  h2 {
    font-size: 34px;
  }

  .preview-scroll {
    padding: 20px 14px;
    border-radius: 2px;
  }

  .print-actions {
    padding: 22px;
    align-items: stretch;
    flex-direction: column;
    border-radius: 2px;
  }

  .submit-btn {
    width: 100%;
    min-width: 0;
  }
}

/* Form simulator typography */
#form-simulater td {
  padding: unset;
  border: unset;
}

.s1 * {
  margin: 0;
  padding: 0;
  text-indent: 0;
}

.s1 {
  color: black;
  font-family: PMingLiU, serif;
  font-size: 18pt;
  font-style: normal;
  font-weight: normal;
  text-decoration: none;
}

.s1 p,
.s2 {
  margin: 0;
  color: black;
  font-family: PMingLiU, serif;
  font-size: 12pt;
  font-style: normal;
  font-weight: normal;
  text-decoration: none;
}

.s3 {
  color: black;
  font-family: PMingLiU, serif;
  font-size: 10pt;
  font-style: normal;
  font-weight: normal;
  text-decoration: none;
}

.s4,
.s5 {
  color: black;
  font-family: "Times New Roman", serif;
  font-size: 12pt;
  font-style: normal;
  text-decoration: underline;
}

.s4 {
  font-weight: normal;
}

.s5 {
  font-weight: bold;
}

#l1,
#l2 {
  padding-left: 0;
}

#l1 > li > *:first-child::before,
#l2 > li > *:first-child::before {
  color: black;
  font-family: Wingdings;
  font-size: 12pt;
  font-style: normal;
  font-weight: normal;
  text-decoration: none;
  content: " ";
}

table,
tbody {
  overflow: visible;
  vertical-align: top;
}

/* Browser-native PDF output: keep text and borders as searchable/vector content. */
@page {
  size: A4 portrait;
  margin: 8mm;
}

@media print {
  html,
  body {
    width: auto;
    min-height: 0;
    margin: 0;
    padding: 0;
    background: #fff;
  }

  body {
    display: block;
  }

  .page-wrap {
    width: auto;
    max-width: none;
  }

  .body-container > :not(.preview-scroll) {
    display: none !important;
  }

  .body-container {
    width: auto;
    max-width: none;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: #fff;
  }

  .preview-scroll {
    width: 100%;
    height: auto;
    padding: 0;
    overflow: visible !important;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: #fff;
  }

  #form-simulater {
    width: 1040px !important;
    min-width: 1040px !important;
    min-height: 0 !important;
    margin: 0 auto;
    padding: 0;
    zoom: var(--print-scale, 0.66);
    background: #fff;
    box-shadow: none;
    break-inside: avoid;
    page-break-inside: avoid;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}
