:root {
  --bg: #f7f3ea;
  --surface: #fffcf5;
  --surface-2: #eef7f3;
  --text: #14211d;
  --muted: #69756f;
  --line: #e7ded0;
  --primary: #0f766e;
  --primary-dark: #0b534d;
  --accent: #f97316;
  --danger: #dc2626;
  --warning: #c2410c;
  --shadow: 0 24px 70px rgba(20, 33, 29, 0.11);
  --radius: 24px;
}

* { 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(--text);
  background:
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.16), transparent 32rem),
    radial-gradient(circle at top right, rgba(249, 115, 22, 0.13), transparent 28rem),
    var(--bg);
  line-height: 1.55;
}

img, svg, canvas { max-width: 100%; }

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

button, input, textarea, select { font: inherit; }

button { cursor: pointer; }

.container {
  width: min(1160px, calc(100% - 32px));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  top: -60px;
  left: 16px;
  z-index: 999;
  background: var(--text);
  color: #fff;
  padding: 10px 14px;
  border-radius: 10px;
}

.skip-link:focus { top: 16px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(16px);
  background: rgba(247, 243, 234, 0.86);
  border-bottom: 1px solid rgba(231, 222, 208, 0.82);
}

.nav {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 850;
  letter-spacing: -0.03em;
  font-size: 1.08rem;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background:
    linear-gradient(135deg, #14211d 0 50%, #0f766e 50% 100%);
  box-shadow: 0 10px 28px rgba(15, 118, 110, 0.26);
  position: relative;
}

.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  background: var(--surface);
  border-radius: 3px;
}

.brand-mark::before { width: 8px; height: 8px; left: 8px; top: 8px; box-shadow: 12px 0 0 #fff, 0 12px 0 #fff; }
.brand-mark::after { width: 7px; height: 7px; right: 8px; bottom: 8px; box-shadow: -10px 0 0 rgba(255,255,255,.8), 0 -10px 0 rgba(255,255,255,.8); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
  color: var(--muted);
  font-weight: 650;
  font-size: 0.94rem;
}

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

.hero {
  padding: 58px 0 42px;
}

.hero-copy {
  max-width: 840px;
  margin-bottom: 32px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 10px;
  color: var(--primary);
  text-transform: uppercase;
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.12em;
}

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

h1 {
  font-size: clamp(2.35rem, 6vw, 5.25rem);
  line-height: 0.96;
  letter-spacing: -0.075em;
  max-width: 980px;
  margin-bottom: 20px;
}

.hero-text {
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.25rem);
  max-width: 790px;
  margin-bottom: 22px;
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.trust-row span,
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 252, 245, 0.88);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #41514a;
  padding: 8px 12px;
  font-size: 0.88rem;
  font-weight: 700;
}

.trust-row span::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.generator-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  align-items: stretch;
}

.panel {
  background: rgba(255, 252, 245, 0.94);
  border: 1px solid rgba(231, 222, 208, 0.95);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.form-panel,
.preview-panel {
  padding: 22px;
  height: 100%;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.panel-heading h2,
.section-header h2,
.split-section h2 {
  font-size: clamp(1.55rem, 3vw, 2.35rem);
  line-height: 1.05;
  letter-spacing: -0.045em;
  margin-bottom: 0;
}

.preview-heading { margin-bottom: 12px; }

.preview-ad-slot {
  color: var(--muted);
  font-size: 0.72rem;
  text-align: center;
  margin-top: auto;
  padding-top: 16px;
}

.preview-ad-box {
  min-height: 90px;
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.07), rgba(249, 115, 22, 0.06)),
    rgba(255, 252, 245, 0.82);
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 15px;
}

.field span,
.field label {
  color: #41514a;
  font-size: 0.9rem;
  font-weight: 750;
}

input[type="text"],
input[type="url"],
input[type="email"],
input[type="tel"],
input[type="datetime-local"],
textarea,
select {
  width: 100%;
  border: 1px solid #d8cec0;
  background: var(--surface);
  color: var(--text);
  border-radius: 14px;
  min-height: 48px;
  padding: 12px 14px;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}

textarea { min-height: 104px; resize: vertical; }

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(15, 118, 110, 0.72);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.13);
}

input[type="color"] {
  width: 100%;
  height: 48px;
  border: 1px solid #d8cec0;
  border-radius: 14px;
  background: var(--surface);
  padding: 5px;
}

input[type="range"] { width: 100%; accent-color: var(--primary); }

small { color: var(--muted); }

.dynamic-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 14px;
}

.dynamic-fields .wide { grid-column: 1 / -1; }

.settings-block {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff8ec;
  margin-top: 14px;
  overflow: hidden;
}

.settings-block summary {
  padding: 15px 16px;
  font-weight: 850;
  cursor: pointer;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 14px;
  padding: 0 16px 16px;
}

.settings-grid .wide { grid-column: 1 / -1; }

.compact { margin-bottom: 10px; }

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding-top: 25px;
}

.checkbox-field input { width: 18px; height: 18px; accent-color: var(--primary); }

.file-field input { padding: 12px; border: 1px dashed #cbbdaa; border-radius: 14px; background: var(--surface); }

.link-button {
  border: 0;
  color: var(--primary);
  background: transparent;
  font-weight: 800;
  margin: 0 16px 16px;
  padding: 0;
}

.preview-panel {
  position: sticky;
  top: 92px;
  display: flex;
  flex-direction: column;
}

.status-dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #cfc7b9;
  margin-top: 8px;
  box-shadow: 0 0 0 6px rgba(207, 199, 185, 0.24);
}

.status-dot.ready { background: var(--primary); box-shadow: 0 0 0 6px rgba(15, 118, 110, 0.18); }
.status-dot.warn { background: var(--warning); box-shadow: 0 0 0 6px rgba(194, 65, 12, 0.16); }
.status-dot.error { background: var(--danger); box-shadow: 0 0 0 6px rgba(220, 38, 38, 0.14); }

.preview-card {
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #fffdf8, #f4eee3);
  border-radius: 22px;
  min-height: 390px;
  padding: 26px;
  margin-bottom: 16px;
}

.qr-preview {
  width: min(320px, 100%);
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  overflow: visible;
}

.qr-preview > div {
  width: 100% !important;
  height: 100% !important;
  max-width: 320px;
  max-height: 320px;
  display: grid !important;
  place-items: center !important;
}

.qr-preview canvas,
.qr-preview svg {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: 320px;
  max-height: 320px;
  object-fit: contain;
  border-radius: 14px;
}

.empty-preview {
  display: grid;
  place-items: center;
  text-align: center;
  gap: 8px;
  color: var(--muted);
  min-height: 300px;
  border: 1px dashed #cfc7b9;
  border-radius: 20px;
  padding: 24px;
}

.empty-preview strong { color: var(--text); }

.preview-label {
  margin: 10px 0 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 900;
  color: var(--text);
}

.scan-report {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.scan-report div {
  background: var(--surface-2);
  border-radius: 16px;
  padding: 12px;
}

.scan-report span {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.scan-report strong { font-size: 0.93rem; }

.message {
  min-height: 24px;
  color: var(--muted);
  font-size: 0.92rem;
  margin-bottom: 14px;
}

.message.error { color: var(--danger); font-weight: 750; }
.message.good { color: #0f766e; font-weight: 750; }
.message.warn { color: var(--warning); font-weight: 750; }

.download-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 8px;
}

.primary-button,
.secondary-button,
.ghost-button {
  border: 0;
  min-height: 46px;
  padding: 11px 14px;
  border-radius: 14px;
  font-weight: 850;
  transition: transform .18s ease, opacity .18s ease, box-shadow .18s ease;
}

.primary-button:hover:not(:disabled),
.secondary-button:hover:not(:disabled),
.ghost-button:hover:not(:disabled) { transform: translateY(-1px); }

.primary-button {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 14px 30px rgba(15, 118, 110, 0.25);
}

.secondary-button {
  background: #14211d;
  color: #fff;
}

.ghost-button {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
}

button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.ad-wrap {
  padding: 12px 0 4px;
  color: var(--muted);
  font-size: 0.75rem;
  text-align: center;
}

.ad-box {
  margin-top: 8px;
  min-height: 96px;
  border: 1px dashed #d8cec0;
  border-radius: 18px;
  background: rgba(255, 252, 245, 0.72);
}

.ad-box.slim { min-height: 74px; }

.section { padding: 70px 0; }

.section-header {
  max-width: 780px;
  margin-bottom: 26px;
}

.section-header p { color: var(--muted); font-size: 1.06rem; }

.compact-header { max-width: 640px; }

.feature-grid,
.use-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.feature-card,
.use-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 20px;
  box-shadow: 0 14px 36px rgba(20, 33, 29, 0.06);
}

.feature-card h3 { margin-bottom: 8px; letter-spacing: -0.02em; }
.feature-card p { color: var(--muted); margin-bottom: 0; }

.soft-section {
  background: #14211d;
  color: #fff;
}

.soft-section .section-kicker { color: #fed7aa; }
.soft-section .use-card {
  color: #fff;
  text-align: left;
  min-height: 92px;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.13);
  font-weight: 850;
}
.soft-section .use-card:hover { background: rgba(255, 255, 255, 0.14); }

.split-section {
  display: grid;
  grid-template-columns: .82fr 1.18fr;
  gap: 40px;
  align-items: start;
}

.tips-list {
  display: grid;
  gap: 12px;
}

.tips-list p {
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  margin: 0;
  color: var(--muted);
}

.tips-list strong { color: var(--text); }

.faq-list {
  display: grid;
  gap: 12px;
}

.faq-list details {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px 20px;
}

.faq-list summary {
  font-weight: 850;
  cursor: pointer;
}

.faq-list p { color: var(--muted); margin: 12px 0 0; }

.site-footer {
  padding: 44px 0;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.footer-grid {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  align-items: flex-start;
}

.footer-grid p { max-width: 520px; color: var(--muted); margin: 12px 0 0; }
.footer-links { display: flex; flex-wrap: wrap; gap: 16px; color: var(--muted); font-weight: 700; }
.footer-links a:hover { color: var(--primary); }

.legal-main { padding: 58px 0 82px; }
.legal-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(24px, 5vw, 54px);
  max-width: 900px;
}
.legal-card h1 { font-size: clamp(2rem, 5vw, 3.75rem); }
.legal-card h2 { margin-top: 30px; letter-spacing: -0.03em; }
.legal-card p, .legal-card li { color: var(--muted); }
.legal-card a { color: var(--primary); font-weight: 750; }

@media (max-width: 980px) {
  .generator-grid,
  .split-section { grid-template-columns: 1fr; }
  .preview-panel { position: static; }
  .feature-grid,
  .use-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .nav-links { display: none; }
  .hero { padding-top: 38px; }
  .form-panel, .preview-panel { padding: 16px; }
  .dynamic-fields,
  .settings-grid,
  .download-grid,
  .feature-grid,
  .use-grid,
  .scan-report { grid-template-columns: 1fr; }
  .checkbox-field { padding-top: 0; }
  .preview-card { min-height: 320px; padding: 16px; }
  .footer-grid { flex-direction: column; }
}

/* v5 premium hero, language toggle, and dark mode */
html[data-theme="dark"] {
  --bg: #0b1110;
  --surface: #121c1a;
  --surface-2: #172522;
  --text: #f4fbf8;
  --muted: #a9b9b3;
  --line: #28413b;
  --primary: #2dd4bf;
  --primary-dark: #0f766e;
  --accent: #fb923c;
  --shadow: 0 26px 80px rgba(0, 0, 0, 0.34);
}

html[data-theme="dark"] body {
  background:
    radial-gradient(circle at top left, rgba(45, 212, 191, 0.18), transparent 32rem),
    radial-gradient(circle at top right, rgba(251, 146, 60, 0.13), transparent 28rem),
    linear-gradient(180deg, #0b1110 0%, #101815 100%);
}

html[data-theme="dark"] .site-header {
  background: rgba(11, 17, 16, 0.82);
  border-bottom-color: rgba(40, 65, 59, 0.78);
}

html[data-theme="dark"] .panel,
html[data-theme="dark"] .feature-card,
html[data-theme="dark"] .faq-list details,
html[data-theme="dark"] .tips-list p,
html[data-theme="dark"] .legal-card,
html[data-theme="dark"] .site-footer {
  background: rgba(18, 28, 26, 0.92);
  border-color: var(--line);
}

html[data-theme="dark"] input[type="text"],
html[data-theme="dark"] input[type="url"],
html[data-theme="dark"] input[type="email"],
html[data-theme="dark"] input[type="tel"],
html[data-theme="dark"] input[type="datetime-local"],
html[data-theme="dark"] textarea,
html[data-theme="dark"] select,
html[data-theme="dark"] input[type="color"],
html[data-theme="dark"] .ghost-button,
html[data-theme="dark"] .trust-row span,
html[data-theme="dark"] .badge {
  background: #0f1715;
  border-color: #31524a;
  color: var(--text);
}

html[data-theme="dark"] .settings-block {
  background: rgba(23, 37, 34, 0.8);
  border-color: var(--line);
}

html[data-theme="dark"] .preview-card {
  background: linear-gradient(180deg, #101916, #0c1311);
  border-color: var(--line);
}

html[data-theme="dark"] .ad-box,
html[data-theme="dark"] .preview-ad-box {
  background: rgba(18, 28, 26, 0.72);
  border-color: #31524a;
}

html[data-theme="dark"] .secondary-button { background: #f4fbf8; color: #0b1110; }
html[data-theme="dark"] .soft-section { background: #07100e; }
html[data-theme="dark"] .empty-preview { border-color: #31524a; }
html[data-theme="dark"] .field span,
html[data-theme="dark"] .field label { color: #d0ddd8; }
html[data-theme="dark"] .feature-card h3,
html[data-theme="dark"] .tips-list strong,
html[data-theme="dark"] .empty-preview strong { color: var(--text); }

.nav-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

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

.utility-button {
  min-height: 40px;
  border: 1px solid var(--line);
  background: rgba(255, 252, 245, 0.84);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 12px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.86rem;
  font-weight: 850;
  box-shadow: 0 10px 24px rgba(20, 33, 29, 0.08);
}

.utility-button:hover { transform: translateY(-1px); }
html[data-theme="dark"] .utility-button { background: #0f1715; }
.utility-icon { font-size: 0.95rem; }

.hero {
  position: relative;
  padding-top: 52px;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 28px -20px auto;
  height: 420px;
  z-index: -1;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.10), rgba(249, 115, 22, 0.08)),
    radial-gradient(circle at 20% 20%, rgba(255,255,255,.65), transparent 18rem);
  border-radius: 42px;
  filter: blur(0.2px);
}

html[data-theme="dark"] .hero::before {
  background:
    linear-gradient(135deg, rgba(45, 212, 191, 0.11), rgba(251, 146, 60, 0.08)),
    radial-gradient(circle at 20% 20%, rgba(45, 212, 191, .08), transparent 18rem);
}

.hero-top {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(310px, 0.58fr);
  gap: 28px;
  align-items: center;
  margin-bottom: 30px;
}

.hero-top .hero-copy {
  margin-bottom: 0;
  max-width: 860px;
}

.hero h1 {
  text-wrap: balance;
}

.hero-text {
  max-width: 760px;
}

.hero-showcase {
  display: block;
}

.showcase-card {
  border: 1px solid rgba(231, 222, 208, 0.95);
  background:
    linear-gradient(180deg, rgba(255, 252, 245, 0.96), rgba(255, 248, 236, 0.9));
  border-radius: 28px;
  padding: 18px;
  box-shadow: var(--shadow);
  transform: rotate(1deg);
}

html[data-theme="dark"] .showcase-card {
  border-color: var(--line);
  background: linear-gradient(180deg, rgba(18, 28, 26, .96), rgba(15, 23, 21, .92));
}

.showcase-topline {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 850;
  margin-bottom: 16px;
}

.showcase-topline strong {
  color: #0b534d;
  background: rgba(15, 118, 110, .12);
  border: 1px solid rgba(15, 118, 110, .2);
  border-radius: 999px;
  padding: 6px 10px;
}

html[data-theme="dark"] .showcase-topline strong {
  color: #99f6e4;
  background: rgba(45, 212, 191, .1);
  border-color: rgba(45, 212, 191, .22);
}

.showcase-body {
  display: grid;
  grid-template-columns: 128px 1fr;
  gap: 16px;
  align-items: center;
}

.mini-qr {
  width: 128px;
  height: 128px;
  border-radius: 20px;
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.mini-qr span {
  border-radius: 6px;
  background: var(--text);
  min-height: 22px;
}

.mini-qr span:nth-child(2),
.mini-qr span:nth-child(4),
.mini-qr span:nth-child(8) { background: var(--primary); }
.mini-qr span:nth-child(5) { background: var(--accent); border-radius: 999px; }

.showcase-copy p {
  margin: 0 0 14px;
  color: var(--muted);
  font-weight: 700;
}

.showcase-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.showcase-pills span {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .36);
  border-radius: 999px;
  padding: 7px 10px;
  color: var(--text);
  font-size: .78rem;
  font-weight: 850;
}

html[data-theme="dark"] .showcase-pills span { background: rgba(255,255,255,.04); }

@media (max-width: 980px) {
  .hero-top { grid-template-columns: 1fr; }
  .hero-showcase { max-width: 520px; }
}

@media (max-width: 760px) {
  .nav { height: auto; padding: 14px 0; align-items: flex-start; }
  .nav-right { gap: 10px; }
  .nav-actions { flex-wrap: wrap; justify-content: flex-end; }
  .utility-button { min-height: 36px; padding: 7px 10px; }
  #themeText { display: none; }
  .hero::before { inset-inline: 0; border-radius: 28px; }
  .showcase-body { grid-template-columns: 1fr; }
  .showcase-card { transform: none; }
}
