:root {
  color-scheme: light;
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-soft: #f1f5f9;
  --text: #101828;
  --muted: #5b6678;
  --border: #dde5ef;
  --border-strong: #c8d3df;
  --green: #12a150;
  --green-dark: #087a36;
  --green-soft: #e9f8ef;
  --blue: #145cf2;
  --blue-soft: #eaf1ff;
  --yellow: #f5c542;
  --yellow-soft: #fff7d6;
  --red: #dc2626;
  --red-soft: #fff1f1;
  --shadow: 0 18px 48px rgba(16, 24, 40, 0.08);
  --shadow-soft: 0 10px 24px rgba(16, 24, 40, 0.07);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  padding-bottom: 54px;
  background:
    linear-gradient(180deg, #ffffff 0%, #f8fafc 38%, #eef5ff 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.topbar {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 23px;
  font-weight: 800;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  background: var(--green);
  color: white;
  box-shadow: 0 10px 20px rgba(18, 161, 80, 0.24);
}

.brand-mark svg,
.privacy-strip svg,
.result-banner svg,
.icon-button svg,
.flow-arrow svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.support-menu {
  position: relative;
}

.support-button {
  border: 0;
  border-radius: var(--radius);
  padding: 10px 12px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.support-button:hover,
.support-button:focus-visible,
.support-button[aria-expanded="true"] {
  color: var(--blue);
  background: var(--blue-soft);
}

.support-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 280px;
  z-index: 40;
  display: grid;
  gap: 5px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: white;
  box-shadow: var(--shadow);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.support-panel strong {
  color: var(--text);
  font-size: 14px;
}

.support-panel a {
  color: var(--blue);
  font-weight: 800;
}

.shell {
  width: min(1280px, calc(100vw - 32px));
  margin: 0 auto 40px;
}

.hero {
  min-height: 360px;
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(420px, 1fr);
  gap: 44px;
  align-items: center;
  padding: 56px 0 34px;
}

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

.hero h1 {
  max-width: 600px;
  font-size: 58px;
  line-height: 1.02;
  font-weight: 850;
}

.hero-copy > p:not(.value-line) {
  max-width: 580px;
  margin-top: 18px;
  color: #344054;
  font-size: 20px;
  line-height: 1.55;
}

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

.primary-link,
.ghost-link,
.secondary-button,
.primary-button,
.download-button {
  border-radius: var(--radius);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, background 160ms ease;
}

.primary-link,
.primary-button {
  border: 0;
  color: white;
  background: var(--green);
  box-shadow: 0 12px 22px rgba(18, 161, 80, 0.2);
}

.primary-link:hover,
.primary-button:hover:not(:disabled) {
  background: var(--green-dark);
  transform: translateY(-1px);
}

.ghost-link,
.secondary-button,
.download-button {
  border: 1px solid var(--border-strong);
  background: white;
  color: var(--blue);
}

.ghost-link:hover,
.secondary-button:hover,
.download-button:hover {
  border-color: var(--blue);
  box-shadow: var(--shadow-soft);
}

.value-line {
  display: inline-flex;
  margin-top: 18px;
  padding: 10px 12px;
  border-left: 4px solid var(--yellow);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--yellow-soft);
  color: #5f4300;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.4;
}

.comparison-stage {
  min-height: 300px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  position: relative;
}

.comparison-stage::before {
  content: "";
  position: absolute;
  inset: 22px 18px;
  border: 1px dashed #c7d4e4;
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(20, 92, 242, 0.06), rgba(18, 161, 80, 0.06));
  pointer-events: none;
}

.mini-doc {
  min-height: 238px;
  display: grid;
  align-content: end;
  justify-items: start;
  gap: 5px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  animation: floatDoc 4.8s ease-in-out infinite;
}

.mini-doc.after-state {
  animation-delay: 520ms;
}

.mini-doc strong {
  font-size: 17px;
}

.mini-doc > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.doc-lines {
  position: absolute;
  inset: 30px 24px auto;
  display: grid;
  gap: 10px;
}

.doc-lines span {
  height: 9px;
  border-radius: 999px;
  background: #e5eaf0;
}

.doc-lines span:nth-child(2) {
  width: 78%;
}

.doc-lines span:nth-child(3) {
  width: 88%;
}

.signature-scribble {
  position: absolute;
  left: 26px;
  right: 52px;
  top: 128px;
  height: 44px;
  border-bottom: 4px solid #3156d4;
  border-radius: 50%;
  transform: rotate(-4deg);
}

.signature-scribble::before,
.signature-scribble::after {
  content: "";
  position: absolute;
  width: 42%;
  height: 28px;
  border: 3px solid #3156d4;
  border-top: 0;
  border-radius: 50%;
  bottom: -1px;
}

.signature-scribble::before {
  left: 10%;
}

.signature-scribble::after {
  right: 8%;
}

.signature-scribble.green,
.signature-scribble.green::before,
.signature-scribble.green::after {
  border-color: var(--green);
}

.state-mark {
  position: absolute;
  right: 16px;
  top: 96px;
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  font-size: 62px;
  line-height: 1;
  font-weight: 900;
}

.state-mark.question {
  color: var(--yellow);
  text-shadow:
    2px 0 #111827,
    -2px 0 #111827,
    0 2px #111827,
    0 -2px #111827;
  animation: pulseMark 2.4s ease-in-out infinite;
}

.state-mark.check svg {
  width: 76px;
  height: 76px;
  fill: var(--green);
  filter: drop-shadow(0 8px 12px rgba(18, 161, 80, 0.22));
}

.flow-arrow {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--blue);
  color: white;
  box-shadow: 0 10px 22px rgba(20, 92, 242, 0.22);
  position: relative;
  z-index: 1;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(320px, 430px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.left-rail {
  display: grid;
  gap: 16px;
  align-content: start;
}

.panel,
.preview-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.panel {
  padding: 22px;
}

.panel-heading {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.step-number {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green-dark);
  display: grid;
  place-items: center;
  font-weight: 900;
  flex: 0 0 auto;
}

h2 {
  font-size: 21px;
  line-height: 1.25;
}

h3 {
  font-size: 15px;
  line-height: 1.3;
}

.panel-heading p {
  color: var(--muted);
  margin-top: 5px;
  font-size: 14px;
  line-height: 1.45;
}

.dropzone {
  min-height: 232px;
  border: 2px dashed #b8c8da;
  border-radius: var(--radius);
  background: #fbfdff;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 24px;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.dropzone:hover,
.dropzone.dragging,
.dropzone:focus-within {
  border-color: var(--green);
  background: #f5fff9;
  transform: translateY(-1px);
}

.dropzone input {
  display: none;
}

.file-icon {
  width: 58px;
  height: 66px;
  display: grid;
  place-items: center;
  margin-bottom: 12px;
}

.file-icon svg {
  width: 58px;
  height: 66px;
}

.file-icon path {
  fill: none;
  stroke: #d63031;
  stroke-width: 2;
  stroke-linejoin: round;
}

.file-icon path:first-child {
  fill: #fff7f7;
}

.file-icon text {
  fill: #d63031;
  font-size: 11px;
  font-weight: 900;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}

.drop-title {
  font-weight: 800;
}

.drop-subtitle {
  color: var(--muted);
  font-size: 13px;
  margin: 6px 0 14px;
}

.secondary-button.full,
.primary-button {
  width: 100%;
}

.primary-button {
  min-height: 48px;
  font-size: 15px;
}

.primary-button:disabled,
.secondary-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.file-row {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  background: #fbfdff;
}

.small-pdf {
  width: 34px;
  height: 38px;
  border-radius: 5px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 900;
  color: var(--red);
  border: 1px solid #facaca;
  background: #fff7f7;
}

.file-row span:not(.small-pdf) {
  color: var(--muted);
  font-size: 13px;
  display: block;
  margin-top: 2px;
}

.icon-button {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.icon-button:hover,
.icon-button:focus-visible {
  background: var(--surface-soft);
  color: var(--text);
}

.privacy-strip,
.result-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border-radius: var(--radius);
  padding: 14px;
  margin-top: 16px;
}

.privacy-strip {
  background: var(--green-soft);
  color: var(--green-dark);
}

.privacy-strip span,
.result-banner span,
.fine-print {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.price-line {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  padding: 4px 0 14px;
  border-bottom: 1px solid var(--border);
}

.price-label {
  display: block;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.price-line small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.price-line strong {
  color: var(--green-dark);
  font-size: 30px;
  line-height: 1;
  white-space: nowrap;
}

.value-note {
  margin: 12px 0 14px;
  color: #5f4300;
  background: var(--yellow-soft);
  border-left: 4px solid var(--yellow);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.4;
}

.fine-print {
  margin-top: 10px;
}

.process-panel {
  box-shadow: none;
}

.timeline {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  list-style: none;
  padding: 0;
  margin: 18px 0 0;
  gap: 6px;
}

.timeline li {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  position: relative;
}

.timeline span {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  margin: 0 auto 8px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--muted);
}

.timeline li.active span,
.timeline li.done span {
  background: var(--green);
  color: white;
  border-color: var(--green);
}

.timeline li.active span {
  box-shadow: 0 0 0 5px rgba(18, 161, 80, 0.12);
}

.status-note {
  margin-top: 16px;
  padding: 12px;
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.preview-panel {
  overflow: hidden;
}

.preview-header {
  min-height: 76px;
  padding: 18px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--border);
}

.preview-header h2 {
  display: inline-block;
  margin-right: 10px;
}

.status-pill {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border-radius: var(--radius);
  padding: 0 12px;
  font-size: 13px;
  font-weight: 900;
  background: var(--surface-soft);
  color: var(--muted);
}

.status-pill.valid {
  background: var(--green-soft);
  color: var(--green-dark);
}

.status-pill.failed {
  background: var(--red-soft);
  color: var(--red);
}

.download-button {
  color: var(--blue);
  background: white;
  white-space: nowrap;
}

.download-button.disabled {
  pointer-events: none;
  opacity: 0.45;
}

.pdf-frame {
  background: #1f2937;
}

.pdf-toolbar {
  height: 48px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 22px;
  color: white;
  font-weight: 700;
}

.toolbar-dots {
  display: flex;
  gap: 6px;
}

.toolbar-dots i {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
}

.pdf-page {
  min-height: 512px;
  margin: 0 26px;
  background:
    linear-gradient(#eef2f7 14px, transparent 14px) 52px 88px / 70% 34px no-repeat,
    linear-gradient(#eef2f7 14px, transparent 14px) 52px 126px / 82% 34px no-repeat,
    linear-gradient(#eef2f7 14px, transparent 14px) 52px 342px / 74% 34px no-repeat,
    #ffffff;
  display: grid;
  place-items: center;
  border: 1px solid #cbd5df;
  border-bottom: 0;
}

.pdf-preview-frame {
  width: 100%;
  min-height: 512px;
  height: 100%;
  border: 0;
  background: white;
}

.signature-preview {
  width: min(520px, calc(100% - 36px));
  text-align: center;
  padding: 28px;
}

.signature-preview h3 {
  font-size: 34px;
  line-height: 1.12;
  color: var(--text);
  font-weight: 600;
}

.signature-preview h3.valid {
  color: var(--green-dark);
}

.large-mark {
  font-size: 92px;
  line-height: 1;
  font-weight: 900;
  margin: 4px 0 10px;
}

.large-mark.question {
  color: var(--yellow);
  text-shadow:
    3px 0 #111827,
    -3px 0 #111827,
    0 3px #111827,
    0 -3px #111827;
}

.large-mark.check {
  color: var(--green);
  filter: drop-shadow(0 8px 12px rgba(18, 161, 80, 0.18));
}

.large-mark.cross {
  color: var(--red);
}

.signature-preview p {
  font-size: 17px;
  line-height: 1.35;
}

#previewMeta {
  color: var(--muted);
  margin-top: 4px;
}

.result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--border);
}

.result-grid > div {
  padding: 22px;
}

.result-grid > div + div {
  border-left: 1px solid var(--border);
}

.details-list {
  margin: 12px 0 0;
}

.details-list div {
  display: grid;
  grid-template-columns: minmax(118px, 0.75fr) minmax(0, 1fr);
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #e9eef4;
}

.details-list dt {
  color: var(--muted);
  font-size: 13px;
}

.details-list dd {
  margin: 0;
  font-size: 13px;
  text-align: right;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.result-banner {
  margin: 0 22px 22px;
  border: 1px solid var(--border);
}

.result-banner.valid {
  background: var(--green-soft);
  border-color: #8ed6a8;
  color: var(--green-dark);
}

.result-banner.failed {
  background: var(--red-soft);
  border-color: #f4b4b4;
  color: var(--red);
}

.result-banner.neutral {
  background: var(--blue-soft);
  color: #174ea6;
}

.product-credit {
  position: fixed;
  right: 18px;
  bottom: 14px;
  z-index: 30;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  color: var(--muted);
  box-shadow: var(--shadow-soft);
  font-size: 13px;
  font-weight: 700;
  backdrop-filter: blur(12px);
}

.product-credit a {
  color: var(--blue);
  font-weight: 900;
}

.product-credit a:hover,
.product-credit a:focus-visible {
  text-decoration: underline;
}

.hidden {
  display: none !important;
}

body.modal-open {
  overflow: hidden;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(16, 24, 40, 0.58);
}

.password-dialog {
  width: min(440px, 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  background: var(--surface);
  box-shadow: 0 24px 80px rgba(16, 24, 40, 0.24);
}

.password-dialog h2 {
  margin-bottom: 8px;
}

.password-dialog > form > p:not(.password-error) {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 18px;
}

.password-dialog label {
  display: block;
  margin-bottom: 7px;
  font-size: 14px;
  font-weight: 800;
}

.password-dialog input {
  width: 100%;
  min-height: 44px;
  border: 1px solid #b9c6d3;
  border-radius: var(--radius);
  padding: 0 12px;
  color: var(--text);
  background: white;
}

.password-dialog input:focus {
  border-color: var(--green);
  outline: 3px solid rgba(18, 161, 80, 0.16);
}

.password-error {
  min-height: 20px;
  margin-top: 7px;
  color: var(--red);
  font-size: 13px;
  line-height: 1.4;
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.modal-actions .primary-button,
.modal-actions .secondary-button {
  width: 100%;
}

@keyframes floatDoc {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

@keyframes pulseMark {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}

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

  .hero {
    gap: 28px;
  }

  .comparison-stage {
    max-width: 760px;
  }
}

@media (max-width: 720px) {
  body {
    padding-bottom: 0;
  }

  .topbar {
    min-height: auto;
    padding: 14px 16px;
    align-items: center;
    gap: 12px;
    flex-direction: row;
  }

  .brand {
    font-size: 21px;
  }

  .support-menu {
    width: auto;
  }

  .support-button {
    padding: 10px 8px;
  }

  .support-panel {
    left: auto;
    right: 0;
    width: min(280px, calc(100vw - 32px));
  }

  .shell {
    width: calc(100vw - 20px);
  }

  .hero {
    min-height: auto;
    padding: 34px 0 24px;
  }

  .hero h1 {
    font-size: 40px;
  }

  .hero-copy > p:not(.value-line) {
    font-size: 17px;
  }

  .comparison-stage {
    min-height: 204px;
    grid-template-columns: minmax(0, 1fr) 34px minmax(0, 1fr);
    gap: 8px;
  }

  .comparison-stage::before {
    inset: 0;
  }

  .flow-arrow {
    width: 34px;
    height: 34px;
  }

  .flow-arrow svg {
    width: 17px;
    height: 17px;
  }

  .mini-doc {
    min-height: 188px;
    padding: 14px;
  }

  .mini-doc strong {
    font-size: 15px;
  }

  .mini-doc > span {
    font-size: 12px;
    line-height: 1.25;
  }

  .doc-lines {
    inset: 22px 14px auto;
    gap: 8px;
  }

  .doc-lines span {
    height: 7px;
  }

  .signature-scribble {
    left: 14px;
    right: 28px;
    top: 94px;
    height: 34px;
    border-bottom-width: 3px;
  }

  .signature-scribble::before,
  .signature-scribble::after {
    height: 22px;
    border-width: 2px;
    border-top: 0;
  }

  .state-mark {
    right: 6px;
    top: 76px;
    width: 52px;
    height: 52px;
    font-size: 46px;
  }

  .state-mark.check svg {
    width: 54px;
    height: 54px;
  }

  .panel,
  .preview-header,
  .result-grid > div {
    padding: 16px;
  }

  .preview-header,
  .result-grid {
    grid-template-columns: 1fr;
  }

  .preview-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .result-grid > div + div {
    border-left: 0;
    border-top: 1px solid var(--border);
  }

  .pdf-page {
    min-height: 380px;
    margin: 0 12px;
  }

  .pdf-preview-frame {
    min-height: 380px;
  }

  .signature-preview {
    width: min(100%, calc(100% - 20px));
    padding: 22px 10px;
  }

  .signature-preview h3 {
    font-size: 25px;
  }

  .large-mark {
    font-size: 74px;
  }

  .details-list div {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .details-list dd {
    text-align: left;
  }

  .product-credit {
    position: static;
    width: max-content;
    max-width: calc(100vw - 20px);
    margin: 0 auto 18px;
  }

  .password-dialog {
    padding: 20px;
  }
}

@media (max-width: 420px) {
  .hero h1 {
    font-size: 34px;
  }

  .hero-actions {
    display: grid;
  }

  .primary-link,
  .ghost-link {
    width: 100%;
  }

  .price-line {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 340px) {
  .comparison-stage {
    grid-template-columns: 1fr;
  }

  .flow-arrow {
    justify-self: center;
    transform: rotate(90deg);
  }
}
