﻿/* ============================================================
   QR ALL - Main Stylesheet
   Mobile-first, responsive
   ============================================================ */

/* === RESET === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
img, video { max-width: 100%; display: block; }
button { cursor: pointer; font: inherit; border: none; background: none; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* === VARIABLES === */
:root {
  --primary:        #2563EB;
  --primary-dark:   #1D4ED8;
  --primary-light:  #EFF6FF;
  --primary-ring:   rgba(37,99,235,.25);
  --secondary:      #7C3AED;
  --gradient:       linear-gradient(135deg, #2563EB 0%, #7C3AED 100%);

  --bg:             #F8FAFC;
  --white:          #FFFFFF;
  --text:           #1E293B;
  --text-muted:     #64748B;
  --text-light:     #94A3B8;
  --border:         #E2E8F0;
  --border-focus:   #93C5FD;

  --success:        #10B981;
  --error:          #EF4444;
  --warning:        #F59E0B;

  --shadow-sm:  0 1px 2px rgba(0,0,0,.05);
  --shadow:     0 1px 3px rgba(0,0,0,.10), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:  0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg:  0 10px 25px rgba(0,0,0,.10), 0 4px 6px rgba(0,0,0,.05);

  --radius-sm: 4px;
  --radius:    8px;
  --radius-lg: 12px;
  --radius-xl: 20px;
  --transition: .2s ease;
}

/* === BASE === */
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}
h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); font-weight: 800; line-height: 1.2; }
h2 { font-size: clamp(1.3rem, 3vw, 1.75rem); font-weight: 700; line-height: 1.3; }
h3 { font-size: 1.1rem; font-weight: 600; }
h4 { font-size: .9rem; font-weight: 600; }
p  { color: var(--text-muted); }

/* === LAYOUT === */
.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }

/* === HEADER === */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  gap: 16px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
}
.logo-icon { font-size: 1.5rem; }
.logo-accent { color: var(--primary); }
.main-nav { display: flex; gap: 8px; align-items: center; }
.main-nav a {
  padding: 6px 14px;
  border-radius: var(--radius);
  font-size: .9rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: background var(--transition), color var(--transition);
}
.main-nav a:hover { background: var(--primary-light); color: var(--primary); }
.nav-toggle {
  display: none;
  font-size: 1.4rem;
  padding: 4px 8px;
  color: var(--text-muted);
}

/* === MOBILE NAV === */
.mobile-nav {
  display: none;
  flex-direction: column;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 8px 16px;
  gap: 4px;
}
.mobile-nav.open { display: flex; }
.mobile-nav a {
  padding: 10px 12px;
  border-radius: var(--radius);
  font-weight: 500;
  color: var(--text-muted);
}
.mobile-nav a:hover { background: var(--primary-light); color: var(--primary); }

/* === ADS === */
.ad-container { padding: 12px 0; }
.ad-banner {
  background: var(--white);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  font-size: .8rem;
}
.ad-banner--728x90 { height: 90px; max-width: 728px; margin: 0 auto; }
.ad-banner--native { height: 120px; }
.ad-placeholder { opacity: .5; user-select: none; }

/* === HERO === */
.hero {
  text-align: center;
  padding: 40px 0 24px;
}
.hero-title {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 12px;
}
.hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 540px;
  margin: 0 auto;
}

/* === QR TYPE TABS === */
.qr-type-tabs {
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  gap: 8px;
  padding: 4px 2px 8px;
  margin-bottom: 4px;
}
.qr-type-tabs::-webkit-scrollbar { display: none; }
.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--white);
  white-space: nowrap;
  min-width: 76px;
  transition: all var(--transition);
  color: var(--text-muted);
}
.tab:hover { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }
.tab.active { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }
.tab-icon { font-size: 1.3rem; }
.tab-label { font-size: .72rem; font-weight: 600; letter-spacing: .02em; }

/* === GENERATOR LAYOUT === */
.generator-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
  margin-bottom: 32px;
}

/* === FORM PANEL === */
.form-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.form-card, .preview-card, .custom-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow);
}
.form-type-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text);
}
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}
.required { color: var(--error); }
.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font: inherit;
  font-size: .95rem;
  color: var(--text);
  background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}
.form-textarea { resize: vertical; min-height: 96px; }
.form-hint {
  font-size: .78rem;
  color: var(--text-light);
  margin-top: 4px;
}
.form-group--checkbox { display: flex; align-items: center; gap: 8px; }
.form-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .9rem;
  cursor: pointer;
}
.form-checkbox { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: .95rem;
  font-weight: 600;
  transition: all var(--transition);
}
.btn-primary {
  width: 100%;
  background: var(--gradient);
  color: var(--white);
  padding: 12px;
  border-radius: var(--radius-lg);
  font-size: 1rem;
  font-weight: 700;
  box-shadow: var(--shadow-md);
  margin-top: 8px;
}
.btn-primary:hover { opacity: .9; transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.btn-primary:active { transform: translateY(0); }

/* === CUSTOMIZATION PANEL === */
.custom-card { padding: 20px; }
.panel-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  text-align: left;
  font-size: .95rem;
  font-weight: 700;
  color: var(--text);
  padding: 0;
  gap: 8px;
}
.panel-toggle:hover { color: var(--primary); }
.toggle-icon { font-size: .8rem; transition: transform var(--transition); }
.custom-options { margin-top: 16px; }
.custom-section { margin-bottom: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.custom-section:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.custom-section h4 { margin-bottom: 10px; color: var(--text); font-size: .85rem; }

/* Color inputs */
.color-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.color-field { display: flex; flex-direction: column; gap: 6px; }
.color-field label { font-size: .78rem; color: var(--text-muted); font-weight: 500; }
.color-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
}
.color-input-wrap input[type="color"] {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  padding: 0;
  background: none;
}
.color-value { font-size: .82rem; font-family: monospace; color: var(--text-muted); }

/* Style Buttons */
.style-options { display: flex; flex-wrap: wrap; gap: 8px; }
.style-btn {
  padding: 8px 12px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  font-size: 1.1rem;
  transition: all var(--transition);
  color: var(--text-muted);
}
.style-btn:hover { border-color: var(--primary); background: var(--primary-light); }
.style-btn.active { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }
.style-btn span { font-size: .72rem; display: block; font-weight: 600; }

/* Logo Upload */
.upload-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
}
.upload-label:hover { border-color: var(--primary); background: var(--primary-light); }
.upload-icon { font-size: 1.5rem; }
.upload-text { font-size: .9rem; font-weight: 600; color: var(--text); }
.upload-hint { font-size: .76rem; color: var(--text-light); }
.logo-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}
.logo-preview img { width: 40px; height: 40px; object-fit: contain; border-radius: 4px; }
.remove-logo {
  margin-left: auto;
  color: var(--error);
  font-size: 1rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}
.remove-logo:hover { background: #fee2e2; }

/* Size slider */
.size-slider {
  width: 100%;
  accent-color: var(--primary);
  margin: 8px 0 4px;
}
.size-labels { display: flex; justify-content: space-between; font-size: .75rem; color: var(--text-light); }

/* === PREVIEW PANEL === */
.preview-card { display: flex; flex-direction: column; gap: 16px; }
.preview-title { font-size: .95rem; font-weight: 700; color: var(--text); }
.qr-preview-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 260px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
}
.qr-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--text-light);
  text-align: center;
  padding: 24px;
}
.qr-placeholder-icon { font-size: 3rem; opacity: .35; }
.qr-placeholder p { font-size: .9rem; }
#qrCanvas {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
#qrCanvas canvas, #qrCanvas svg { max-width: 100%; border-radius: 4px; }

/* Frame label */
.frame-label-display {
  display: none;
  text-align: center;
  padding: 8px 16px;
  background: var(--text);
  color: var(--white);
  font-size: .85rem;
  font-weight: 700;
  letter-spacing: .1em;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  margin-top: -8px;
}

/* Download */
.download-section { display: none; }
.download-section h4 { font-size: .85rem; margin-bottom: 8px; color: var(--text); }
.download-buttons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.btn-download {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 8px;
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--white);
  transition: all var(--transition);
  color: var(--text);
}
.btn-download span { font-size: .9rem; font-weight: 700; }
.btn-download small { font-size: .68rem; color: var(--text-light); }
.btn-download:hover { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }
.btn-download:hover small { color: var(--primary); opacity: .7; }

.btn-share {
  width: 100%;
  padding: 10px;
  background: var(--gradient);
  color: var(--white);
  border-radius: var(--radius-lg);
  font-size: .9rem;
  font-weight: 600;
  box-shadow: var(--shadow);
}
.btn-share:hover { opacity: .9; }

/* QR info */
.qr-info { display: none; }
.qr-info-text { font-size: .78rem; color: var(--text-light); text-align: center; word-break: break-all; }

/* === HISTORY === */
.history-section { margin: 32px 0; }
.history-section h2 { margin-bottom: 16px; }
.history-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-bottom: 12px; }
.history-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.history-icon { font-size: 1.4rem; flex-shrink: 0; }
.history-info { flex: 1; overflow: hidden; }
.history-label { font-size: .85rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-type { font-size: .72rem; color: var(--text-light); text-transform: uppercase; letter-spacing: .05em; }
.history-restore {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .9rem;
  color: var(--text-muted);
  transition: all var(--transition);
}
.history-restore:hover { background: var(--primary); color: var(--white); border-color: var(--primary); }
.btn-clear-history {
  padding: 8px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: .85rem;
  color: var(--text-muted);
  background: var(--white);
}
.btn-clear-history:hover { background: #fee2e2; border-color: var(--error); color: var(--error); }

/* === GUIDE STEPS === */
.guide-section { margin: 40px 0; }
.guide-section h2 { margin-bottom: 24px; text-align: center; }
.steps-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.step-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow);
}
.step-number {
  width: 40px;
  height: 40px;
  background: var(--gradient);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1rem;
  margin: 0 auto 12px;
}
.step-card h3 { color: var(--text); margin-bottom: 8px; }
.step-card p { font-size: .88rem; }

/* === FAQ === */
.faq-section { margin: 40px 0; }
.faq-section h2 { margin-bottom: 20px; }
.faq-list { display: flex; flex-direction: column; gap: 8px; }
.faq-item {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.faq-item summary {
  padding: 16px 20px;
  font-weight: 600;
  font-size: .95rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text);
}
.faq-item summary::after { content: '+'; font-size: 1.2rem; color: var(--primary); font-weight: 700; }
.faq-item[open] summary::after { content: '-'; }
.faq-item p { padding: 0 20px 16px; font-size: .9rem; color: var(--text-muted); }

/* === TYPE GUIDE (sub-pages) === */
.type-guide { margin: 40px 0; }
.type-guide h2 { margin-bottom: 16px; }
.type-guide h3 { margin: 20px 0 8px; color: var(--text); }
.type-guide p { font-size: .95rem; margin-bottom: 12px; }
.type-guide ul { padding-left: 20px; list-style: disc; }
.type-guide ul li { font-size: .9rem; color: var(--text-muted); margin-bottom: 6px; }
.guide-use-cases {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin: 16px 0;
}
.use-case-card {
  background: var(--primary-light);
  border: 1px solid var(--border-focus);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
}
.use-case-card .use-case-icon { font-size: 1.4rem; margin-bottom: 6px; }
.use-case-card h4 { font-size: .88rem; color: var(--primary-dark); margin-bottom: 4px; }
.use-case-card p { font-size: .82rem; color: var(--text-muted); }

/* === BLOG === */
.page-hero { padding: 48px 0 32px; text-align: center; }
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; margin: 32px 0; }
.blog-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
}
.blog-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.blog-card-body { padding: 20px; }
.blog-tag {
  display: inline-block;
  padding: 3px 10px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 600;
  margin-bottom: 10px;
}
.blog-card h3 { margin-bottom: 8px; color: var(--text); font-size: 1rem; }
.blog-card p { font-size: .88rem; }
.blog-card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  font-size: .78rem;
  color: var(--text-light);
  display: flex;
  justify-content: space-between;
}

/* === STATIC PAGES (about, privacy, terms) === */
.static-page { max-width: 760px; margin: 0 auto; padding: 40px 0 60px; }
.static-page h1 { margin-bottom: 8px; }
.static-page .page-date { color: var(--text-light); font-size: .88rem; margin-bottom: 32px; display: block; }
.static-page h2 { margin: 32px 0 12px; font-size: 1.2rem; }
.static-page h3 { margin: 20px 0 8px; font-size: 1rem; }
.static-page p { font-size: .95rem; color: var(--text-muted); margin-bottom: 12px; }
.static-page ul { padding-left: 20px; list-style: disc; margin-bottom: 12px; }
.static-page ul li { font-size: .95rem; color: var(--text-muted); margin-bottom: 6px; }
.static-page a { color: var(--primary); text-decoration: underline; }

/* === FOOTER === */
.site-footer {
  background: var(--text);
  color: var(--white);
  padding: 48px 0 24px;
  margin-top: 60px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}
.footer-brand .logo { color: var(--white); font-size: 1.4rem; margin-bottom: 12px; }
.footer-brand .logo-accent { color: #93C5FD; }
.footer-brand p { color: rgba(255,255,255,.6); font-size: .88rem; line-height: 1.6; }
.footer-links h4 { color: rgba(255,255,255,.9); margin-bottom: 12px; font-size: .85rem; letter-spacing: .05em; text-transform: uppercase; }
.footer-links ul { display: flex; flex-direction: column; gap: 8px; }
.footer-links a { font-size: .88rem; color: rgba(255,255,255,.6); transition: color var(--transition); }
.footer-links a:hover { color: var(--white); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding-top: 20px;
  font-size: .82rem;
  color: rgba(255,255,255,.45);
  text-align: center;
}

/* === TOAST === */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: var(--text);
  color: var(--white);
  padding: 12px 24px;
  border-radius: 999px;
  font-size: .9rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  opacity: 0;
  transition: all .3s ease;
  pointer-events: none;
  white-space: nowrap;
}
.toast.toast-visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* === UTILITIES === */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; }
.section-title { margin-bottom: 24px; }

/* === QR TYPE TAGS (in guide pages) === */
.qr-types-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}
.qr-type-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: all var(--transition);
}
.qr-type-tag:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Tablet */
@media (max-width: 900px) {
  .steps-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

/* Mobile */
@media (max-width: 768px) {
  .main-nav { display: none; }
  .nav-toggle { display: block; }

  .generator-layout { grid-template-columns: 1fr; }

  .hero { padding: 28px 0 16px; }

  .form-row { grid-template-columns: 1fr; }

  .steps-grid { grid-template-columns: repeat(2, 1fr); }

  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .footer-brand { grid-column: auto; }

  .download-buttons { grid-template-columns: repeat(3, 1fr); }

  .ad-banner--728x90 { height: 60px; }

  .blog-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .steps-grid { grid-template-columns: 1fr; }
  .history-grid { grid-template-columns: 1fr; }
  .color-row { grid-template-columns: 1fr; }
}

