@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --brand:       #0f79d8;
  --brand-hover: #0d6abf;
  --brand-pale:  #e8f2fd;
  --bg:          #f5f7fa;
  --surface:     #ffffff;
  --surface-2:   #f9fafb;
  --line:        #e5eaf2;
  --text:        #1a1f2e;
  --muted:       #6b7a99;
  --success:     #0d7a4a;
  --error:       #c0192e;
  --radius:      14px;
  --radius-sm:   10px;
  --shadow-sm:   0 2px 8px rgba(15,30,70,.07);
  --shadow:      0 4px 20px rgba(15,30,70,.10);
  --shadow-md:   0 8px 32px rgba(15,30,70,.12);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }

/* ─── App wrapper ─────────────────────────── */
.qrApp {
  min-height: 100vh;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
}

/* ─── Top bar ─────────────────────────────── */
.qrApp__top {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 100;
}
.qrApp__topInner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.qrApp__brand {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--brand);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.qrApp__brand span { color: var(--text); }

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

.qrApp__lang { position: relative; }
.qrApp__lang summary {
  list-style: none; cursor: pointer;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); padding: 6px 14px;
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.04em;
  color: var(--muted); transition: border-color .18s, background .18s;
}
.qrApp__lang summary:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-pale); }

.qrApp__langMenu {
  position: absolute; right: 0; top: 40px; min-width: 76px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); box-shadow: var(--shadow-md); overflow: hidden; z-index: 20;
}
.qrApp__langMenu a {
  display: block; padding: 8px 14px; font-size: 0.8rem; font-weight: 700;
  color: var(--muted); text-decoration: none; letter-spacing: 0.04em;
  transition: background .15s, color .15s;
}
.qrApp__langMenu a:hover { background: var(--brand-pale); color: var(--brand); }

/* ─── Step indicator ──────────────────────── */
.stepBar { background: var(--surface); border-bottom: 1px solid var(--line); padding: 0 24px; }
.stepBar__inner {
  max-width: 1120px; margin: 0 auto;
  display: flex; align-items: center; height: 52px;
}
.stepBar__item {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.82rem; font-weight: 600; color: var(--muted);
  transition: color .2s; white-space: nowrap;
}
.stepBar__item.is-active { color: var(--brand); }
.stepBar__item.is-done   { color: var(--success); }

.stepBar__num {
  width: 24px; height: 24px; border-radius: 50%; border: 2px solid currentColor;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 800; flex-shrink: 0;
  transition: background .2s, color .2s, border-color .2s;
}
.stepBar__item.is-active .stepBar__num { background: var(--brand); border-color: var(--brand); color: #fff; }
.stepBar__item.is-done .stepBar__num   { background: var(--success); border-color: var(--success); color: #fff; }

.stepBar__sep {
  flex: 1; height: 2px; background: var(--line);
  margin: 0 12px; border-radius: 2px; min-width: 24px; max-width: 100px;
}

/* ─── Wizard steps ────────────────────────── */
.wizardStep { display: none; }
.wizardStep.is-active { display: block; }

/* ─── STEP 1: Hero + Form ─────────────────── */
.qrHero {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 48px 24px 44px;
  text-align: center;
}
.qrHero__inner { max-width: 620px; margin: 0 auto; }
.qrHero h1 {
  margin: 0;
  font-size: clamp(1.6rem, 3.2vw, 2.2rem);
  font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; color: var(--text);
}
.qrHero p {
  margin: 12px 0 0; color: var(--muted);
  font-size: 0.97rem; font-weight: 500; line-height: 1.6;
}

/* ─── Form layout ─────────────────────────── */
.qrFormWrap {
  max-width: 680px;
  margin: 40px auto 0;
  padding: 0 24px 48px;
}

.settingsCard {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 16px;
}
.settingsCard__head {
  padding: 16px 20px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.settingsCard__head h3 { margin: 0; font-size: 0.9rem; font-weight: 800; }
.settingsCard__head p  { margin: 3px 0 0; font-size: 0.82rem; color: var(--muted); }
.settingsCard__body { padding: 18px 20px 20px; }

.field { margin-top: 14px; }
.field:first-child { margin-top: 0; }
.field label { display: block; margin-bottom: 5px; font-size: 0.84rem; font-weight: 600; color: #374151; }

textarea,
select,
input[type="text"],
input[type="range"] {
  width: 100%;
  font: inherit;
  font-size: 0.9rem;
  -webkit-appearance: none;
  appearance: none;
}

textarea,
select,
input[type="text"] {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: var(--surface);
  color: var(--text);
  transition: border-color .2s, box-shadow .2s;
}
textarea { resize: vertical; min-height: 90px; }

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236b7a99' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

textarea:focus, select:focus, input[type="text"]:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15,121,216,.14);
}

/* range slider */
input[type="range"] {
  height: 6px;
  border-radius: 999px;
  background: var(--line);
  cursor: pointer;
  margin-top: 8px;
  accent-color: var(--brand);
}

.rangeRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.rangeRow input[type="range"] { flex: 1; }
.rangeValue {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--brand);
  min-width: 40px;
  text-align: right;
  white-space: nowrap;
}

/* color inputs */
.colorRow {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 0;
}
input[type="color"] {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 3px 6px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color .2s;
}
input[type="color"]:hover { border-color: var(--brand); }

/* wifi fields */
#wifiFields .field:first-child { margin-top: 0; }

/* status bar */
.statusBar {
  margin-top: 14px; padding: 10px 14px; border-radius: var(--radius-sm);
  font-size: 0.84rem; font-weight: 600; background: var(--surface-2);
  color: var(--muted); border: 1px solid var(--line);
  display: flex; align-items: center; gap: 7px; min-height: 40px;
  transition: background .2s, color .2s, border-color .2s;
}
.statusBar.is-error { background: #fff5f6; color: var(--error); border-color: #f5c0c8; }
.statusBar.is-ok    { background: #f0faf6; color: var(--success); border-color: #b3e0c9; }

.actionBar { display: flex; flex-direction: column; gap: 8px; margin-top: 20px; }

/* features */
.qrFeatures {
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 32px 24px;
}
.qrFeatures__inner {
  max-width: 1120px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px;
}
.featureItem { display: flex; align-items: flex-start; gap: 14px; }
.featureItem__icon  { font-size: 1.6rem; flex-shrink: 0; line-height: 1; }
.featureItem__title { font-size: 0.88rem; font-weight: 700; color: var(--text); margin: 0 0 4px; }
.featureItem__desc  { font-size: 0.83rem; color: var(--muted); line-height: 1.5; margin: 0; }

/* SEO */
.qrSeo { max-width: 1120px; margin: 0 auto; padding: 40px 24px 16px; }
.qrSeo h2 { font-size: 1.35rem; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 12px; color: var(--text); }
.qrSeo h3 { font-size: 1rem; font-weight: 700; margin: 28px 0 8px; color: var(--text); }
.qrSeo p  { color: var(--muted); font-size: 0.93rem; line-height: 1.7; margin: 0 0 10px; max-width: 760px; }

.seoGrid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 8px; }
.seoGrid__item { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px 18px; background: var(--surface); }
.seoGrid__item h4 { font-size: 0.88rem; font-weight: 700; margin: 0 0 6px; color: var(--text); }
.seoGrid__item p  { font-size: 0.83rem; margin: 0; color: var(--muted); }

/* FAQ */
.qrFaq { max-width: 1120px; margin: 0 auto; padding: 8px 24px 48px; }
.qrFaq h2 { font-size: 1.2rem; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 14px; color: var(--text); }
.qrFaq details {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); padding: 14px 18px; margin-top: 8px; transition: box-shadow .2s;
}
.qrFaq details[open] { box-shadow: var(--shadow-sm); }
.qrFaq summary {
  font-size: 0.93rem; font-weight: 700; cursor: pointer; color: var(--text);
  list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.qrFaq summary::after { content: '+'; font-size: 1.1rem; color: var(--brand); flex-shrink: 0; transition: transform .2s; }
.qrFaq details[open] summary::after { transform: rotate(45deg); }
.qrFaq p { margin: 10px 0 0; color: var(--muted); font-size: 0.88rem; line-height: 1.65; }

/* ─── STEP 2: Preview & Download ──────────── */
.qrPreviewWrap {
  max-width: 680px;
  margin: 40px auto 0;
  padding: 0 24px 60px;
}

.qrPreviewCard {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 20px;
}

.qrPreviewFrame {
  background-color: #f8fbff;
  background-image:
    linear-gradient(45deg, #e9f1ff 25%, transparent 25%),
    linear-gradient(-45deg, #e9f1ff 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e9f1ff 75%),
    linear-gradient(-45deg, transparent 75%, #e9f1ff 75%);
  background-size: 18px 18px;
  background-position: 0 0, 0 9px, 9px -9px, -9px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  min-height: 280px;
}

#qrPreview {
  max-width: 100%;
  max-height: 360px;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15,30,70,.13);
  display: block;
}

.qrPreviewMeta {
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.qrPreviewMeta__label { font-size: 0.82rem; color: var(--muted); font-weight: 500; }
.qrPreviewMeta__value { font-size: 0.88rem; font-weight: 700; color: var(--text); }

.downloadActions { display: flex; flex-direction: column; gap: 8px; }

.editLink {
  display: inline-block; margin-top: 20px; text-align: center; width: 100%;
  font-size: 0.85rem; color: var(--brand); font-weight: 600; cursor: pointer;
  background: none; border: none; text-decoration: underline; text-underline-offset: 2px;
}
.editLink:hover { color: var(--brand-hover); }

/* ─── Buttons ─────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 44px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 10px 18px; background: var(--surface); color: var(--text);
  font: inherit; font-size: 0.9rem; font-weight: 600; cursor: pointer;
  transition: background .18s, border-color .18s, box-shadow .18s, transform .1s;
  width: 100%; text-decoration: none; white-space: nowrap;
}
.btn:focus-visible { outline: 3px solid rgba(15,121,216,.3); outline-offset: 2px; }
.btn:disabled { opacity: 0.42; cursor: not-allowed; pointer-events: none; }

.btn--primary {
  background: var(--brand); color: #fff;
  border-color: rgba(10,55,130,.2);
  box-shadow: 0 2px 8px rgba(15,121,216,.22);
}
.btn--primary:hover:not(:disabled) { background: var(--brand-hover); box-shadow: 0 4px 14px rgba(15,121,216,.30); }
.btn--primary:active:not(:disabled) { transform: scale(0.98); }

.btn--ghost { background: var(--surface-2); border-color: var(--line); color: var(--muted); }
.btn--ghost:hover:not(:disabled) { background: var(--line); color: var(--text); }

.btn--outline {
  background: var(--surface); border-color: var(--brand); color: var(--brand);
}
.btn--outline:hover:not(:disabled) { background: var(--brand-pale); }

.btn--sm { width: auto; min-height: 38px; padding: 7px 14px; font-size: 0.85rem; }

.small { font-size: 0.82rem; font-weight: 500; color: var(--muted); }

/* ─── Responsive ──────────────────────────── */
@media (max-width: 860px) {
  .qrFeatures__inner { grid-template-columns: 1fr 1fr; gap: 20px; }
  .seoGrid { grid-template-columns: 1fr; }
}

@media (max-width: 580px) {
  .qrApp__topInner { padding: 0 16px; }
  .qrHero { padding: 32px 16px 28px; }
  .qrFormWrap { padding: 0 16px 40px; margin-top: 24px; }
  .settingsCard__head, .settingsCard__body { padding-left: 16px; padding-right: 16px; }
  .qrPreviewWrap { padding: 0 16px 40px; margin-top: 24px; }
  .colorRow { grid-template-columns: 1fr; }
  .qrFeatures { padding: 24px 16px; }
  .qrFeatures__inner { grid-template-columns: 1fr; gap: 18px; }
  .qrSeo, .qrFaq { padding-left: 16px; padding-right: 16px; }
  .stepBar__label { display: none; }
  .stepBar__sep { max-width: 40px; }
}
