:root {
  --primary: #315eff;
  --primary-dark: #224bcc;
  --accent: #315eff;
  --accent-hover: #224bcc;
  --accent-light: rgba(49, 94, 255, 0.10);
  --accent-border: rgba(49, 94, 255, 0.25);
  --ink: #0f2438;
  --muted: #627389;
  --surface: #ffffff;
  --surface-2: #f5f7fa;
  --line: #dce3ed;
  --radius: 16px;
  --container: 1200px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Onest", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--surface);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

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

img {
  max-width: 100%;
}

h1,
h2,
h3 {
  font-family: "Onest", "Inter", system-ui, sans-serif;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

/* ─── Container ─── */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 40px;
}

@media (max-width: 768px) {
  .container {
    padding: 0 20px;
  }
}

/* ─── Header ─── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(220, 227, 237, 0.7);
}

.site-nav {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 14px;
  padding-bottom: 14px;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--primary);
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--primary);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  overflow: hidden;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.site-nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
}

.nav-link {
  color: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.15s ease;
}

.nav-link:hover {
  color: var(--ink);
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown-trigger {
  background: none;
  border: none;
  font: inherit;
  cursor: pointer;
  color: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.nav-dropdown-trigger i {
  font-size: 0.7rem;
}

.nav-dropdown-menu {
  position: absolute;
  left: 0;
  top: 100%;
  margin-top: 10px;
  min-width: 260px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 8px;
  z-index: 50;
}

.nav-dropdown-label {
  padding: 8px 12px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 700;
  color: var(--muted);
}

.nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 0.9rem;
  color: #334155;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-dropdown-item i {
  color: var(--accent);
}

.nav-dropdown-item:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.nav-dropdown-divider {
  margin: 6px 0;
  border-top: 1px solid var(--line);
}

.site-nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-btn {
  padding: 10px 20px;
  font-size: 0.85rem;
}

.mobile-menu {
  position: absolute;
  top: 100%;
  right: 20px;
  left: 20px;
  margin-top: 10px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  z-index: 60;
}

.mobile-menu a {
  display: block;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
  transition: background 0.15s ease;
}

.mobile-menu a:hover {
  background: var(--surface-2);
}

.mobile-menu-section {
  padding: 8px 12px 4px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 700;
  color: var(--muted);
}

.mobile-menu-divider {
  height: 1px;
  background: var(--line);
  margin: 10px 6px;
}

@media (max-width: 980px) {
  .site-nav-links {
    display: none;
  }

  .site-nav-actions .btn-outline {
    display: none;
  }
}

@media (max-width: 640px) {
  .site-nav {
    padding: 14px 0;
  }

  .site-nav-actions .btn-primary {
    padding: 10px 16px;
    font-size: 0.8rem;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .site-header {
    background: #ffffff;
    backdrop-filter: none;
  }
}

.hidden {
  display: none !important;
}

/* ─── Section Block ─── */
.section {
  padding: 80px 0;
}

.section--alt {
  background: var(--surface-2);
}

.section--hero {
  padding: 100px 0 80px;
  background: linear-gradient(180deg, #eaf2f7 0%, #ffffff 100%);
}

.section--dark {
  background: var(--primary-dark);
  color: #ffffff;
}

@media (max-width: 768px) {
  .section {
    padding: 48px 0;
  }

  .section--hero {
    padding: 60px 0 48px;
  }
}

.section__header {
  margin-bottom: 48px;
}

.section__label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border-radius: 999px;
  background: var(--accent-light);
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--accent);
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.section__title {
  font-size: 2rem;
  color: var(--ink);
  font-weight: bold;
}

.section__desc {
  font-size: 1rem;
  color: var(--muted);
  line-height: 1.7;
  margin-top: 10px;
  max-width: 640px;
}

/* ─── Panel / Card ─── */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.panel:hover {
  transform: translateY(-4px);
  border-color: var(--accent-border);
}

/* ─── Buttons ─── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #ffffff;
  border: none;
  padding: 14px 28px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 10px 18px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-secondary:hover {
  background: #eef1f5;
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--line);
  padding: 12px 24px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.btn-outline:hover {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent);
}

/* ─── Mode Pill ─── */
.mode-pill {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 16px;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--muted);
  cursor: pointer;
  background: transparent;
  transition: all 0.15s ease;
}

.mode-pill.active {
  background: var(--accent-light);
  color: var(--accent);
  border-color: var(--accent-border);
}

/* ─── Toggle ─── */
.toggle {
  width: 46px;
  height: 26px;
  border-radius: 999px;
  background: #d1d5db;
  position: relative;
  transition: background 0.2s ease;
}

.toggle input {
  opacity: 0;
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  cursor: pointer;
}

.toggle .dot {
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 999px;
  position: absolute;
  top: 3px;
  left: 4px;
  transition: transform 0.2s ease;
}

.toggle input:checked+.dot {
  transform: translateX(18px);
}

.toggle.active {
  background: var(--accent);
}

/* ─── Dropzone ─── */
.dropzone {
  border: 2px dashed #c8d2de;
  border-radius: var(--radius);
  padding: 48px;
  text-align: center;
  background: var(--surface-2);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.dropzone.dragover {
  border-color: var(--accent);
  background: var(--accent-light);
}

/* ─── Preview ─── */
.preview-frame {
  position: relative;
  width: 100%;
  background: #111827;
  border-radius: 0 !important;
  overflow: hidden;
}

#pdfCanvas {
  width: 100%;
  display: block;
}

#cropBox {
  position: absolute;
  border: 2px dotted var(--accent);
  border-radius: 0;
  cursor: grab;
  touch-action: none;
}

#cropBox:active {
  cursor: grabbing;
}

/* ─── Resize Handles ─── */
.resize-handle {
  position: absolute;
  width: 12px;
  height: 12px;
  background: var(--accent);
  border: 2px solid #ffffff;
  z-index: 2;
}

.resize-handle.tl {
  top: -7px;
  left: -7px;
  cursor: nwse-resize;
}

.resize-handle.tr {
  top: -7px;
  right: -7px;
  cursor: nesw-resize;
}

.resize-handle.bl {
  bottom: -7px;
  left: -7px;
  cursor: nesw-resize;
}

.resize-handle.br {
  bottom: -7px;
  right: -7px;
  cursor: nwse-resize;
}

.resize-handle.tm {
  top: -7px;
  left: 50%;
  transform: translateX(-50%);
  cursor: ns-resize;
}

.resize-handle.bm {
  bottom: -7px;
  left: 50%;
  transform: translateX(-50%);
  cursor: ns-resize;
}

.resize-handle.ml {
  left: -7px;
  top: 50%;
  transform: translateY(-50%);
  cursor: ew-resize;
}

.resize-handle.mr {
  right: -7px;
  top: 50%;
  transform: translateY(-50%);
  cursor: ew-resize;
}

/* ─── Badge ─── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 999px;
  background: var(--accent-light);
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--accent);
}

/* ─── Back Circle ─── */
.back-circle {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.back-circle:hover {
  transform: translateY(-1px);
}

.back-circle svg {
  width: 18px;
  height: 18px;
}

/* ─── Input ─── */
.input {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  width: 100%;
  font-weight: 500;
  font-size: 0.875rem;
  transition: border-color 0.15s ease;
  outline: none;
}

.input:focus {
  border-color: var(--accent);
}

/* ─── Small Text ─── */
.small-text {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.6;
}

/* ─── Feature Row ─── */
.feature-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.feature-row__item {
  text-align: center;
  padding: 36px 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: all 0.3s ease;
}

.feature-row__item:hover {
  transform: translateY(-4px);
  border-color: var(--accent-border);
}

.feature-row__icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--accent-light);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin: 0 auto 18px;
}

.feature-row__title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.feature-row__desc {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.6;
}

@media (max-width: 768px) {
  .feature-row {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* ─── Stats Row ─── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  text-align: center;
}

.stats-row__item {
  padding: 32px 20px;
}

.stats-row__number {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 8px;
}

.stats-row__label {
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 500;
}

@media (max-width: 768px) {
  .stats-row {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* ─── Steps Row ─── */
.steps-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  counter-reset: step;
}

.steps-row__item {
  counter-increment: step;
  padding: 32px 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  position: relative;
  transition: all 0.3s ease;
}

.steps-row__item:hover {
  transform: translateY(-4px);
}

.steps-row__item::before {
  content: counter(step);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 800;
  font-size: 1rem;
  margin-bottom: 18px;
  border: 2px solid var(--accent-border);
}

.steps-row__title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.steps-row__desc {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.6;
}

@media (max-width: 768px) {
  .steps-row {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* ─── Split Row (2 col) ─── */
.split-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

@media (max-width: 768px) {
  .split-row {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

/* ─── FAQ ─── */
.faq-item {
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}

.faq-item:last-child {
  border-bottom: none;
}

.faq-item__q {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--ink);
}

.faq-item__a {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.7;
}

/* ─── Tool Cards ─── */
.tool-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

@media (max-width: 768px) {
  .tool-cards {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* ─── CTA Banner ─── */
.cta-banner {
  background: var(--primary);
  border-radius: var(--radius);
  padding: 56px 48px;
  text-align: center;
  color: #fff;
}

.cta-banner h2 {
  font-size: 1.75rem;
  color: #fff;
}

.cta-banner p {
  color: rgba(255, 255, 255, 0.75);
  margin-top: 10px;
  font-size: 1rem;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.cta-banner .btn-outline {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.35);
  margin-top: 24px;
}

.cta-banner .btn-outline:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.6);
  color: #fff;
}

.cta-banner .btn-primary {
  background: #ffffff;
  color: var(--primary);
  margin-top: 24px;
}

.cta-banner .btn-primary:hover {
  background: #f0f4f8;
  color: var(--primary);
}

@media (max-width: 768px) {
  .cta-banner {
    padding: 36px 24px;
  }
}

/* ─── Dark Footer ─── */
.site-footer {
  background: var(--primary-dark);
  padding: 56px 0 0;
  color: rgba(255, 255, 255, 0.85);
}

.site-footer a {
  color: rgba(255, 255, 255, 0.65);
  transition: color 0.15s;
}

.site-footer a:hover {
  color: #ffffff;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.8fr 1fr 1fr 1fr;
  gap: 40px;
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 28px;
  }
}

@media (max-width: 480px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

.footer-brand {
  font-weight: 700;
  font-size: 1.05rem;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.footer-desc {
  margin-top: 14px;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.6;
  max-width: 280px;
}

.footer-heading {
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 16px;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: 10px;
}

.footer-links a {
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.55);
}

.footer-links a:hover {
  color: #ffffff;
}

.footer-bottom {
  margin-top: 40px;
  padding: 20px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-copy {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.4);
}

/* ─── Hero Grid ─── */
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}

.hero-grid__text {
  text-align: left;
}

.hero-grid__visual {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 40px;
    text-align: center;
  }

  .hero-grid__text {
    text-align: center;
  }
}

/* ─── Popup System ─── */
.popup-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(11, 42, 60, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 60;
}

.popup-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.popup-card {
  width: min(420px, 100%);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
}

.popup-card.success {
  border-color: rgba(34, 197, 94, 0.4);
}

.popup-card.error {
  border-color: rgba(239, 68, 68, 0.45);
}

.popup-header {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.popup-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #ffffff;
  background: var(--accent);
  flex-shrink: 0;
}

.popup-card.success .popup-icon {
  background: #22c55e;
}

.popup-card.error .popup-icon {
  background: #ef4444;
}

.popup-title {
  font-weight: 700;
  font-size: 1rem;
}

.popup-message {
  color: var(--muted);
  font-size: 0.875rem;
  margin-top: 4px;
  line-height: 1.5;
}

.popup-footer {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.popup-countdown {
  font-size: 0.85rem;
  color: var(--muted);
}

.popup-close {
  padding: 8px 14px;
  font-size: 0.85rem;
}

/* ─── Animations ─── */
.fade-in {
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float {
  0% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-15px);
  }

  100% {
    transform: translateY(0px);
  }
}

/* ─── Mobile Nav ─── */
.mobile-menu-btn {
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px 10px;
  cursor: pointer;
  color: var(--ink);
}

.mobile-menu-btn svg {
  width: 22px;
  height: 22px;
  display: block;
}

@media (max-width: 980px) {
  .mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

.mobile-nav {
  display: none;
  position: absolute;
  top: 100%;
  right: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 0;
  z-index: 50;
  min-width: 160px;
}

.mobile-nav.open {
  display: block;
}

.mobile-nav a {
  display: block;
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink);
  transition: background 0.15s ease;
}

.mobile-nav a:hover {
  background: var(--surface-2);
}

/* ─── Tool Icon ─── */
.tool-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--accent-light);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 16px;
}

/* ─── Page Hero (for supporting pages) ─── */
.page-hero {
  padding: 48px 0 40px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}

.page-hero h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  margin-bottom: 8px;
}

.page-hero p {
  font-size: 1.05rem;
  color: var(--muted);
  line-height: 1.7;
  max-width: 560px;
}

/* ─── Content Section (for about/contact/privacy/terms) ─── */
.content-section {
  padding: 48px 0 64px;
}

.content-section h3 {
  font-weight: 700;
  color: var(--ink);
  margin: 28px 0 10px 0;
  font-size: 1.1rem;
}

.content-section p {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 14px;
  max-width: 720px;
}