.qr-page {
  position: relative;
  overflow: hidden;
}

.qr-page::before {
  position: absolute;
  top: 5rem;
  left: 50%;
  width: min(1100px, 94vw);
  height: 540px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(45, 130, 255, .13), transparent 66%);
  content: "";
  pointer-events: none;
  transform: translateX(-50%);
}

.qr-hero {
  position: relative;
  padding-block: clamp(3rem, 6vw, 5rem) clamp(5rem, 9vw, 8rem);
}

.qr-intro {
  max-width: 780px;
  margin: 0 auto clamp(1.8rem, 3vw, 2.6rem);
  text-align: center;
}

.qr-intro .page-title {
  margin-inline: auto;
}

.qr-intro .page-lead {
  max-width: 690px;
  margin-inline: auto;
}

.qr-benefits {
  display: flex;
  justify-content: center;
  gap: 1rem 2.4rem;
  padding: 0;
  margin: 1.4rem 0 0;
  list-style: none;
}

.qr-benefits li {
  display: flex;
  align-items: center;
  gap: .75rem;
  color: var(--muted);
  font-size: .86rem;
  text-align: left;
}

.qr-benefits svg {
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  fill: none;
  stroke: var(--blue-bright);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.55;
}

.qr-benefits strong {
  display: block;
  margin-bottom: .05rem;
  color: var(--ink);
  font-size: .88rem;
}

.qr-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(380px, .86fr);
  gap: 1.2rem;
  max-width: 1060px;
  margin-inline: auto;
}

.qr-controls,
.qr-result {
  position: relative;
  min-width: 0;
  padding: clamp(1.35rem, 3vw, 2.25rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(155deg, rgba(15, 39, 68, .94), rgba(7, 23, 42, .86));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.qr-controls::after,
.qr-result::after {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(130deg, rgba(99, 214, 255, .06), transparent 36%, rgba(164, 112, 255, .045));
  content: "";
  pointer-events: none;
}

.qr-controls > *,
.qr-result > * {
  position: relative;
  z-index: 1;
}

.qr-card-heading {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 2rem;
}

.qr-step {
  display: inline-grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  border: 1px solid rgba(99, 214, 255, .3);
  border-radius: 12px;
  background: rgba(99, 214, 255, .08);
  color: var(--blue-bright);
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .08em;
}

.qr-card-heading h2 {
  margin: -.15rem 0 .25rem;
  color: var(--ink);
  font-size: 1.2rem;
  line-height: 1.35;
}

.qr-card-heading p {
  margin: 0;
  color: var(--muted);
  font-size: .86rem;
}

.qr-mode-selector {
  min-width: 0;
  padding: 0;
  margin: 0 0 1.35rem;
  border: 0;
}

.qr-mode-selector legend {
  display: block;
  width: 100%;
  margin-bottom: .55rem;
  color: var(--muted-strong);
  font-size: .875rem;
  font-weight: 750;
}

.qr-mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  padding: 5px;
  border: 1px solid rgba(184, 210, 246, .18);
  border-radius: 15px;
  background: rgba(5, 13, 24, .48);
}

.qr-mode-switch label {
  min-width: 0;
  cursor: pointer;
}

.qr-mode-switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.qr-mode-switch span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  gap: .55rem;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--muted);
  font-size: .875rem;
  font-weight: 750;
  transition: color .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.qr-mode-switch svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.qr-mode-switch input:checked + span {
  border-color: rgba(99, 214, 255, .22);
  background: rgba(45, 130, 255, .16);
  box-shadow: 0 7px 20px rgba(0, 0, 0, .14);
  color: var(--ink);
}

.qr-mode-switch input:focus-visible + span {
  outline: 3px solid rgba(99, 214, 255, .7);
  outline-offset: 3px;
}

.qr-field {
  min-width: 0;
}

.qr-field label,
.qr-label-row label {
  display: block;
  margin-bottom: .55rem;
  color: var(--muted-strong);
  font-size: .875rem;
  font-weight: 750;
}

.qr-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.qr-label-row > span {
  margin-bottom: .55rem;
  color: var(--muted);
  font-size: .74rem;
  font-variant-numeric: tabular-nums;
}

.qr-input-wrap,
.qr-select-wrap {
  position: relative;
}

.qr-input-wrap > svg {
  position: absolute;
  top: 50%;
  left: 1rem;
  z-index: 1;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--muted);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.65;
  pointer-events: none;
  transform: translateY(-50%);
}

.qr-content-control,
.qr-field select {
  width: 100%;
  min-height: 52px;
  border: 1px solid rgba(184, 210, 246, .2);
  border-radius: 14px;
  outline: 0;
  background: rgba(5, 13, 24, .68);
  color: var(--ink);
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.qr-content-control {
  padding: .78rem 3rem .78rem 3.05rem;
}

.qr-field textarea.qr-content-control {
  min-height: 148px;
  padding-top: .85rem;
  line-height: 1.55;
  resize: vertical;
}

.qr-field select {
  appearance: none;
  padding: .78rem 2.7rem .78rem .95rem;
  cursor: pointer;
}

.qr-content-control:hover,
.qr-field select:hover {
  border-color: rgba(99, 214, 255, .38);
}

.qr-content-control:focus,
.qr-field select:focus {
  border-color: rgba(99, 214, 255, .72);
  box-shadow: 0 0 0 4px rgba(45, 130, 255, .13);
}

.qr-content-control[aria-invalid="true"] {
  border-color: var(--danger);
  box-shadow: 0 0 0 4px rgba(255, 123, 141, .1);
}

.qr-input-wrap-text > svg {
  top: 1.05rem;
  transform: none;
}

.qr-input-wrap-text .qr-clear {
  top: .55rem;
  transform: none;
}

.qr-clear {
  position: absolute;
  top: 50%;
  right: .65rem;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transform: translateY(-50%);
}

.qr-clear:hover {
  background: rgba(255, 255, 255, .07);
  color: var(--ink);
}

.qr-clear svg,
.qr-select-wrap svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.qr-select-wrap > svg {
  position: absolute;
  top: 50%;
  right: .9rem;
  color: var(--muted);
  pointer-events: none;
  transform: translateY(-50%);
}

.qr-field-hint,
.qr-error {
  margin: .55rem 0 0;
  font-size: .76rem;
}

.qr-field-hint {
  color: var(--muted);
}

.qr-error {
  color: var(--danger);
  font-weight: 700;
}

.qr-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1.4rem;
}

.qr-generate,
.qr-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .7rem;
  min-height: 52px;
  border: 0;
  border-radius: 14px;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.qr-generate {
  width: 100%;
  margin-top: 1.4rem;
  padding: .82rem 1.2rem;
  background: linear-gradient(115deg, #2377f2, #326ee9 56%, #6955d9);
  box-shadow: 0 14px 32px rgba(45, 130, 255, .24);
}

.qr-generate:hover,
.qr-download:hover {
  filter: brightness(1.08);
  transform: translateY(-2px);
}

.qr-generate:active,
.qr-download:active {
  transform: translateY(0);
}

.qr-generate svg,
.qr-download svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.qr-local-note {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: .45rem;
  margin: .85rem 0 0;
  color: var(--muted);
  font-size: .72rem;
  text-align: center;
}

.qr-local-note svg {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  fill: none;
  stroke: var(--success);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.65;
}

.qr-result {
  display: flex;
  flex-direction: column;
}

.qr-preview-stage {
  display: grid;
  min-height: 342px;
  flex: 1;
  place-items: center;
  padding: 1.25rem;
  border: 1px dashed rgba(184, 210, 246, .18);
  border-radius: 19px;
  background: rgba(5, 13, 24, .38);
}

.qr-empty-state {
  display: grid;
  max-width: 230px;
  justify-items: center;
  color: var(--muted);
  text-align: center;
}

.qr-empty-state > svg {
  width: 92px;
  height: 92px;
  margin-bottom: 1.1rem;
  fill: none;
  stroke: rgba(99, 214, 255, .4);
  stroke-width: 2;
}

.qr-empty-state > svg path {
  fill: rgba(99, 214, 255, .2);
  stroke: none;
}

.qr-empty-state strong {
  margin-bottom: .35rem;
  color: var(--muted-strong);
  font-size: .92rem;
}

.qr-empty-state span {
  font-size: .78rem;
  line-height: 1.5;
}

.qr-preview-stage canvas {
  width: min(100%, 300px);
  height: auto;
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 20px 44px rgba(0, 0, 0, .3);
  image-rendering: pixelated;
}

.qr-result-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
}

.qr-result-meta {
  display: flex;
  align-items: center;
  gap: .55rem;
  color: var(--muted-strong);
  font-size: .78rem;
}

.qr-ready-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(84, 213, 154, .1);
}

.qr-download {
  min-height: 44px;
  padding: .68rem .95rem;
  background: #fff;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .16);
  color: #07172a;
  font-size: .875rem;
}

.qr-format-guide {
  position: relative;
  display: grid;
  grid-template-columns: minmax(240px, .74fr) minmax(0, 1.5fr);
  gap: clamp(2rem, 6vw, 5rem);
  padding-bottom: clamp(5rem, 9vw, 8rem);
}

.qr-format-guide .section-title {
  font-size: clamp(2rem, 3.4vw, 3rem);
}

.qr-guide-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
}

.qr-guide-grid article {
  min-width: 0;
  padding: 1.5rem 1.15rem 0;
  border-left: 1px solid var(--line);
}

.qr-guide-grid article > span {
  display: inline-block;
  margin-bottom: 1.2rem;
  color: var(--blue-bright);
  font-size: .69rem;
  font-weight: 850;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.qr-guide-grid .is-recommended > span {
  color: var(--orange);
}

.qr-guide-grid h3 {
  margin: 0 0 .55rem;
  color: var(--ink);
  font-size: 1rem;
}

.qr-guide-grid p {
  margin: 0;
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.6;
}

.qr-page [hidden] {
  display: none !important;
}

.qr-page .visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

html[data-theme="light"] .qr-page::before {
  background: radial-gradient(circle, rgba(23, 111, 209, .12), transparent 66%);
}

html[data-theme="light"] .qr-controls,
html[data-theme="light"] .qr-result {
  background: linear-gradient(155deg, rgba(255, 255, 255, .98), rgba(240, 246, 251, .94));
  box-shadow: 0 24px 65px rgba(28, 52, 76, .12);
}

html[data-theme="light"] .qr-controls::after,
html[data-theme="light"] .qr-result::after {
  background: linear-gradient(130deg, rgba(23, 111, 209, .035), transparent 36%, rgba(109, 75, 195, .025));
}

html[data-theme="light"] .qr-step {
  border-color: rgba(23, 111, 209, .24);
  background: rgba(23, 111, 209, .08);
  color: var(--blue);
}

html[data-theme="light"] .qr-content-control,
html[data-theme="light"] .qr-field select {
  border-color: rgba(25, 55, 82, .21);
  background: #fff;
  color: var(--ink);
}

html[data-theme="light"] .qr-clear:hover {
  background: rgba(23, 111, 209, .07);
}

html[data-theme="light"] .qr-mode-switch {
  border-color: rgba(25, 55, 82, .18);
  background: rgba(231, 238, 245, .72);
}

html[data-theme="light"] .qr-mode-switch input:checked + span {
  border-color: rgba(23, 111, 209, .22);
  background: #fff;
  box-shadow: 0 7px 18px rgba(28, 52, 76, .1);
  color: var(--ink);
}

html[data-theme="light"] .qr-preview-stage {
  border-color: rgba(25, 55, 82, .19);
  background: rgba(231, 238, 245, .62);
}

html[data-theme="light"] .qr-preview-stage canvas {
  box-shadow: 0 18px 40px rgba(28, 52, 76, .16);
}

@media (max-width: 920px) {
  .qr-workspace {
    grid-template-columns: 1fr;
    max-width: 650px;
  }

  .qr-result {
    min-height: 0;
  }

  .qr-format-guide {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .qr-hero {
    padding-top: 3.7rem;
  }

  .qr-benefits {
    align-items: flex-start;
    flex-direction: column;
    width: max-content;
    max-width: 100%;
    margin-inline: auto;
  }

  .qr-controls,
  .qr-result {
    border-radius: 20px;
  }

  .qr-options {
    grid-template-columns: 1fr;
  }

  .qr-preview-stage {
    min-height: 300px;
  }

  .qr-result-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .qr-download {
    width: 100%;
  }

  .qr-guide-grid {
    grid-template-columns: 1fr;
  }

  .qr-guide-grid article {
    padding-bottom: 1.3rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .qr-generate,
  .qr-download {
    transition: none;
  }
}
