/* Qlinka design system — adapted from qlinka.com */
:root {
  --primary-color: #52a071;
  --primary-dark: #00A843;
  --primary-light: #4CAF50;
  --secondary-color: #2196F3;
  --text-dark: #1a1a1a;
  --text-light: #666;
  --text-muted: #999;
  --bg-light: #f8f9fa;
  --bg-white: #ffffff;
  --border-color: #e0e0e0;
  --border-soft: #f0f0f0;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  --shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.12);
  --border-radius: 8px;
  --transition: all 0.3s ease;
  --container: 1200px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { padding: 0; margin: 0; }
body {
  font-family: var(--font);
  line-height: 1.6;
  color: var(--text-dark);
  background-color: var(--bg-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; display: block; }
a { color: var(--primary-color); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-dark); }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.header {
  background: var(--bg-white);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 1000;
}
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
}
.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-dark);
}
.logo img { height: 36px; width: auto; }
.nav-menu {
  display: flex; list-style: none; gap: 2rem; align-items: center;
}
.nav-link {
  color: var(--text-dark);
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius);
  transition: var(--transition);
}
.nav-link:hover { color: var(--primary-color); background-color: var(--bg-light); }
.nav-cta {
  background: var(--primary-color); color: #fff !important;
  padding: 10px 20px; border-radius: var(--border-radius); font-weight: 600;
}
.nav-cta:hover { background: var(--primary-dark); transform: translateY(-2px); box-shadow: var(--shadow-hover); }

@media (max-width: 760px) {
  .nav-menu .nav-link:not(.nav-cta) { display: none; }
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; cursor: pointer; font-family: inherit; font-weight: 600; font-size: 0.95rem;
  padding: 12px 24px; border-radius: var(--border-radius);
  transition: var(--transition); text-decoration: none;
}
.btn-primary { background: var(--primary-color); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-2px); box-shadow: var(--shadow-hover); color: #fff; }
.btn-secondary {
  background: var(--bg-white); color: var(--text-dark);
  border: 1px solid var(--border-color);
}
.btn-secondary:hover { background: var(--bg-light); transform: translateY(-2px); box-shadow: 0 10px 25px rgba(0,0,0,0.1); }
.btn-dark { background: var(--text-dark); color: #fff; }
.btn-dark:hover { background: #000; transform: translateY(-2px); box-shadow: var(--shadow-hover); color: #fff; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--bg-light) 0%, var(--bg-white) 100%);
  padding: 80px 0 40px;
  text-align: center;
}
.hero-content { max-width: 860px; margin: 0 auto; }
.hero-eyebrow {
  display: inline-block;
  background: rgba(82, 160, 113, 0.1);
  color: var(--primary-dark);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}
.hero-title {
  font-size: 3.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-dark);
  line-height: 1.15;
}
.hero-highlight {
  color: var(--primary-color);
  position: relative;
}
.hero-highlight::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0; right: 0;
  height: 3px; background: var(--primary-color);
  border-radius: 2px;
}
.hero-subtitle {
  font-size: 1.2rem;
  color: var(--text-light);
  margin-bottom: 2rem;
  line-height: 1.5;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}
.hero-trust {
  display: flex; justify-content: center; flex-wrap: wrap;
  gap: 14px 28px; color: var(--text-light); font-size: 0.95rem;
}
.hero-trust span { display: inline-flex; align-items: center; gap: 8px; }
.hero-trust svg { color: var(--primary-color); }
@media (max-width: 720px) {
  .hero-title { font-size: 2.25rem; }
  .hero-subtitle { font-size: 1.05rem; }
}

/* Generator section */
.generator-section {
  padding: 50px 0 80px;
  background: var(--bg-white);
}
.generator {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 28px;
}
@media (max-width: 980px) {
  .generator { grid-template-columns: 1fr; }
}

.card {
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  padding: 28px;
}
.card h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 18px;
  color: var(--text-dark);
}
.card .muted { color: var(--text-muted); font-size: 0.85rem; }

/* Tabs */
.tabs {
  display: flex; flex-wrap: wrap; gap: 6px;
  background: var(--bg-light);
  padding: 6px;
  border-radius: var(--border-radius);
  margin-bottom: 20px;
}
.tab {
  border: 0; background: transparent; cursor: pointer;
  padding: 9px 13px; border-radius: 6px;
  font-weight: 600; color: var(--text-light);
  font-size: 0.85rem; font-family: inherit;
  display: inline-flex; align-items: center; gap: 6px;
  transition: var(--transition);
}
.tab:hover { color: var(--text-dark); }
.tab.active { background: var(--bg-white); color: var(--primary-dark); box-shadow: var(--shadow); }
.tab svg { width: 16px; height: 16px; }

/* Form fields */
.field { display: block; margin-bottom: 16px; }
.field > label {
  display: block; font-size: 0.85rem; color: var(--text-light);
  margin-bottom: 6px; font-weight: 600;
}
.input, .textarea, .select {
  width: 100%;
  border: 1px solid var(--border-color);
  background: var(--bg-white);
  color: var(--text-dark);
  padding: 11px 14px;
  border-radius: var(--border-radius);
  font-size: 0.95rem;
  font-family: inherit;
  transition: var(--transition);
}
.input:focus, .textarea:focus, .select:focus {
  outline: 0;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(82, 160, 113, 0.15);
}
.textarea { min-height: 100px; resize: vertical; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
@media (max-width: 600px) { .row-2, .row-3 { grid-template-columns: 1fr; } }

/* Style picker */
.style-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
@media (max-width: 600px) { .style-grid { grid-template-columns: 1fr; } }
.color-row { display: flex; align-items: center; gap: 10px; }
.color-row input[type="color"] {
  width: 44px; height: 36px; padding: 2px;
  border: 1px solid var(--border-color); border-radius: 6px; background: var(--bg-white);
  cursor: pointer;
}
.shape-row {
  display: flex; flex-wrap: wrap; gap: 6px;
  background: var(--bg-light); padding: 4px; border-radius: 6px;
}
.shape {
  flex: 1 1 auto; min-width: 60px; text-align: center; cursor: pointer;
  padding: 8px 6px; border-radius: 4px;
  font-size: 0.78rem; font-weight: 600;
  color: var(--text-light); user-select: none;
  border: 0; background: transparent; font-family: inherit;
  transition: var(--transition);
}
.shape:hover { color: var(--text-dark); }
.shape.active { background: var(--bg-white); color: var(--primary-dark); box-shadow: var(--shadow); }

/* Preview */
.preview {
  position: sticky; top: 100px;
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  padding: 28px;
  display: flex; flex-direction: column; align-items: center;
}
@media (max-width: 980px) { .preview { position: static; } }
.preview .qr-box {
  background: var(--bg-light);
  border: 1px dashed var(--border-color);
  border-radius: var(--border-radius);
  padding: 20px;
  margin-bottom: 18px;
}
#qr-canvas { max-width: 320px; }
.size-row {
  width: 100%; display: flex; align-items: center; gap: 10px; margin-bottom: 14px;
  color: var(--text-light); font-size: 0.85rem;
}
.size-row input[type="range"] {
  flex: 1;
  accent-color: var(--primary-color);
}
.size-row strong { color: var(--text-dark); font-weight: 600; }

.dl-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; width: 100%; margin-top: 4px; }
.dl-row .btn { padding: 11px 12px; font-size: 0.9rem; }

.quota-bar {
  width: 100%; margin-top: 18px;
  background: var(--bg-light);
  border: 1px solid var(--border-soft);
  border-radius: var(--border-radius);
  padding: 11px 14px;
  font-size: 0.85rem; color: var(--text-light);
  display: flex; justify-content: space-between; align-items: center;
}
.quota-bar strong { color: var(--text-dark); font-weight: 700; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--text-dark); color: #fff;
  padding: 12px 20px;
  border-radius: var(--border-radius);
  font-size: 0.9rem; box-shadow: var(--shadow-lg);
  opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none;
  z-index: 1100;
}
.toast.show { opacity: 1; transform: translate(-50%, -6px); }
.toast.error { background: #d33; }
.toast.success { background: var(--primary-color); }

/* Sections */
section.section { padding: 60px 0; background: var(--bg-white); }
section.section.alt { background: var(--bg-light); }
.section-title {
  text-align: center; margin: 0 auto 40px; max-width: 720px;
}
.section-title h2 {
  font-size: 2.25rem;
  margin: 0 0 12px;
  font-weight: 700;
  color: var(--text-dark);
}
.section-title p { color: var(--text-light); font-size: 1.1rem; margin: 0; }
@media (max-width: 720px) {
  .section-title h2 { font-size: 1.7rem; }
}

.feature-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
}
@media (max-width: 880px) { .feature-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .feature-grid { grid-template-columns: 1fr; } }
.feature {
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 28px 24px;
  transition: var(--transition);
  box-shadow: var(--shadow);
}
.feature:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); border-color: var(--primary-color); }
.feature .icon {
  width: 48px; height: 48px; border-radius: var(--border-radius);
  background: rgba(82, 160, 113, 0.12);
  color: var(--primary-dark);
  display: grid; place-items: center;
  margin-bottom: 16px;
}
.feature h3 { margin: 0 0 8px; font-size: 1.15rem; font-weight: 700; color: var(--text-dark); }
.feature p { margin: 0; color: var(--text-light); font-size: 0.95rem; line-height: 1.6; }

.steps {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px;
  counter-reset: step;
}
@media (max-width: 880px) { .steps { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .steps { grid-template-columns: 1fr; } }
.step {
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 24px;
  counter-increment: step;
  box-shadow: var(--shadow);
  transition: var(--transition);
}
.step:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.step::before {
  content: counter(step);
  display: inline-grid; place-items: center;
  width: 36px; height: 36px;
  border-radius: var(--border-radius);
  background: var(--primary-color);
  color: #fff; font-weight: 700; font-size: 1rem;
  margin-bottom: 12px;
}
.step h3 { margin: 0 0 6px; font-size: 1.05rem; font-weight: 700; color: var(--text-dark); }
.step p { margin: 0; color: var(--text-light); font-size: 0.9rem; }

/* FAQ */
.faq { max-width: 820px; margin: 0 auto; }
.faq details {
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 18px 22px;
  margin-bottom: 12px;
  transition: var(--transition);
}
.faq details[open] { border-color: var(--primary-color); box-shadow: var(--shadow); }
.faq summary {
  font-weight: 600; cursor: pointer; list-style: none;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  color: var(--text-dark);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; font-size: 1.5rem; color: var(--text-muted);
  font-weight: 300; transition: var(--transition);
}
.faq details[open] summary::after { content: "–"; color: var(--primary-color); }
.faq p { color: var(--text-light); margin: 12px 0 0; line-height: 1.6; }

/* Footer (Qlinka style: dark gradient with subtle grid) */
footer.footer {
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
  color: #fff;
  position: relative;
  overflow: hidden;
}
footer.footer::before {
  content: ''; position: absolute; inset: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="g" width="20" height="20" patternUnits="userSpaceOnUse"><path d="M 20 0 L 0 0 0 20" fill="none" stroke="rgba(82, 160, 113, 0.05)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23g)"/></svg>') repeat;
  opacity: 0.4;
}
.footer-main {
  padding: 4rem 0 2rem;
  position: relative; z-index: 2;
}
.footer-content {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}
@media (max-width: 880px) {
  .footer-content { grid-template-columns: 1fr 1fr; gap: 2rem; }
}
@media (max-width: 540px) {
  .footer-content { grid-template-columns: 1fr; }
}
.footer-brand { max-width: 350px; }
.footer-logo img { height: 32px; filter: brightness(0) invert(1); margin-bottom: 1rem; }
.footer-brand p { color: #b8b8b8; line-height: 1.6; font-size: 0.9rem; }
.footer-col h4 {
  font-size: 0.95rem; font-weight: 700;
  color: #fff; margin-bottom: 1rem;
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 0.5rem; }
.footer-col a { color: #b8b8b8; font-size: 0.9rem; }
.footer-col a:hover { color: var(--primary-color); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 1.5rem 0;
  text-align: center;
  color: #999;
  font-size: 0.85rem;
  position: relative; z-index: 2;
}

/* Admin */
.admin-shell {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--bg-light) 0%, var(--bg-white) 100%);
  padding: 40px 20px;
}
.admin-card {
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-lg);
  padding: 36px;
  max-width: 420px; width: 100%;
}
.admin-card .logo { margin-bottom: 1.5rem; }
.admin-card h1 { margin: 0 0 6px; font-size: 1.4rem; font-weight: 700; color: var(--text-dark); }
.admin-card p { color: var(--text-muted); margin: 0 0 22px; font-size: 0.9rem; }
.admin-error {
  background: #fef2f2; color: #991b1b;
  border: 1px solid #fecaca;
  padding: 10px 14px; border-radius: var(--border-radius);
  font-size: 0.9rem; margin-bottom: 14px;
}
.admin-page {
  background: var(--bg-light); min-height: 100vh; padding-bottom: 64px;
}
.admin-bar {
  background: var(--bg-white);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow);
  padding: 14px 0;
  position: sticky; top: 0; z-index: 100;
}
.admin-bar .row { display: flex; justify-content: space-between; align-items: center; }
.admin-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-top: 28px;
}
@media (max-width: 900px) { .admin-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .admin-grid { grid-template-columns: 1fr; } }
.stat {
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 22px;
  box-shadow: var(--shadow);
  transition: var(--transition);
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.stat .label { color: var(--text-muted); font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.stat .value { font-size: 2rem; font-weight: 700; color: var(--text-dark); margin-top: 6px; }
.stat .delta { font-size: 0.8rem; color: var(--primary-color); margin-top: 4px; font-weight: 600; }

.panel {
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 24px;
  margin-top: 24px;
  box-shadow: var(--shadow);
}
.panel h2 { margin: 0 0 14px; font-size: 1.05rem; font-weight: 700; color: var(--text-dark); }
.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table th, .table td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--border-soft); }
.table th { color: var(--text-muted); font-weight: 600; font-size: 0.75rem; text-transform: uppercase; letter-spacing: .06em; }
.table tr:last-child td { border-bottom: 0; }
.chart { width: 100%; height: 220px; }
.tag {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  background: rgba(82, 160, 113, 0.12);
  color: var(--primary-dark);
  font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
}

/* Skip link */
.skip-link {
  position: absolute; left: -9999px; top: -9999px;
  background: var(--text-dark); color: #fff;
  padding: 8px 12px; border-radius: var(--border-radius);
}
.skip-link:focus { left: 16px; top: 16px; z-index: 1200; }
