/* ===== ABToolz Design System ===== */
:root {
  --bg: #FAFBFF;
  --bg-soft: #F1F0FF;
  --surface: #FFFFFF;
  --primary: #5B6EF5;
  --primary-dark: #4553D6;
  --mint: #2FCBA3;
  --lavender: #E9E6FF;
  --text: #1F2333;
  --text-muted: #6B7280;
  --border: #E7E9F5;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 4px 24px rgba(91, 110, 245, 0.08);
  --shadow-lg: 0 12px 40px rgba(91, 110, 245, 0.14);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: 'Sora', 'Inter', sans-serif;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 251, 255, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  max-width: 1180px;
  margin: 0 auto;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  font-size: 1.25rem;
}

.logo-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--mint));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.95rem;
  font-weight: 800;
  font-style: italic;
  letter-spacing: -0.02em;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.logo-mark::after {
  content: '';
  position: absolute;
  top: -6px;
  right: -6px;
  width: 16px;
  height: 16px;
  background: rgba(255,255,255,0.25);
  border-radius: 4px;
  transform: rotate(20deg);
}

.nav-links {
  display: flex;
  gap: 32px;
  align-items: center;
}

.nav-links a {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--primary); }

.nav-cta {
  background: var(--primary);
  color: white !important;
  padding: 10px 20px;
  border-radius: 100px;
  font-weight: 600;
  transition: background 0.2s, transform 0.2s;
}

.nav-cta:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text);
}

/* ===== Header Search ===== */
.header-search-btn {
  background: var(--lavender);
  border: none;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  font-size: 1rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s;
}
.header-search-btn:hover { background: #DFDBFA; }

.header-search-panel {
  position: absolute;
  top: 100%;
  left: 0; right: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 12px 32px rgba(20,23,40,0.10);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
}
.header-search-panel.open { max-height: 460px; }
.header-search-inner {
  max-width: 700px; margin: 0 auto; padding: 16px 24px 8px;
  display: flex; align-items: center; gap: 10px;
}
.header-search-inner input {
  flex: 1; border: 1px solid #E7E9F5; border-radius: 10px; padding: 10px 14px;
  font-size: 0.95rem; font-family: inherit; outline: none;
}
.header-search-inner input:focus { border-color: var(--primary); }
.header-search-close {
  background: none; border: none; font-size: 1.1rem; cursor: pointer; color: var(--text-muted);
}
.header-search-results {
  max-width: 700px; margin: 0 auto; padding: 0 24px 16px; max-height: 340px; overflow-y: auto;
}
.header-search-results a {
  display: flex; align-items: center; gap: 12px; padding: 10px 8px; color: var(--text, #1F2333);
  text-decoration: none; border-radius: 8px;
}
.header-search-results a:hover { background: var(--lavender); }
.header-search-results .ts-icon { font-size: 1.1rem; }
.header-search-results .ts-empty { padding: 10px 8px; color: var(--text-muted); font-size: 0.9rem; }

/* ===== Hero ===== */
.hero {
  padding: 72px 24px 56px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -120px;
  left: 50%;
  transform: translateX(-50%);
  width: 700px;
  height: 400px;
  background: radial-gradient(ellipse, var(--lavender) 0%, transparent 70%);
  z-index: -1;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--lavender);
  color: var(--primary-dark);
  padding: 6px 16px;
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 20px;
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  max-width: 800px;
  margin: 0 auto 18px;
}

.hero h1 span { color: var(--primary); }

.hero p.subtitle {
  color: var(--text-muted);
  font-size: 1.15rem;
  max-width: 560px;
  margin: 0 auto 40px;
}

/* ===== Live QR Demo (signature element) ===== */
.hero-demo {
  max-width: 620px;
  margin: 0 auto;
  background: var(--surface);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  padding: 28px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
  border: 1px solid var(--border);
}

.hero-demo-input {
  text-align: left;
}

.hero-demo-input label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.hero-demo-input input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  transition: border-color 0.2s;
}

.hero-demo-input input:focus { border-color: var(--primary); outline: none; }

.hero-demo-input .hint { font-size: 0.8rem; color: var(--text-muted); margin-top: 10px; }

.hero-demo-qr {
  width: 120px;
  height: 120px;
  background: white;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
}

.hero-demo-qr img, .hero-demo-qr canvas { width: 100%; height: 100%; }

.trust-badges {
  display: flex;
  justify-content: center;
  gap: 28px;
  flex-wrap: wrap;
  margin-top: 36px;
}

.trust-badges span {
  font-size: 0.88rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}

.trust-badges span::before {
  content: '✓';
  color: var(--mint);
  font-weight: 800;
}

/* ===== Tool Categories ===== */
.section {
  padding: 64px 24px;
}

.section-head {
  text-align: center;
  max-width: 560px;
  margin: 0 auto 48px;
}

.section-head h2 { font-size: clamp(1.7rem, 3vw, 2.2rem); margin-bottom: 12px; }
.section-head p { color: var(--text-muted); }

.category-block { margin-bottom: 56px; }

.category-label {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
}

.category-label .dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--primary);
}

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

.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tool-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--primary);
}

.tool-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--lavender);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}

.tool-card h3 { font-size: 1.02rem; font-weight: 600; font-family: 'Inter', sans-serif; }
.tool-card p { font-size: 0.85rem; color: var(--text-muted); }

.tool-card.coming-soon {
  cursor: default;
  opacity: 0.6;
  position: relative;
}
.tool-card.coming-soon:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--border);
}
.tool-card.coming-soon .soon-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--bg-soft);
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 3px 8px;
  border-radius: 20px;
}

/* ===== Footer ===== */
.site-footer {
  background: var(--bg-soft);
  padding: 56px 24px 28px;
  margin-top: 40px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 32px;
  max-width: 1180px;
  margin: 0 auto;
}

.footer-col h4 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 16px;
  font-family: 'Inter', sans-serif;
}

.footer-col ul li { margin-bottom: 10px; }
.footer-col ul li a { font-size: 0.92rem; color: var(--text); transition: color 0.2s; }
.footer-col ul li a:hover { color: var(--primary); }

.footer-bottom {
  max-width: 1180px;
  margin: 40px auto 0;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ===== Tool Page Layout ===== */
.tool-page {
  padding: 48px 24px 80px;
  max-width: 900px;
  margin: 0 auto;
}

.tool-header { text-align: center; margin-bottom: 36px; }
.tool-header h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); margin-bottom: 10px; }
.tool-header p { color: var(--text-muted); max-width: 520px; margin: 0 auto; }

.tool-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 36px;
  box-shadow: var(--shadow);
}

.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.dropzone:hover, .dropzone.drag-over {
  border-color: var(--primary);
  background: var(--lavender);
}

.dropzone-icon { font-size: 2.2rem; margin-bottom: 12px; }
.dropzone p { color: var(--text-muted); font-size: 0.92rem; }
.dropzone .dz-title { font-weight: 600; color: var(--text); margin-bottom: 6px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--primary);
  color: white;
  border: none;
  padding: 13px 26px;
  border-radius: 100px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  font-family: inherit;
}

.btn:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn:disabled { background: var(--border); color: var(--text-muted); cursor: not-allowed; transform: none; }

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}
.btn-outline:hover { background: var(--lavender); }

.btn-group { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 24px; }

.form-row { margin-bottom: 20px; }
.form-row label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 8px;
}
.form-row input[type=text],
.form-row input[type=number],
.form-row input[type=password],
.form-row input[type=email],
.form-row input[type=tel],
.form-row textarea,
.form-row select {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text);
  background: white;
}
.form-row input:focus, .form-row textarea:focus, .form-row select:focus {
  outline: none;
  border-color: var(--primary);
}
.form-row textarea { resize: vertical; min-height: 120px; }

.tab-group {
  display: flex;
  gap: 8px;
  background: var(--bg-soft);
  padding: 6px;
  border-radius: 100px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.tab-btn {
  flex: 1;
  min-width: fit-content;
  padding: 10px 18px;
  border-radius: 100px;
  border: none;
  background: transparent;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.tab-btn.active { background: var(--surface); color: var(--primary); box-shadow: 0 2px 8px rgba(0,0,0,0.06); }

.result-box {
  margin-top: 28px;
  padding: 24px;
  background: var(--bg-soft);
  border-radius: var(--radius);
  text-align: center;
}

.result-box canvas, .result-box img { margin: 0 auto 20px; border-radius: 8px; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.stat-box {
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
}

.stat-box .num { font-family: 'Sora', sans-serif; font-size: 1.6rem; font-weight: 700; color: var(--primary); }
.stat-box .label { font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; }

.related-tools {
  margin-top: 48px;
}
.related-tools h3 { font-size: 1.1rem; margin-bottom: 16px; }

.info-block {
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}
.info-block h2 { font-size: 1.3rem; margin-bottom: 14px; }
.info-block p { color: var(--text-muted); margin-bottom: 12px; }

/* ===== Mobile ===== */
@media (max-width: 860px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 880px) {
  .nav-links { display: none; }
  .mobile-toggle { display: block; }
  .hero-demo { grid-template-columns: 1fr; }
  .hero-demo-qr { margin: 0 auto; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .tool-panel { padding: 22px; }
}

.page-fade { animation: fadeUp 0.5s ease both; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Global Tool Search ===== */
.tool-search-wrap { max-width: 650px; margin: 28px auto 0; position: relative; }
.tool-search-box {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1.5px solid #E7E9F5; border-radius: 16px;
  padding: 0 22px; height: 60px; box-shadow: 0 6px 20px rgba(20,23,40,0.06);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.tool-search-box:focus-within { border-color: var(--primary); box-shadow: 0 6px 24px rgba(108,92,231,0.14); }
.tool-search-box input {
  flex: 1; border: none; outline: none; font-size: 1.05rem; font-family: inherit; background: transparent; height: 100%;
}
.tool-search-box .search-icon { font-size: 1.25rem; color: var(--text-muted); flex-shrink: 0; }
.tool-search-results {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  background: var(--surface); border: 1px solid #E7E9F5; border-radius: 14px;
  box-shadow: 0 12px 32px rgba(20,23,40,0.12); max-height: 340px; overflow-y: auto;
  z-index: 50; display: none; text-align: left;
}
.tool-search-results.open { display: block; }
.tool-search-results a {
  display: flex; align-items: center; gap: 12px; padding: 12px 18px; color: var(--text, #1F2333);
  text-decoration: none; border-bottom: 1px solid #F1F2FA;
}
.tool-search-results a:last-child { border-bottom: none; }
.tool-search-results a:hover { background: var(--lavender); }
.tool-search-results .ts-icon { font-size: 1.2rem; }
.tool-search-results .ts-empty { padding: 16px 18px; color: var(--text-muted); font-size: 0.9rem; }

.search-shortcuts {
  max-width: 650px; margin: 16px auto 0; display: flex; justify-content: center;
  gap: 10px; flex-wrap: wrap;
}
.search-shortcuts a {
  font-size: 0.82rem; color: var(--text-muted); background: var(--surface);
  border: 1px solid #E7E9F5; border-radius: 999px; padding: 7px 16px;
  text-decoration: none; transition: all 0.2s;
}
.search-shortcuts a:hover { color: var(--primary); border-color: var(--primary); background: var(--lavender); }

@media (max-width: 600px) {
  .tool-search-wrap { margin: 20px 16px 0; max-width: none; }
  .tool-search-box { height: 56px; padding: 0 16px; border-radius: 14px; }
  .search-shortcuts { margin: 14px 16px 0; }
}

.bg-swatch {
  width: 40px; height: 40px; border-radius: 10px; cursor: pointer;
  border: 2px solid #E7E9F5; background-size: cover; padding: 0;
  transition: transform 0.15s, border-color 0.15s;
}
.bg-swatch:hover { transform: scale(1.08); }
.bg-swatch.active { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(108,92,231,0.25); }

/* ===== Compact secondary QR demo ===== */
.qr-demo-card {
  max-width: 340px; margin: 0 auto; text-align: center;
  background: var(--surface); border: 1px solid #EEF0FA; border-radius: 18px;
  padding: 24px 22px 26px; box-shadow: 0 4px 16px rgba(20,23,40,0.05);
}
.qr-demo-eyebrow {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--primary); margin-bottom: 6px;
}
.qr-demo-card h3 { font-family: 'Sora', sans-serif; font-size: 1.1rem; margin-bottom: 4px; }
.qr-demo-hint { color: var(--text-muted); font-size: 0.82rem; margin-bottom: 14px; }
.qr-demo-card input {
  width: 100%; padding: 10px 14px; border: 1.5px solid var(--border, #E7E9F5);
  border-radius: 10px; font-size: 0.9rem; font-family: inherit; margin-bottom: 16px; text-align: center;
}
.qr-demo-card input:focus { border-color: var(--primary); outline: none; }
.qr-demo-box {
  width: 280px; height: 280px; max-width: 100%; margin: 0 auto;
  background: #fff; border-radius: 12px; border: 1px solid var(--border, #E7E9F5);
  display: flex; align-items: center; justify-content: center;
}
.qr-demo-box img, .qr-demo-box canvas { width: 100%; height: 100%; }

@media (max-width: 860px) {
  .qr-demo-box { width: 240px; height: 240px; }
}
@media (max-width: 480px) {
  .qr-demo-box { width: 200px; height: 200px; }
}

/* ===== Feature / Why Choose grid ===== */
.feature-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; max-width: 1180px; margin: 0 auto;
}
.feature-card {
  background: var(--surface); border: 1px solid #EEF0FA; border-radius: 16px; padding: 26px 22px;
  box-shadow: 0 2px 10px rgba(20,23,40,0.04);
}
.feature-card .f-icon {
  width: 44px; height: 44px; border-radius: 12px; background: var(--lavender);
  display: flex; align-items: center; justify-content: center; font-size: 1.3rem; margin-bottom: 14px;
}
.feature-card h3 { font-family: 'Sora', sans-serif; font-size: 1.02rem; margin-bottom: 6px; }
.feature-card p { color: var(--text-muted); font-size: 0.88rem; line-height: 1.5; }

/* ===== How It Works steps ===== */
.steps-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; max-width: 1000px; margin: 0 auto;
}
.step-card { text-align: center; padding: 10px; }
.step-num {
  width: 40px; height: 40px; border-radius: 50%; background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center; font-family: 'Sora', sans-serif;
  font-weight: 700; margin: 0 auto 14px;
}
.step-card h3 { font-family: 'Sora', sans-serif; font-size: 1rem; margin-bottom: 6px; }
.step-card p { color: var(--text-muted); font-size: 0.88rem; }

/* ===== FAQ accordion ===== */
.faq-list { max-width: 780px; margin: 0 auto; }
.faq-item { border-bottom: 1px solid #EAEBF5; }
.faq-q {
  width: 100%; text-align: left; background: none; border: none; cursor: pointer;
  padding: 18px 4px; font-family: 'Sora', sans-serif; font-weight: 600; font-size: 0.98rem;
  display: flex; justify-content: space-between; align-items: center; color: inherit;
}
.faq-q .plus { transition: transform 0.2s; color: var(--primary); font-size: 1.2rem; }
.faq-item.open .plus { transform: rotate(45deg); }
.faq-a {
  max-height: 0; overflow: hidden; transition: max-height 0.25s ease;
  color: var(--text-muted); font-size: 0.92rem; line-height: 1.6;
}
.faq-item.open .faq-a { max-height: 300px; padding-bottom: 18px; }

/* ===== Final CTA ===== */
.final-cta {
  max-width: 1180px; margin: 0 auto 64px; border-radius: 24px; padding: 56px 32px; text-align: center;
  background: linear-gradient(135deg, var(--primary), var(--mint)); color: #fff;
}
.final-cta h2 { font-family: 'Sora', sans-serif; font-size: 1.8rem; margin-bottom: 10px; color: #fff; }
.final-cta p { color: rgba(255,255,255,0.9); margin-bottom: 22px; }
.final-cta .btn { background: #fff; color: var(--primary-dark); }
.final-cta .btn:hover { background: rgba(255,255,255,0.9); }

@media (max-width: 860px) {
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .steps-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .feature-grid { grid-template-columns: 1fr; }
}
