:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --border: #e2e8f0;
  --primary: #0f766e;
  --primary-hover: #0d5e58;
  --primary-soft: #f0fdfa;
  --danger: #dc2626;
  --warning-bg: #fffbeb;
  --warning-border: #fde68a;
  --radius: 12px;
  --shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.container {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 16px;
}

.hidden {
  display: none !important;
}

.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.center { text-align: center; }

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-badge {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--primary-soft);
  display: grid;
  place-items: center;
  font-size: 18px;
}

.brand-name {
  display: block;
  font-size: 15px;
  line-height: 1.2;
}

.brand-tag {
  display: block;
  font-size: 11px;
  color: var(--muted);
}

.btn-exit {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.btn-exit:hover {
  background: #fecaca;
}

/* Hero */
.hero {
  padding: 36px 0 28px;
  background: linear-gradient(180deg, #ffffff 0%, #f0fdfa 100%);
  border-bottom: 1px solid var(--border);
}

.pill {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  background: #ccfbf1;
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 14px;
}

.hero h1 {
  font-size: clamp(24px, 4.5vw, 38px);
  line-height: 1.25;
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}

.hero-sub {
  font-size: 15px;
  color: var(--muted);
  max-width: 720px;
  margin: 0 0 22px;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 26px;
}

.micro-note {
  font-size: 12px;
  color: var(--muted);
}

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

.trust-item {
  display: flex;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
}

.trust-icon {
  color: var(--primary);
  font-weight: 700;
  font-size: 16px;
}

.trust-item strong {
  display: block;
  font-size: 13px;
}

.trust-item span {
  font-size: 12px;
  color: var(--muted);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, transform 0.1s ease;
}

.btn:active {
  transform: scale(0.99);
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  padding: 12px 20px;
  font-size: 14px;
}

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

.btn-lg {
  padding: 14px 24px;
  font-size: 15px;
  width: 100%;
  max-width: 340px;
}

.btn-sm {
  padding: 8px 14px;
  font-size: 13px;
}

.btn-full {
  width: 100%;
  padding: 13px 18px;
  font-size: 14px;
}

.btn-secondary {
  background: #e2e8f0;
  color: var(--text);
  padding: 12px 18px;
  font-size: 14px;
}

.btn-outline {
  background: #ffffff;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}

/* Compare Table */
.compare-section {
  padding: 28px 0;
}

.section-title {
  font-size: 18px;
  margin: 0 0 14px;
}

.compare-table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.compare-table th,
.compare-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  width: 50%;
}

.compare-table tr:last-child td {
  border-bottom: none;
}

.compare-table .col-highlight {
  background: var(--primary-soft);
  color: #134e4a;
}

/* Builder */
.builder-section {
  padding: 16px 0 40px;
}

.builder-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 20px;
}

.builder-header {
  margin-bottom: 20px;
}

.step-meta {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 8px;
}

.progress-track {
  width: 100%;
  height: 8px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--primary);
  transition: width 0.25s ease;
}

.form-step {
  display: none;
}

.form-step.active {
  display: block;
}

.form-step h3 {
  margin: 0 0 6px;
  font-size: 18px;
}

.step-hint {
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--muted);
}

.radio-cards {
  display: grid;
  gap: 12px;
}

.inline-cards {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.radio-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  cursor: pointer;
  background: #fff;
}

.radio-card:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.radio-card input {
  margin-top: 3px;
  accent-color: var(--primary);
}

.radio-card-body strong {
  display: block;
  font-size: 14px;
  margin-bottom: 3px;
}

.radio-card-body span {
  font-size: 12.5px;
  color: var(--muted);
}

.radio-card-body span strong {
  display: inline;
  font-size: inherit;
  margin-bottom: 0;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.fieldset-box {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  background: #f8fafc;
}

.fieldset-box h4 {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--primary);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 12px;
}

.field:last-child {
  margin-bottom: 0;
}

.field span {
  font-size: 12.5px;
  font-weight: 600;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  background: #ffffff;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 2px solid #99f6e4;
  border-color: var(--primary);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.field-note {
  font-size: 11.5px;
  color: var(--muted);
}

.conditional-box {
  margin-top: 14px;
  padding: 14px;
  border: 1px dashed #94a3b8;
  border-radius: var(--radius);
  background: #f8fafc;
}

.fee-summary-box {
  margin-top: 16px;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--primary-soft);
  border: 1px solid #99f6e4;
}

.fee-summary-box > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.fee-label {
  font-size: 13px;
  font-weight: 600;
}

.fee-amount {
  font-size: 18px;
  color: var(--primary);
}

.fee-summary-box small {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
}

.chip:hover {
  background: var(--primary-soft);
  border-color: var(--primary);
}

.form-error {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fef2f2;
  color: var(--danger);
  border: 1px solid #fecaca;
  font-size: 13px;
}

.form-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.form-nav .btn-primary {
  margin-left: auto;
}

/* Preview Section */
.preview-section {
  padding: 10px 0 48px;
}

.preview-layout {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 20px;
  align-items: start;
}

@media (max-width: 860px) {
  .preview-layout {
    grid-template-columns: 1fr;
  }
  .field-row {
    grid-template-columns: 1fr;
  }
}

.doc-wrapper {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.doc-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: #f1f5f9;
  border-bottom: 1px solid var(--border);
}

.doc-status-badge {
  font-size: 12.5px;
  font-weight: 600;
}

.doc-actions {
  display: flex;
  gap: 8px;
}

.paper-sheet {
  position: relative;
  padding: 28px 24px;
  background: #ffffff;
  font-family: 'Times New Roman', Times, serif;
  font-size: 14px;
  line-height: 1.5;
  color: #111827;
  min-height: 520px;
  user-select: none;
}

.paper-sheet.unlocked {
  user-select: text;
}

.watermark-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
  overflow: hidden;
  z-index: 2;
}

.watermark-overlay span {
  transform: rotate(-28deg);
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: rgba(15, 118, 110, 0.14);
  letter-spacing: 2px;
  white-space: nowrap;
}

.doc-national-header {
  text-align: center;
  margin-bottom: 18px;
}

.doc-national-header p {
  margin: 0;
}

.doc-title {
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  margin: 14px 0 4px;
  text-transform: uppercase;
}

.doc-subtitle {
  text-align: center;
  font-style: italic;
  margin: 0 0 14px;
}

.doc-sign-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 28px;
  text-align: center;
}

/* Checkout Panel */
.checkout-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.checkout-panel h3 {
  margin: 0 0 6px;
  font-size: 18px;
}

.checkout-sub {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 14px;
}

.package-list {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.package-card {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  cursor: pointer;
}

.package-card:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.package-card input {
  margin-top: 3px;
  accent-color: var(--primary);
}

.package-card strong {
  display: block;
  font-size: 14px;
}

.package-card span {
  font-size: 12px;
  color: var(--muted);
}

.success-banner {
  background: #dcfce7;
  border: 1px solid #86efac;
  color: #166534;
  padding: 12px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 14px;
}

.checklist {
  padding-left: 18px;
  margin: 8px 0 16px;
  font-size: 13px;
}

.checklist li {
  margin-bottom: 6px;
}

.upsell-box {
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  border-radius: var(--radius);
  padding: 14px;
  font-size: 13px;
}

.upsell-box strong {
  display: block;
  margin-bottom: 6px;
}

.upsell-box p {
  margin: 0 0 10px;
  color: var(--muted);
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: grid;
  place-items: center;
  padding: 16px;
  z-index: 100;
}

.modal-box {
  width: 100%;
  max-width: 400px;
  background: #ffffff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.modal-close {
  border: none;
  background: transparent;
  font-size: 18px;
  cursor: pointer;
}

.modal-body {
  padding: 18px;
}

.qr-placeholder {
  text-align: center;
  margin-bottom: 16px;
}

.qr-mock-box {
  width: 170px;
  height: 170px;
  margin: 0 auto 10px;
  border: 2px dashed var(--primary);
  border-radius: 12px;
  background: var(--primary-soft);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--primary);
}

.qr-mock-box small {
  margin-top: 6px;
  font-size: 16px;
  color: var(--text);
}

.qr-info {
  margin: 4px 0;
  font-size: 13px;
}

.footer {
  border-top: 1px solid var(--border);
  padding: 20px 0 80px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

/* FAQ & Legal Basis */
.faq-section {
  padding: 12px 0 36px;
}

.legal-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.legal-badges span {
  font-size: 12px;
  font-weight: 600;
  background: #ffffff;
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--text);
}

.faq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}

.faq-item strong {
  display: block;
  font-size: 13.5px;
  margin-bottom: 6px;
}

.faq-item p {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
}

/* Mobile Sticky Preview Bar */
.mobile-sticky-cta {
  display: none;
}

@media (max-width: 640px) {
  .container {
    padding: 0 12px;
  }
  .builder-card {
    padding: 14px 12px;
  }
  .fieldset-box {
    padding: 12px 10px;
  }
  .mobile-sticky-cta {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 45;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.97);
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.08);
  }
  .mobile-sticky-cta strong {
    display: block;
    font-size: 13px;
  }
  .mobile-sticky-cta span {
    font-size: 11.5px;
    color: var(--muted);
  }
}

@media print {
  .no-print {
    display: none !important;
  }
  body {
    background: #ffffff;
  }
  .preview-section,
  .container,
  .preview-layout {
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
    max-width: none !important;
  }
  .doc-wrapper {
    border: none !important;
    box-shadow: none !important;
  }
  .paper-sheet {
    padding: 0 !important;
  }
}