/* ====== MODULE-GLOBAL-START ====== */
:root {
  --bg: #f4f8f3;
  --card: #ffffff;
  --text: #14181f;
  --muted: #5b6470;
  --line: #e2e9e0;
  --accent: #84cc16;          /* lime green */
  --accent-ink: #0f1a05;
  --panel: #1c2026;           /* dark preview panel */
  --grad-1: #d9f7e8;          /* mint */
  --grad-2: #dbeeff;          /* blue */
}
[data-theme="dark"] {
  --bg: #0f1216;
  --card: #171b21;
  --text: #eef2f5;
  --muted: #9aa4b2;
  --line: #2a3039;
  --panel: #0b0e12;
  --grad-1: #12261f;
  --grad-2: #122033;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
a { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible {

  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; border-radius: 999px;
  font-size: 14px; font-weight: 600; text-decoration: none;
  border: 1px solid transparent; cursor: pointer;
  background: transparent; color: var(--text);
}
.btn.solid { background: var(--accent); color: var(--accent-ink); }
.btn.outline { border-color: var(--line); background: var(--card); }
.btn.ghost:hover, .btn.outline:hover { background: var(--line); }
.icon-btn { padding: 8px 12px; }
/* ====== MODULE-GLOBAL-END ====== */

/* ====== MODULE-HEADER-START ====== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--card) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; text-decoration: none; }
/* ====== MODULE-HEADER-START (continued) ====== */
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink);
  font-weight: 800;
}
.header-actions { display: flex; align-items: center; gap: 10px; }
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 8px);
  min-width: 240px; margin: 0; padding: 8px; list-style: none;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: 0 16px 40px rgba(0,0,0,.12);
  z-index: 200;
}
.dropdown-menu a {
  display: block; padding: 10px 12px; border-radius: 8px;
  text-decoration: none; font-size: 14px; font-weight: 500;
}
.dropdown-menu a:hover { background: var(--line); }
.menu-lang label {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 12px; font-size: 14px;
}
.menu-lang select {
  padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text);
}
.only-mobile { display: none; }
@media (max-width: 640px) {
  .hide-mobile { display: none; }
  .only-mobile { display: block; }
}
/* ====== MODULE-HEADER-END ====== */

/* ====== MODULE-HERO-START ====== */
.hero {
  padding: 72px 20px 40px; text-align: center;
  background: linear-gradient(135deg, var(--grad-1) 0%, var(--grad-2) 100%);
}
.hero h1 {
  font-size: clamp(32px, 5vw, 52px); font-weight: 800;
  letter-spacing: -0.02em; margin: 0 0 10px;
}
.hero p { margin: 0 auto; color: var(--muted); font-size: 17px; max-width: 620px; }
/* ====== MODULE-HERO-END ====== */

/* ====== MODULE-GRID-START ====== */
.generator-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 24px; align-items: start;
  margin-top: 32px; margin-bottom: 48px;
}
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 20px; padding: 24px;
  box-shadow: 0 10px 30px rgba(0,0,0,.05);
}
.right-col { display: flex; flex-direction: column; gap: 16px; }
@media (max-width: 900px) {
  .generator-grid { grid-template-columns: 1fr; }
}
/* ====== MODULE-GRID-END ====== */

/* ====== MODULE-QR-TABS-START ====== */
.type-tabs {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 8px; margin-bottom: 20px;
}
.type-tab {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 4px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text);
  font: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
  transition: border-color .2s, background .2s;
}
.type-tab .ti { font-size: 18px; }
.type-tab:hover { border-color: var(--accent); }
.type-tab.active {
  background: var(--accent); color: var(--accent-ink); border-color: var(--accent);
}
@media (max-width: 480px) {
  .type-tabs { grid-template-columns: repeat(3, 1fr); }
}
/* ====== MODULE-QR-TABS-END ====== */

/* ====== MODULE-INPUT-FORM-START ====== */
.field { display: block; margin-bottom: 14px; }
.field span {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--muted); margin-bottom: 6px;
}
.field input, .field textarea {
  width: 100%; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text);
  font: inherit; font-size: 15px;
}
.field textarea { min-height: 90px; resize: vertical; }
.field input:read-only { opacity: .75; }
.upload-box {
  margin-top: 20px; padding: 14px; display: grid; gap: 12px;
  border: 1px dashed var(--line); border-radius: 14px;
}
.upload-row {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; flex-wrap: wrap;
}
.file-btn { cursor: pointer; }
.inline-btns { display: flex; gap: 8px; }

.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(132, 204, 22, .25);
}

/* ====== MODULE-INPUT-FORM-END ====== */

/* ====== MODULE-QR-PREVIEW-START ====== */
.preview-card { text-align: center; }
.preview-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px;
}
.preview-head h2 { font-size: 18px; margin: 0; }
.qr-stage {
  display: flex; justify-content: center; padding: 20px;
  border-radius: 16px; background: var(--bg);
}
.qr-tile {
  width: min(100%, 320px); aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center;
  padding: 12px; border-radius: 14px; background: #fff;
  box-shadow: 0 8px 24px rgba(0,0,0,.08);
}
.qr-tile svg { width: 100%; height: auto; display: block; }
.qr-placeholder { width: 100%; height: auto; display: block; border-radius: 10px; }
.placeholder { color: #64748b; font-size: 14px; text-align: center; }
.preview-note { margin: 10px 0 0; color: var(--muted); }
/* ====== MODULE-QR-PREVIEW-END ====== */

/* ====== MODULE-ACTIONS-START ====== */
.action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.action-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  padding: 16px; border-radius: 16px; text-align: left;
  border: 1px solid var(--line); background: var(--card); color: var(--text);
  font: inherit; cursor: pointer; transition: transform .2s, border-color .2s;
}
.action-card small { color: var(--muted); font-size: 12px; }
.action-card:hover:not(:disabled) { border-color: var(--accent); transform: translateY(-2px); }
.action-card:disabled { opacity: .45; cursor: not-allowed; }
.ac-icon {
  width: 40px; height: 40px; margin-bottom: 6px; border-radius: 12px;
  display: grid; place-items: center; font-size: 20px; background: var(--accent);
}
@media (max-width: 640px) {
  .action-grid { grid-template-columns: 1fr; }
}
/* ====== MODULE-ACTIONS-END ====== */

/* ====== MODULE-CUSTOMIZER-START ====== */
.customizer { display: grid; gap: 14px; }
.customizer h3 {
  margin: 0; font-size: 13px; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted);
}
.styles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.style-btn {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 12px; border-radius: 12px; font: inherit; font-size: 13px;
  border: 1px solid var(--line); background: var(--bg); color: var(--text);
  cursor: pointer;
}
.style-btn svg { width: 32px; height: 32px; fill: currentColor; }
.style-btn.active { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.colors { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.colors label {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 13px; font-weight: 600; color: var(--muted);
}
.colors input[type="color"] {
  width: 100%; height: 42px; padding: 4px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 10px; background: var(--bg);
}
.warn {
  margin: 0; padding: 10px 12px; border-radius: 10px;
  background: #fff4e5; color: #8a4b00; font-size: 13px;
}
[data-theme="dark"] .warn { background: #3a2a10; color: #ffd39a; }
/* ====== MODULE-CUSTOMIZER-END ====== */

/* ====== MODULE-FOOTER-START ====== */
.site-footer {
  padding: 28px 0; text-align: center;
  background: var(--card); border-top: 1px solid var(--line);
}
.footer-links {
  display: flex; justify-content: center; flex-wrap: wrap;
  gap: 22px; margin-bottom: 12px;
}
.footer-links a { text-decoration: none; color: var(--muted); font-size: 14px; }
.footer-links a:hover { color: var(--text); }
.copy { margin: 0; color: var(--muted); font-size: 13px; }
/* ====== MODULE-FOOTER-END ====== */

/* ====== MODULE-TOAST-START ====== */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 300;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  padding: 12px 18px; border-radius: 12px; font-size: 14px;
  background: var(--text); color: var(--bg); transition: .25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
/* ====== MODULE-TOAST-END ====== */

/* ====== MODULE-LEGAL-START ====== */
.legal { max-width: 760px; padding-top: 32px; padding-bottom: 48px; }
.legal h1 { font-size: 32px; margin: 0 0 8px; }
.legal h2 { font-size: 20px; margin: 28px 0 8px; }
.legal p, .legal li { line-height: 1.7; }
.legal ul { padding-left: 20px; }
.legal .updated { color: var(--muted); font-size: 14px; }
.legal a { color: var(--accent); }
/* ====== MODULE-LEGAL-END ====== */

@media (max-width: 640px) {
  .hero { padding: 44px 16px 32px; }
  .card { padding: 18px; }
}

