/* === ai-spark — Professional Dark Theme for QR Generator === */

:root {
  --bg: #0E0E10;
  --card: #141416;
  --card-hover: #1A1A24;
  --text: #F1F1F6;
  --text-secondary: #9494A8;
  --text-muted: #5C5C6E;
  --accent: #06B6D4;
  --accent-hover: #22D3EE;
  --gold: #F59E0B;
  --border: rgba(255,255,255,0.06);
  --border-hover: rgba(255,255,255,0.12);
  --shadow: 0 8px 24px rgba(0,0,0,0.4);
  --radius: 12px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --max-w: 1120px;
  --header-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-weight: 400;
  font-size: 15px;
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--accent); color: #fff; }
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }

/* === Typography === */
h1, h2, h3, h4 { line-height: 1.25; }
h1 { font-size: clamp(32px, 4vw, 52px); font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: clamp(24px, 2.8vw, 36px); font-weight: 600; margin-bottom: 8px; }
h3 { font-size: 17px; font-weight: 600; }
p { color: var(--text-secondary); }
a { color: var(--text); text-decoration: none; transition: 0.2s; }
a:hover { color: var(--accent); }

.section-title { margin-bottom: 8px; }
.section-subtitle { color: var(--text-secondary); font-size: 14px; max-width: 520px; margin: 0 auto 40px; }

/* === Header === */
.header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(14,14,16,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  height: var(--header-h);
}
.header .container { display: flex; align-items: center; justify-content: space-between; height: 100%; }
.logo { font-weight: 700; font-size: 17px; color: var(--accent); letter-spacing: 0.02em; }
.header-badge {
  font-size: 12px; color: var(--text-muted); font-weight: 500;
  padding: 5px 12px; border: 1px solid var(--border); border-radius: 6px;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.header-actions { display: flex; align-items: center; gap: 16px; }

/* === Buttons === */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 22px; border-radius: 12px; font-size: 14px; font-weight: 600;
  cursor: pointer; border: none; text-decoration: none; transition: 0.2s; white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 4px 14px rgba(6,182,212,0.3); }
.btn-primary:hover { background: var(--accent-hover); box-shadow: 0 6px 20px rgba(6,182,212,0.4); }
.btn-secondary { background: var(--card); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--border-hover); background: var(--card-hover); }
.btn-lg { padding: 14px 32px; font-size: 15px; }
.btn-block { width: 100%; }

/* === Hero === */
.hero { padding: 80px 0 40px; text-align: center; }
.hero h1 { margin-bottom: 12px; max-width: 760px; margin-left: auto; margin-right: auto; }
.hero .hero-sub { font-size: 16px; max-width: 480px; margin: 0 auto 8px; }
.hero .hero-meta { font-size: 14px; color: var(--text-muted); margin-bottom: 28px; }
.hero-cli {
  display: inline-block; margin-top: 20px; padding: 8px 18px;
  background: #0A0A0C; border: 1px solid var(--border); border-radius: 8px;
  font-family: 'JetBrains Mono', monospace; font-size: 13px; color: var(--accent);
}
.hero-cli .cursor { display: inline-block; animation: blink 1s step-end infinite; color: var(--text-muted); }
@keyframes blink { 0%,45%{opacity:1;} 46%,100%{opacity:0;} }

/* === Section === */
.section { padding: 40px 0 80px; }

/* === Builder layout === */
.builder-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start;
  background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 32px;
}
.builder-form h2, .builder-preview h2 { font-size: 20px; }

/* === Form === */
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block; font-size: 13px; color: var(--text-secondary);
  font-weight: 500; margin-bottom: 6px;
}
.input {
  width: 100%; padding: 12px 16px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg); color: var(--text); font-size: 14px; outline: none; transition: 0.2s;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(6,182,212,0.12); }

.or-divider { text-align: center; color: var(--text-muted); font-size: 12px; margin: 12px 0; }

.dropzone {
  display: flex; align-items: center; gap: 12px; justify-content: center;
  padding: 18px; border: 1px dashed var(--border-hover); border-radius: 10px;
  cursor: pointer; transition: 0.2s; background: var(--bg); color: var(--text-secondary);
  font-size: 13px; text-align: center;
}
.dropzone:hover { border-color: var(--accent); color: var(--text); }
.dropzone-icon { font-size: 22px; color: var(--accent); }
.hint { font-size: 11px; color: var(--text-muted); margin-top: 6px; }

.color-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.color {
  width: 100%; height: 42px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg); cursor: pointer; padding: 2px;
}

.value-display { color: var(--gold); font-weight: 700; font-size: 14px; }

/* === Тип QR === */
.type-row { display: flex; flex-wrap: wrap; gap: 8px; }
.type-btn {
  padding: 9px 15px; border: 1px solid var(--border); border-radius: 9px;
  background: var(--bg); color: var(--text-secondary); font-size: 13px;
  font-weight: 600; cursor: pointer; transition: 0.2s;
}
.type-btn:hover { border-color: var(--border-hover); color: var(--text); }
.type-btn.active { border-color: var(--accent); color: var(--accent); background: rgba(6,182,212,0.08); }

.type-fields { display: block; }
.form-sep { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
.checkbox-line label { display: flex; align-items: center; gap: 8px; font-weight: 400; color: var(--text); cursor: pointer; }
.checkbox-line input { width: 16px; height: 16px; }

textarea.input { resize: vertical; font-family: inherit; }
select.input { appearance: none; -webkit-appearance: none; }

.contrast-warn { font-weight: 500; font-size: 12px; margin: -6px 0 12px; }

/* === Статус сканирования === */
.scan-status {
  margin-bottom: 12px; padding: 10px 14px; border-radius: 8px;
  font-size: 13px; font-weight: 600; text-align: center;
}
.scan-ok { background: rgba(34,197,94,0.12); color: #4ade80; border: 1px solid rgba(34,197,94,0.3); }
.scan-fail { background: rgba(248,113,113,0.12); color: #f87171; border: 1px solid rgba(248,113,113,0.3); }

/* === Скачивание === */
.dl-row { display: flex; gap: 10px; margin-top: 16px; }
.dl-btn { flex: 1; padding: 12px 0; font-size: 14px; }


.shape-row { display: flex; flex-wrap: wrap; gap: 8px; }
.shape-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 13px; border: 1px solid var(--border); border-radius: 9px;
  background: var(--bg); color: var(--text-secondary); font-size: 13px;
  font-weight: 500; cursor: pointer; transition: 0.2s; line-height: 1;
}
.shape-btn:hover { border-color: var(--border-hover); color: var(--text); }
.shape-btn.active { border-color: var(--accent); color: var(--accent); background: rgba(6,182,212,0.08); }

/* Пиктограммы фигур */
.shp {
  display: inline-block; width: 15px; height: 15px; flex-shrink: 0;
  border: 1.5px solid currentColor; background: transparent; vertical-align: middle;
}
.shp-circle { border-radius: 50%; }
.shp-ring { border-radius: 50%; border-width: 4px; background: transparent; }
.shp-double { border-radius: 50%; box-shadow: inset 0 0 0 3px var(--bg), inset 0 0 0 4px currentColor; }
.shp-pill { border-radius: 50%; transform: scaleX(1.7); }
.shp-diamond { transform: rotate(45deg); }
.shp-brackets { border: none; position: relative; box-shadow: inset 3px 3px 0 0 currentColor, inset -3px 3px 0 0 currentColor, inset 3px -3px 0 0 currentColor, inset -3px -3px 0 0 currentColor; }
.shp-heart { border: none; position: relative; }
.shp-heart::before, .shp-heart::after {
  content: ''; position: absolute; top: 3px; width: 8px; height: 12px;
  background: currentColor; border-radius: 8px 8px 0 0;
}
.shp-heart::before { left: 0; transform: rotate(-45deg); }
.shp-heart::after { right: 0; transform: rotate(45deg); }
.shp-hex {
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  background: currentColor;
}
.shp-none { border: none; background:
  linear-gradient(to top right, transparent calc(50% - 0.6px), currentColor calc(50% - 0.6px), currentColor calc(50% + 0.6px), transparent calc(50% + 0.6px));
}

input[type="range"] {
  width: 100%; -webkit-appearance: none; appearance: none; height: 4px;
  background: var(--border); border-radius: 2px; outline: none; margin-top: 6px;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent); cursor: pointer; border: 2px solid var(--bg);
  box-shadow: 0 0 8px rgba(6,182,212,0.4);
}

/* === Preview === */
.result-box {
  display: flex; align-items: center; justify-content: center;
  min-height: 300px; background: #0A0A0C; border: 1px solid var(--border);
  border-radius: 10px; padding: 24px;
  overflow: auto;
}
.result-box img {
  max-width: 100%; max-height: 420px; border-radius: 8px; box-shadow: 0 12px 32px rgba(0,0,0,0.6);
}
.placeholder { color: var(--text-muted); }
.builder-preview #downloadLink { margin-top: 14px; }
.btn-download {
  width: 100%; padding: 12px; background: transparent; color: var(--text);
  border: none; font-weight: 600; font-size: 14px; cursor: pointer;
}
.result-box img { max-width: 100%; max-height: 420px; }

/* === Rules cards === */
.rules-block { text-align: center; }
.cards-grid { display: grid; gap: 12px; }
.cards-4 { grid-template-columns: repeat(4,1fr); }
.rule-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; text-align: center; transition: 0.2s;
}
.rule-card:hover { border-color: var(--border-hover); transform: translateY(-2px); }
.rule-icon {
  width: 52px; height: 52px; margin: 0 auto 10px; border-radius: 50%;
  background: var(--accent); color: #fff; font-weight: 700; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
}
.rule-card p { font-size: 12px; color: var(--text-secondary); }

/* === Footer === */
.footer { border-top: 1px solid var(--border); padding: 40px 0; }
.footer-bottom { text-align: center; font-size: 12px; color: var(--text-muted); }

/* === SEO text / FAQ === */
.seo-text, .seo-faq { margin-top: 8px; }
.seo-text h2, .seo-faq h2 { font-size: 24px; margin: 40px 0 12px; }
.seo-text h3 { font-size: 18px; margin: 28px 0 10px; }
.seo-text p { color: var(--text-secondary); margin-bottom: 14px; line-height: 1.7; }
.seo-text ul, .seo-text ol { margin: 0 0 16px 20px; color: var(--text-secondary); line-height: 1.7; }
.seo-text li { margin-bottom: 6px; }
.seo-text strong { color: var(--text); }
.faq-item { border-bottom: 1px solid var(--border); padding: 16px 0; }
.faq-item .faq-question { font-weight: 600; color: var(--text); font-size: 15px; margin-bottom: 4px; }
.faq-item .faq-answer { color: var(--text-secondary); font-size: 14px; line-height: 1.6; }

/* === Responsive === */
@media (max-width: 900px) {
  .builder-grid { grid-template-columns: 1fr; }
  .cards-4 { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 520px) {
  .cards-4 { grid-template-columns: 1fr; }
  .color-grid { grid-template-columns: 1fr; }
  .hero { padding: 48px 0 24px; }
}
