.qr-generator {
  --qr-border: #d7dee8;
  --qr-muted: #5c6778;
  --qr-panel: #ffffff;
  --qr-soft: #f5f7fa;
  --qr-focus: #2563eb;
  --qr-heading: #101828;
  --qr-primary-soft: #eef4ff;
  max-width: 1140px;
  margin-inline: auto;
}

.qr-generator .back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 1rem;
  text-decoration: none;
  font-weight: 700;
  color: #2563eb;
}

.qr-generator .tool-eyebrow {
  display: inline-block;
  margin-bottom: 0.55rem;
  font-size: 0.79rem;
  letter-spacing: 0.1em;
  font-weight: 800;
  color: #2563eb;
}

.qr-generator .tool-title-line {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.qr-generator .tool-title-icon {
  flex: 0 0 62px;
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  border-radius: 18px;
  background: linear-gradient(180deg, #eef4ff 0%, #dde8ff 100%);
  color: #1d4ed8;
  border: 1px solid #cddcfb;
  box-shadow: 0 10px 26px rgba(37, 99, 235, 0.12);
}

.qr-generator .tool-heading h1 {
  margin: 0;
  font-size: clamp(2.2rem, 5vw, 3.35rem);
  line-height: 1.02;
  color: var(--qr-heading);
}

.qr-generator .tool-heading p {
  max-width: 760px;
  margin: 0.45rem 0 0;
  color: var(--qr-muted);
  font-size: 1.08rem;
  line-height: 1.65;
}

.qr-hero {
  margin-bottom: 1.75rem;
}

.qr-hero-points {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1rem;
}

.qr-hero-points span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0.3rem 0.75rem;
  border: 1px solid #d7dee8;
  border-radius: 999px;
  background: #fff;
  font-size: 0.9rem;
  font-weight: 650;
  color: #344054;
}

.qr-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.7fr);
  gap: 1.5rem;
  align-items: start;
}

.qr-form,
.qr-result {
  border: 1px solid var(--qr-border);
  border-radius: 18px;
  background: var(--qr-panel);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.qr-form {
  padding: clamp(1rem, 3vw, 1.5rem);
}

.qr-section-block {
  padding: 1rem;
  border: 1px solid var(--qr-border);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.qr-section-head h2 {
  margin: 0;
  font-size: 1.2rem;
  color: #172033;
}

.qr-section-head p {
  margin: 0.35rem 0 0.9rem;
  color: var(--qr-muted);
  font-size: 0.95rem;
}

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

.qr-field label,
.qr-settings legend {
  display: block;
  margin-bottom: 0.45rem;
  font-weight: 700;
  color: #172033;
}

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

.qr-counter {
  flex: none;
  color: var(--qr-muted);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}

.qr-counter.is-over-limit {
  color: #b42318;
  font-weight: 700;
}

.qr-form textarea,
.qr-form select,
.qr-form input[type="number"] {
  width: 100%;
  min-height: 46px;
  box-sizing: border-box;
  border: 1px solid #b9c2cf;
  border-radius: 12px;
  background: #fff;
  color: #111827;
  font: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.qr-form textarea {
  min-height: 180px;
  padding: 0.95rem 1rem;
  resize: vertical;
  line-height: 1.55;
}

.qr-form select,
.qr-form input[type="number"] {
  padding: 0.72rem 0.85rem;
}

.qr-form textarea:focus,
.qr-form select:focus,
.qr-form input:focus,
.qr-result .button:focus-visible,
.qr-social-links a:focus-visible,
.qr-generator .back-link:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--qr-focus) 28%, transparent);
  outline-offset: 2px;
  border-color: var(--qr-focus);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.qr-help {
  margin: 0.55rem 0 0;
  color: var(--qr-muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.qr-settings {
  margin: 1.35rem 0 0;
  padding: 1rem 1rem 1.1rem;
  border: 1px solid var(--qr-border);
  border-radius: 14px;
  background: var(--qr-soft);
}

.qr-settings legend {
  padding: 0 0.5rem;
}

.qr-control-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.qr-input-suffix {
  display: flex;
  align-items: stretch;
}

.qr-input-suffix input {
  border-radius: 12px 0 0 12px !important;
}

.qr-input-suffix span {
  display: grid;
  place-items: center;
  padding: 0 0.8rem;
  border: 1px solid #b9c2cf;
  border-left: 0;
  border-radius: 0 12px 12px 0;
  background: #eef2f6;
  color: #475467;
  font-size: 0.85rem;
}

.qr-color-control {
  display: flex;
  min-height: 46px;
  align-items: center;
  gap: 0.75rem;
  padding: 0.4rem 0.75rem;
  border: 1px solid #b9c2cf;
  border-radius: 12px;
  background: #fff;
}

.qr-color-control input[type="color"] {
  width: 44px;
  height: 34px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.qr-color-control output {
  color: #344054;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9rem;
}

.qr-tip-box {
  margin-top: 1rem;
  padding: 0.85rem 0.95rem;
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid #d9e2ef;
  color: #445268;
  line-height: 1.5;
  font-size: 0.92rem;
}

.qr-message {
  margin-top: 1rem;
}

.qr-message[data-kind="error"] {
  border-color: #f3b8b3;
  background: #fff1f0;
  color: #8f1d18;
}

.qr-message[data-kind="success"] {
  border-color: #a7d7b5;
  background: #edf9f0;
  color: #176b35;
}

.qr-message[data-kind="warning"] {
  border-color: #f5d88b;
  background: #fff7e6;
  color: #8a4b00;
}


.qr-submit-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  margin-top: 1.25rem;
}

.qr-submit-row .button,
.qr-result-actions .button {
  min-height: 46px;
  touch-action: manipulation;
}

.qr-result {
  position: sticky;
  top: 1rem;
  padding: 1rem;
}

.qr-empty-state {
  display: grid;
  place-items: center;
  text-align: center;
  min-height: 420px;
  padding: 1.25rem;
  border: 1px dashed #cfd7e3;
  border-radius: 16px;
  background: linear-gradient(180deg, #fbfcfe 0%, #f4f7fb 100%);
}

.qr-empty-icon {
  width: 84px;
  height: 84px;
  display: grid;
  place-items: center;
  border-radius: 24px;
  font-size: 2rem;
  color: #1d4ed8;
  background: linear-gradient(180deg, #e9f0ff 0%, #dbe7ff 100%);
  box-shadow: inset 0 0 0 1px #caddff;
}

.qr-empty-state h2 {
  margin: 1rem 0 0.45rem;
  font-size: 1.45rem;
  color: #172033;
}

.qr-empty-state p {
  margin: 0;
  max-width: 26rem;
  color: var(--qr-muted);
  line-height: 1.55;
}

.qr-result-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.qr-result-heading h2 {
  margin: 0;
  font-size: 1.25rem;
}

.qr-result-heading p {
  margin: 0.35rem 0 0;
  color: var(--qr-muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.qr-ready-badge {
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: #eaf8ee;
  color: #176b35;
  font-size: 0.78rem;
  font-weight: 700;
}

.qr-preview-wrap {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid var(--qr-border);
  border-radius: 16px;
  background-image: linear-gradient(45deg, #edf0f4 25%, transparent 25%), linear-gradient(-45deg, #edf0f4 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #edf0f4 75%), linear-gradient(-45deg, transparent 75%, #edf0f4 75%);
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-size: 16px 16px;
}

.qr-preview-wrap img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.qr-result-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  margin-top: 1rem;
}

.qr-result-actions .button {
  justify-content: center;
  text-align: center;
}

.qr-social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
  padding-top: 0.95rem;
  border-top: 1px solid var(--qr-border);
  font-size: 0.92rem;
}

.qr-social-links a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 0.78rem;
  border: 1px solid #d7dee8;
  border-radius: 999px;
  background: #fff;
  color: #2458a6;
  font-weight: 650;
  text-decoration: none;
}

.qr-expiry {
  margin: 0.9rem 0 0;
  color: var(--qr-muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.qr-admin-values {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
}

.qr-admin-values div {
  padding: 0.9rem;
  border: 1px solid #d7dee8;
  border-radius: 10px;
  background: #f7f9fb;
}

.qr-admin-values dt {
  color: #5c6778;
  font-size: 0.82rem;
}

.qr-admin-values dd {
  margin: 0.25rem 0 0;
  font-weight: 700;
}

@media (max-width: 900px) {
  .qr-layout {
    grid-template-columns: 1fr;
  }

  .qr-result {
    position: static;
  }
}

@media (max-width: 640px) {
  .qr-control-grid,
  .qr-result-actions {
    grid-template-columns: 1fr;
  }

  .qr-label-line,
  .qr-generator .tool-title-line,
  .qr-result-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.35rem;
  }

  .qr-submit-row,
  .qr-submit-row .button,
  .qr-result-actions .button {
    width: 100%;
  }

  .qr-empty-state {
    min-height: 280px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .qr-generator *,
  .qr-generator *::before,
  .qr-generator *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
