:root {
  color-scheme: light;
  --ink: #1d252d;
  --muted: #5e6d7a;
  --line: #d9e1e8;
  --panel: #f7f9fb;
  --paper: #ffffff;
  --accent: #0f766e;
  --accent-dark: #0b5f59;
  --warm: #d97706;
  --shadow: 0 18px 50px rgba(29, 37, 45, .12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: #eef3f6;
}

a {
  color: inherit;
}

.h2 {
  font-size: -webkit-xxx-large;
}
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid rgba(217, 225, 232, .8);
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 7px;
  color: #fff;
  background: var(--accent);
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  color: var(--muted);
  font-size: 15px;
}

nav a {
  text-decoration: none;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 440px);
  gap: clamp(28px, 5vw, 72px);
  min-height: 620px;
  align-items: center;
  padding: clamp(52px, 8vw, 92px) clamp(18px, 4vw, 56px);
  background:
    linear-gradient(115deg, rgba(255, 255, 255, .92), rgba(238, 243, 246, .5)),
    url("data:image/svg+xml,%3Csvg width='1200' height='760' viewBox='0 0 1200 760' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='1200' height='760' fill='%23e8eef1'/%3E%3Cg fill='none' stroke='%23cfd9df' stroke-width='2' opacity='.65'%3E%3Cpath d='M88 115h280v180H88zM428 84h310v236H428zM796 132h276v160H796zM170 392h330v210H170zM602 392h410v230H602z'/%3E%3Cpath d='M128 166h176M128 210h122M468 140h212M468 190h160M836 184h168M210 456h222M210 508h156M646 458h290M646 512h210'/%3E%3C/g%3E%3C/svg%3E");
  background-size: cover;
  background-position: center;
}

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

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(42px, 7vw, 80px);
  line-height: .98;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.08;
  letter-spacing: 0;
}

h3 {
  margin: 0;
  font-size: 21px;
  letter-spacing: 0;
}

.hero-text {
  max-width: 620px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 19px;
  line-height: 1.7;
}

.hero-actions,
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 7px;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.button.primary {
  color: #fff;
  background: var(--accent);
}

.button.primary:hover {
  background: var(--accent-dark);
}

.button.secondary {
  color: var(--ink);
  border-color: var(--line);
  background: rgba(255, 255, 255, .82);
}

.hero-panel {
  display: flex;
  justify-content: center;
}

.home-hero {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 520px);
}

.hero-image {
  display: block;
  width: min(100%, 520px);
  height: auto;
  filter: drop-shadow(0 24px 42px rgba(29, 37, 45, .14));
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.hero-stats span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(15, 118, 110, .18);
  border-radius: 7px;
  color: #344250;
  background: rgba(255, 255, 255, .78);
}

.hero-stats strong {
  color: var(--accent-dark);
}

.paper-preview {
  position: relative;
  width: min(100%, 360px);
  aspect-ratio: 1 / 1.28;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.document-label {
  display: block;
  margin-bottom: 40px;
  font-size: 23px;
  font-weight: 900;
}

.line {
  display: block;
  width: 78%;
  height: 12px;
  margin: 18px 0;
  border-radius: 4px;
  background: #dbe5ea;
}

.line.wide {
  width: 100%;
}

.line.short {
  width: 50%;
}

.stamp {
  position: absolute;
  right: 34px;
  bottom: 34px;
  display: grid;
  width: 72px;
  height: 72px;
  place-items: center;
  border: 3px solid var(--warm);
  border-radius: 50%;
  color: var(--warm);
  font-weight: 900;
}

.section {
  padding: clamp(48px, 7vw, 86px) clamp(18px, 4vw, 56px);
}

.section-heading {
  max-width: 780px;
  margin-bottom: 28px;
}

.section-heading > p:not(.eyebrow) {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.7;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.tool-card {
  display: flex;
  flex-direction: column;
  min-height: 230px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.tool-card p {
  color: var(--muted);
  line-height: 1.6;
}

.tool-card a {
  margin-top: auto;
  color: var(--accent-dark);
  font-weight: 800;
}

.tool-card.active {
  border-color: rgba(15, 118, 110, .35);
}

.tool-tag {
  display: inline-flex;
  margin-bottom: 16px;
  color: var(--warm);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.tool-section {
  background: #fff;
}

.grouped-tools {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.compact-tools {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.split-section {
  background: none;
}

.tool-section > .section-heading h1 {
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.06;
}

.builder {
  display: grid;
  grid-template-columns: minmax(280px, 460px) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 44px);
  align-items: start;
}

.form-panel {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

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

legend {
  margin-bottom: 12px;
  font-weight: 900;
}

label {
  display: grid;
  gap: 7px;
  margin-bottom: 12px;
  color: #344250;
  font-size: 14px;
  font-weight: 750;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid #cbd6dd;
  border-radius: 7px;
  padding: 11px 12px;
  color: var(--ink);
  font: inherit;
  background: #fff;
}

textarea {
  resize: vertical;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.receipt-preview {
  min-height: 760px;
  padding: clamp(28px, 5vw, 56px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.receipt-head {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.receipt-head p,
.receipt-preview dd {
  white-space: pre-line;
}

.receipt-head span {
  color: var(--accent-dark);
  font-weight: 900;
}

.receipt-title {
  margin-top: 42px;
  text-align: center;
  font-size: 32px;
  line-height: 1.18;
}

.receipt-title span {
  display: block;
  margin-top: 8px;
  color: var(--accent-dark);
  font-size: 36px;
  font-weight: 900;
}

.receipt-title.no-subtitle {
  margin-bottom: 48px;
}

.receipt-preview p {
  color: #354250;
  font-size: 17px;
  line-height: 1.8;
}

dl {
  display: grid;
  gap: 0;
  margin: 28px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

dl div {
  display: grid;
  grid-template-columns: 210px 1fr;
  border-bottom: 1px solid var(--line);
}

dl div:last-child {
  border-bottom: 0;
}

dt,
dd {
  margin: 0;
  padding: 14px 16px;
}

dt {
  background: var(--panel);
  font-weight: 900;
}

.legal-note {
  color: var(--muted);
  font-size: 14px;
}

.letter-subject {
  margin: 40px 0 24px;
  padding: 14px 16px;
  border-left: 4px solid var(--accent);
  background: var(--panel);
  font-weight: 900;
}

.letter-body p {
  margin: 0 0 18px;
}

.letter-body p:first-child {
  margin-top: 18px;
}

.result-amount {
  margin: 28px 0;
  padding: 24px;
  border: 1px solid rgba(15, 118, 110, .28);
  border-radius: 8px;
  text-align: center;
  background: #eef8f6;
}

.result-amount span {
  display: block;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
}

.result-amount strong {
  display: block;
  margin-top: 8px;
  color: var(--accent-dark);
  font-size: clamp(36px, 6vw, 56px);
  line-height: 1;
}

.signature {
  margin-top: 36px;
  text-align: right;
}

.signature p {
  margin: 0 0 14px;
}

.signature-image-wrap {
  display: flex;
  justify-content: flex-end;
}

#signature-preview {
  display: block;
  max-width: 220px;
  max-height: 84px;
  object-fit: contain;
}

.no-signature .signature-image-wrap,
.no-signature .signature-label {
  display: none;
}

.is-hidden {
  display: none !important;
}

.contact-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  flex-wrap: wrap;
}

.contact-section > div {
  max-width: 760px;
}

.contact-fallback {
  flex-basis: 100%;
  margin: -12px 0 0;
  color: var(--muted);
}

.contact-section p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.7;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 24px clamp(18px, 4vw, 56px);
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: #fff;
}

@media (max-width: 920px) {
  .hero,
  .builder,
  .tool-grid {
    grid-template-columns: 1fr;
  }

  .home-hero {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .contact-section {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  h1 {
    font-size: 42px;
  }

  .form-row,
  dl div {
    grid-template-columns: 1fr;
  }

  dt {
    border-bottom: 1px solid var(--line);
  }

  footer {
    flex-direction: column;
  }
}

@media print {
  @page {
    size: A4;
    margin: 0;
  }

  body {
    background: #fff;
  }

  .site-header,
  .hero,
  .section:not(.tool-section),
  .section-heading,
  .form-panel,
  footer {
    display: none !important;
  }

  .tool-section {
    padding: 0;
  }

  .builder {
    display: block;
  }

  .receipt-preview {
    display: flex;
    flex-direction: column;
    min-height: auto;
    height: 296mm;
    padding: 21mm 20mm 17mm;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .receipt-head {
    padding-bottom: 16px;
  }

  .receipt-head p {
    margin: 4px 0 0;
    line-height: 1.45;
  }

  .receipt-title {
    margin-top: 28px;
    font-size: 24px;
  }

  .receipt-title span {
    margin-top: 6px;
    font-size: 32px;
  }

  .receipt-title.no-subtitle {
    margin-bottom: 26mm;
  }

  .receipt-preview p {
    font-size: 15px;
    line-height: 1.58;
  }

  dl {
    margin: 20px 0;
    break-inside: avoid;
  }

  dt,
  dd {
    padding: 9px 12px;
    font-size: 13.5px;
  }

  .legal-note {
    margin-top: 2mm;
    font-size: 12.5px;
    line-height: 1.45;
  }

  .letter-subject {
    margin: 26px 0 18px;
    padding: 10px 12px;
  }

  .letter-body p {
    margin-bottom: 13px;
  }

  .letter-body p:first-child {
    margin-top: 12mm;
  }

  .signature {
    margin-top: auto;
    padding-top: 16mm;
    break-inside: avoid;
  }

  .signature p {
    margin-bottom: 8px;
  }

  #signature-preview {
    max-width: 190px;
    max-height: 64px;
  }
}
