:root {
  --canvas: #f7f5f0;
  --surface: #ffffff;
  --surface-soft: #fbfaf7;
  --ink: #17172a;
  --muted: #686a78;
  --muted-strong: #4e5060;
  --line: #dedde4;
  --line-strong: #c8c7d1;
  --indigo: #312e81;
  --indigo-hover: #27236c;
  --indigo-soft: #eeedff;
  --emerald: #057a55;
  --emerald-soft: #e9f7f1;
  --danger: #b42318;
  --danger-soft: #fff0ee;
  --warning: #8a5a00;
  --warning-soft: #fff7df;
  --shadow-sm: 0 2px 10px rgba(23, 23, 42, 0.05);
  --shadow-card: 0 18px 50px rgba(23, 23, 42, 0.08);
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 18px;
  --focus: 0 0 0 4px rgba(49, 46, 129, 0.16);
  --ease: 180ms cubic-bezier(0.2, 0.8, 0.2, 1);
  --surface-glass: rgba(255, 255, 255, 0.92);
  --field-bg: #ffffff;
  --stage-bg: #ffffff;
  --footer-bg: rgba(255, 255, 255, 0.44);
  --chip-bg: rgba(255, 255, 255, 0.72);
  --control-bg: rgba(255, 255, 255, 0.65);
  --emerald-line: #c7ddd3;
  --shadow-tint: rgba(23, 23, 42, 0.12);
  --placeholder: #9a9ba5;
  --line-hover: #aaa9b6;
  --aurora-1: rgba(49, 46, 129, 0.10);
  --aurora-2: rgba(5, 122, 85, 0.08);
  --aurora-3: rgba(120, 90, 200, 0.07);
  --particle: rgba(49, 46, 129, 0.30);
  --toggle-border: var(--line-strong);
  --toggle-glow: rgba(49, 46, 129, 0.45);
  --customizer-glow: rgba(49, 46, 129, 0.16);
  --customizer-glow-hover: rgba(49, 46, 129, 0.26);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.94) 0, rgba(255, 255, 255, 0) 37rem),
    var(--canvas);
  color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
summary,
input[type="color"],
input[type="range"],
input[type="file"] {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

a {
  color: inherit;
}

svg {
  display: block;
}

[hidden] {
  display: none !important;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.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;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1000;
  transform: translateY(-180%);
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  transition: transform var(--ease);
}

.skip-link:focus {
  transform: translateY(0);
}

:focus-visible {
  outline: 3px solid rgba(49, 46, 129, 0.45);
  outline-offset: 3px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(200, 199, 209, 0.7);
  background: rgba(247, 245, 240, 0.97);
  backdrop-filter: blur(18px) saturate(150%);
}

.header-inner,
.footer-inner {
  width: min(100% - 48px, 1336px);
  margin-inline: auto;
}

.header-inner {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-family: "Manrope", "Inter", sans-serif;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.04em;
  text-decoration: none;
}

.brand-mark {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
}

.brand-mark svg {
  width: 100%;
  height: 100%;
  fill: var(--indigo);
  stroke: var(--indigo);
  stroke-width: 2.2;
}

.brand:hover .brand-mark {
  transform: translateY(-1px);
}

.brand-mark {
  transition: transform var(--ease);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.free-badge,
.privacy-chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--emerald-line);
  border-radius: 10px;
  background: var(--chip-bg);
  color: var(--emerald);
  box-shadow: var(--shadow-sm);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.free-badge {
  min-height: 42px;
  padding: 0 15px;
}

.free-badge svg,
.privacy-chip svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lang-switch {
  min-width: 88px;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--control-bg);
  color: var(--muted);
  cursor: pointer;
  font-weight: 600;
  transition: background var(--ease), border-color var(--ease), box-shadow var(--ease);
}

.lang-switch:hover {
  border-color: var(--indigo);
  background: var(--surface);
}

.lang-switch:focus-visible {
  box-shadow: var(--focus);
}

.lang-active {
  color: var(--ink);
  font-weight: 700;
}

main {
  width: min(100% - 48px, 1290px);
  margin-inline: auto;
}

.hero {
  max-width: 1120px;
  margin: 0 auto;
  padding: 46px 0 26px;
  text-align: center;
}

.eyebrow,
.preview-kicker {
  margin: 0;
  color: var(--indigo);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.hero h1 {
  max-width: 1140px;
  margin: 15px auto 14px;
  font-family: "Manrope", "Inter", sans-serif;
  font-size: clamp(42px, 4vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.055em;
}

.hero-copy {
  max-width: 850px;
  margin: 0 auto;
  color: var(--muted);
  font-size: clamp(17px, 1.65vw, 20px);
  line-height: 1.65;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.48fr) minmax(370px, 1fr);
  overflow: visible;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-glass);
  box-shadow: var(--shadow-card);
}

.generator-panel,
.preview-panel {
  min-width: 0;
  padding: 34px 40px;
}

.generator-panel {
  display: flex;
  flex-direction: column;
}

.preview-panel {
  position: sticky;
  top: 102px;
  align-self: start;
  border-left: 1px solid var(--line);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  background: linear-gradient(145deg, var(--surface) 0%, var(--surface-soft) 100%);
}

.type-nav {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 4px;
  margin-bottom: 30px;
  border-bottom: 1px solid var(--line);
}

.primary-types {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(92px, 1fr));
  flex: 1;
}

.type-tab {
  position: relative;
  min-height: 58px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 8px 12px;
  border: 0;
  background: transparent;
  color: var(--muted-strong);
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  transition: color var(--ease), background var(--ease);
}

.type-tab svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.type-tab::after {
  content: "";
  position: absolute;
  right: 11px;
  bottom: -1px;
  left: 11px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--indigo);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform var(--ease);
}

.type-tab:hover {
  color: var(--indigo);
  background: linear-gradient(to bottom, transparent, rgba(49, 46, 129, 0.035));
}

.type-tab.active,
.type-tab[aria-selected="true"] {
  color: var(--indigo);
  font-weight: 700;
}

.type-tab.active::after,
.type-tab[aria-selected="true"]::after {
  transform: scaleX(1);
}

.more-wrap {
  position: relative;
  flex: 0 0 auto;
}

.more-trigger {
  min-width: 90px;
}

.more-trigger.active::after {
  transform: scaleX(1);
}

.more-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 20;
  width: 220px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 16px 36px var(--shadow-tint);
}

.more-menu[hidden] {
  display: none;
}

.more-backdrop {
  display: none;
}

.more-option {
  width: 100%;
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted-strong);
  cursor: pointer;
  text-align: left;
}

.more-option:hover,
.more-option.active {
  background: var(--indigo-soft);
  color: var(--indigo);
}

.more-option svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#qrForm {
  display: grid;
  gap: 18px;
}

.fields-area {
  display: grid;
  gap: 16px;
}

.fields-area.is-changing {
  opacity: 0;
  transform: translateY(3px);
}

.fields-area {
  transition: opacity 140ms ease, transform 140ms ease;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-field {
  display: grid;
  gap: 7px;
}

.form-field.full {
  grid-column: 1 / -1;
}

.field-label-row,
.label-row,
.custom-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.form-field label,
.control-field > label,
.field-label,
.range-field label {
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
}

.optional {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.input-shell {
  position: relative;
}

.input-shell > svg {
  position: absolute;
  top: 50%;
  left: 18px;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform: translateY(-50%);
  pointer-events: none;
}

.form-input,
.form-select,
.form-textarea,
.select-wrap select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--field-bg);
  color: var(--ink);
  font-size: 16px;
  outline: none;
  transition: border-color var(--ease), box-shadow var(--ease), background var(--ease);
}

.form-input,
.form-select {
  min-height: 58px;
  padding: 0 16px;
}

.input-shell .form-input {
  padding-left: 54px;
}

.form-textarea {
  min-height: 116px;
  padding: 15px 16px;
  line-height: 1.55;
  resize: vertical;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--placeholder);
}

.form-input:hover,
.form-select:hover,
.form-textarea:hover,
.select-wrap select:hover {
  border-color: var(--line-hover);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus,
.select-wrap select:focus {
  border-color: var(--indigo);
  box-shadow: var(--focus);
}

.form-input.invalid,
.form-select.invalid,
.form-textarea.invalid {
  border-color: var(--danger);
  background: var(--danger-soft);
}

.field-error {
  min-height: 17px;
  margin: 0;
  color: var(--danger);
  font-size: 12px;
  line-height: 1.35;
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.field-error:not(:empty) {
  opacity: 1;
  transform: translateY(0);
}

@keyframes field-shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-4px); }
  40%, 60% { transform: translateX(4px); }
}

.form-input.shake,
.form-select.shake,
.form-textarea.shake {
  animation: field-shake 420ms cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

@media (prefers-reduced-motion: reduce) {
  .form-input.shake,
  .form-select.shake,
  .form-textarea.shake {
    animation: none;
  }
}

.char-count {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.char-count.warning {
  color: var(--warning);
}

.char-count.danger {
  color: var(--danger);
}

.generate-button {
  width: 100%;
  min-height: 62px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0 24px;
  border: 0;
  border-radius: 11px;
  background: linear-gradient(112deg, #3732a3 0%, var(--indigo) 100%);
  color: #fff;
  box-shadow: 0 10px 24px rgba(49, 46, 129, 0.2);
  cursor: pointer;
  font-family: "Manrope", "Inter", sans-serif;
  font-size: 18px;
  font-weight: 700;
  transition: transform var(--ease), background var(--ease), box-shadow var(--ease);
}

.generate-button svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform var(--ease);
}

.generate-button:hover {
  background: linear-gradient(112deg, #302c91 0%, var(--indigo-hover) 100%);
  box-shadow: 0 13px 28px rgba(49, 46, 129, 0.26);
  transform: translateY(-1px);
}

.generate-button:hover svg {
  transform: translateX(3px);
}

.generate-button:active {
  transform: translateY(0);
}

.generate-button:disabled {
  opacity: 0.65;
  cursor: wait;
  transform: none;
}

.customizer {
  overflow: hidden;
  border: 1.5px solid var(--indigo);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 6px 20px var(--customizer-glow);
  transition: box-shadow var(--ease), border-color var(--ease);
}

.customizer:hover {
  box-shadow: 0 8px 26px var(--customizer-glow-hover);
}

.customizer summary {
  min-height: 58px;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 0 17px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.customizer summary::-webkit-details-marker {
  display: none;
}

.customizer summary:hover {
  background: var(--surface-soft);
}

.summary-title {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  font-weight: 700;
}

.summary-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 9px;
  background: var(--indigo-soft);
  color: var(--indigo);
}

.summary-title svg,
.chevron {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.summary-title svg {
  color: var(--indigo);
}

.summary-hint {
  color: var(--muted);
  font-size: 12px;
}

.chevron {
  color: var(--muted);
  transition: transform var(--ease);
}

.customizer[open] .chevron {
  transform: rotate(180deg);
}

.customizer-body {
  display: grid;
  gap: 20px;
  padding: 20px 17px 18px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.custom-section {
  display: grid;
  gap: 10px;
}

.contrast-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--emerald);
  font-size: 12px;
  font-weight: 600;
}

.contrast-status.bad {
  color: var(--danger);
}

.presets {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.preset {
  width: 37px;
  height: 37px;
  position: relative;
  overflow: hidden;
  border: 2px solid var(--surface);
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 0 0 1px var(--line-strong);
  transition: transform var(--ease), box-shadow var(--ease);
}

.preset:hover,
.preset:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 0 0 2px var(--indigo), var(--shadow-sm);
}

.preset span {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--preset-fg) 0 48%, var(--preset-bg) 48% 100%);
}

.custom-grid {
  display: grid;
  gap: 14px;
}

.custom-grid.two-columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.control-field {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.color-control,
.select-wrap,
.file-control {
  min-height: 49px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}

.color-control {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 11px;
}

.color-control input[type="color"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.color-preview {
  width: 29px;
  height: 29px;
  flex: 0 0 auto;
  border: 1px solid rgba(23, 23, 42, 0.18);
  border-radius: 8px;
  background: var(--swatch, #000);
}

.color-value,
.label-row output {
  color: var(--muted-strong);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.range-field {
  align-content: start;
}

input[type="range"] {
  width: 100%;
  height: 22px;
  margin: 0;
  appearance: none;
  background: transparent;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 5px;
  border-radius: 999px;
  background: #dedde8;
}

input[type="range"]::-webkit-slider-thumb {
  width: 18px;
  height: 18px;
  margin-top: -6.5px;
  appearance: none;
  border: 3px solid var(--surface);
  border-radius: 50%;
  background: var(--indigo);
  box-shadow: 0 0 0 1px var(--indigo), 0 2px 5px rgba(23, 23, 42, 0.2);
}

input[type="range"]::-moz-range-track {
  height: 5px;
  border: 0;
  border-radius: 999px;
  background: #dedde8;
}

input[type="range"]::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border: 3px solid var(--surface);
  border-radius: 50%;
  background: var(--indigo);
  box-shadow: 0 0 0 1px var(--indigo), 0 2px 5px rgba(23, 23, 42, 0.2);
}

.select-wrap {
  position: relative;
  overflow: hidden;
}

.select-wrap select {
  min-height: 47px;
  padding: 0 42px 0 12px;
  border: 0;
  background: transparent;
  appearance: none;
  font-size: 13px;
}

.select-wrap svg {
  position: absolute;
  top: 50%;
  right: 12px;
  width: 17px;
  height: 17px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.8;
  transform: translateY(-50%);
  pointer-events: none;
}

.file-control {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  padding: 6px 12px;
  cursor: pointer;
  transition: border-color var(--ease), background var(--ease);
}

.file-control:hover {
  border-color: var(--indigo);
  background: var(--indigo-soft);
}

.file-control span {
  overflow: hidden;
  color: var(--indigo);
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-control small {
  color: var(--muted);
  font-size: 10px;
}

.trust-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: auto;
  padding-top: 29px;
}

.trust-item {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
}

.trust-item + .trust-item {
  border-left: 1px solid var(--line);
}

.trust-item svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.preview-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 22px;
}

.preview-heading h2 {
  margin: 4px 0 0;
  font-family: "Manrope", "Inter", sans-serif;
  font-size: 22px;
  letter-spacing: -0.035em;
}

.preview-kicker {
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.privacy-chip {
  min-height: 31px;
  padding: 0 9px;
  border-radius: 8px;
  font-size: 10px;
}

.privacy-chip svg {
  width: 14px;
  height: 14px;
}

.qr-stage {
  width: min(100%, 330px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  margin: 0 auto;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--stage-bg);
  box-shadow: 0 9px 28px var(--shadow-tint);
}

.qr-placeholder {
  max-width: 250px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  text-align: center;
}

.placeholder-mark {
  width: 90px;
  height: 90px;
  display: grid;
  place-items: center;
  margin-bottom: 4px;
  border-radius: 20px;
  background: var(--indigo-soft);
  color: var(--indigo);
}

.placeholder-mark svg {
  width: 58px;
  height: 58px;
  fill: currentColor;
}

.qr-placeholder strong {
  color: var(--ink);
  font-family: "Manrope", "Inter", sans-serif;
  font-size: 16px;
}

.qr-placeholder > span:last-child {
  font-size: 12px;
  line-height: 1.55;
}

.qr-holder {
  width: 100%;
  height: 100%;
  animation: qr-in 230ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.qr-holder canvas,
.qr-holder img {
  width: 100% !important;
  height: 100% !important;
  display: block;
  object-fit: contain;
  image-rendering: pixelated;
}

@keyframes qr-in {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

.preview-status {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #a9a9b2;
}

.preview-status.ready {
  color: var(--emerald);
}

.preview-status.ready .status-dot {
  background: var(--emerald);
  box-shadow: 0 0 0 5px rgba(5, 122, 85, 0.1);
}

.preview-status.error {
  color: var(--danger);
}

.preview-status.error .status-dot {
  background: var(--danger);
}

.preview-status.updating .status-dot {
  background: var(--indigo);
  animation: status-pulse 900ms ease-in-out infinite;
}

@keyframes status-pulse {
  50% { opacity: 0.35; transform: scale(0.7); }
}

.preview-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px;
}

.download-button,
.copy-button {
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid var(--indigo);
  border-radius: 10px;
  background: var(--surface);
  color: var(--indigo);
  cursor: pointer;
  font-weight: 700;
  transition: color var(--ease), background var(--ease), transform var(--ease), opacity var(--ease);
}

.download-button {
  font-size: 16px;
}

.copy-button {
  min-width: 92px;
  border-color: var(--line-strong);
  color: var(--muted-strong);
  font-size: 13px;
}

.download-button svg,
.copy-button svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.download-button:hover:not(:disabled) {
  background: var(--indigo);
  color: #fff;
  transform: translateY(-1px);
}

.copy-button:hover:not(:disabled) {
  border-color: var(--indigo);
  color: var(--indigo);
  background: var(--indigo-soft);
}

.download-button:disabled,
.copy-button:disabled {
  border-color: var(--line);
  background: #f4f3f0;
  color: #9d9da6;
  cursor: not-allowed;
  opacity: 0.72;
}

.preview-note {
  margin: 14px 4px 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
  text-align: center;
}

.how-it-works {
  padding: 92px 0 86px;
  text-align: center;
}

.how-it-works h2 {
  margin: 10px 0 34px;
  font-family: "Manrope", "Inter", sans-serif;
  font-size: clamp(32px, 3.2vw, 44px);
  letter-spacing: -0.05em;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  text-align: left;
}

.steps article {
  min-height: 150px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 25px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-glass);
}

.steps article > span {
  width: 36px;
  height: 36px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 10px;
  background: var(--indigo-soft);
  color: var(--indigo);
  font-family: "Manrope", "Inter", sans-serif;
  font-weight: 800;
}

.steps h3 {
  margin: 1px 0 8px;
  font-family: "Manrope", "Inter", sans-serif;
  font-size: 17px;
  letter-spacing: -0.025em;
}

.steps p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

footer {
  border-top: 1px solid var(--line);
  background: var(--footer-bg);
}

.footer-inner {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 13px;
}

.footer-inner p {
  margin: 0;
}

.footer-inner a {
  color: var(--indigo);
  font-weight: 700;
  text-decoration: none;
}

.footer-inner a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: calc(22px + env(safe-area-inset-bottom));
  z-index: 100;
  max-width: min(390px, calc(100vw - 32px));
  padding: 13px 17px;
  border: 1px solid var(--emerald-line);
  border-radius: 11px;
  background: var(--surface);
  color: var(--emerald);
  box-shadow: 0 14px 40px var(--shadow-tint);
  font-size: 13px;
  font-weight: 650;
  opacity: 0;
  pointer-events: none;
  transform: translateY(14px);
  transition: opacity var(--ease), transform var(--ease);
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.error {
  border-color: #f0bbb6;
  color: var(--danger);
}

@media (max-width: 1100px) {
  .generator-panel,
  .preview-panel {
    padding: 30px;
  }

  .workspace {
    grid-template-columns: minmax(0, 1.32fr) minmax(340px, 1fr);
  }

  .type-tab {
    gap: 6px;
    padding-inline: 8px;
    font-size: 14px;
  }

  .primary-types {
    grid-template-columns: repeat(4, minmax(82px, 1fr));
  }

  .trust-item {
    gap: 8px;
    font-size: 14px;
  }
}

@media (min-width: 1200px) {
  .hero {
    max-width: 1240px;
  }

  .hero h1 {
    max-width: none;
    font-size: 48px;
    white-space: nowrap;
  }
}

@media (max-width: 960px) {
  .hero {
    padding-top: 44px;
  }

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

  .preview-panel {
    position: static;
    border-top: 1px solid var(--line);
    border-left: 0;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  }

  .qr-stage {
    width: min(100%, 390px);
  }

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

  .steps article {
    min-height: auto;
  }
}

@media (max-width: 720px) {
  .header-inner,
  .footer-inner,
  main {
    width: min(100% - 32px, 1290px);
  }

  .header-inner {
    min-height: 70px;
  }

  .brand {
    gap: 9px;
    font-size: 20px;
  }

  .brand-mark {
    width: 41px;
    height: 41px;
  }

  .free-badge {
    width: 42px;
    padding: 0;
    justify-content: center;
  }

  .free-badge span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }

  .lang-switch {
    min-width: 75px;
    padding-inline: 10px;
  }

  .header-actions {
    gap: 8px;
  }

  .hero {
    padding: 38px 0 27px;
  }

  .hero h1 {
    margin-top: 11px;
    font-size: clamp(35px, 9.5vw, 48px);
    letter-spacing: -0.05em;
  }

  .hero-copy {
    font-size: 16px;
    line-height: 1.55;
  }

  .generator-panel,
  .preview-panel {
    padding: 24px 20px;
  }

  .primary-types {
    display: flex;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .primary-types::-webkit-scrollbar {
    display: none;
  }

  .primary-types .type-tab {
    min-width: 92px;
    flex: 1 0 auto;
  }

  .more-trigger {
    min-width: 76px;
  }

  .form-grid,
  .custom-grid.two-columns {
    grid-template-columns: 1fr;
  }

  .form-field.full {
    grid-column: auto;
  }

  .customizer summary {
    grid-template-columns: 1fr auto;
  }

  .summary-hint {
    display: none;
  }

  .trust-row {
    padding-top: 24px;
  }

  .trust-item {
    flex-direction: column;
    gap: 6px;
    font-size: 12px;
  }

  .trust-item svg {
    width: 22px;
    height: 22px;
  }

  .how-it-works {
    padding: 70px 0 66px;
  }

  .footer-inner {
    min-height: 96px;
    flex-direction: column;
    justify-content: center;
    text-align: center;
  }
}

@media (max-width: 440px) {
  .header-inner,
  .footer-inner,
  main {
    width: min(100% - 24px, 1290px);
  }

  .brand {
    font-size: 18px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .free-badge {
    display: none;
  }

  .workspace {
    border-radius: 14px;
  }

  .generator-panel,
  .preview-panel {
    padding: 21px 15px;
  }

  .type-nav {
    margin-bottom: 23px;
  }

  .primary-types .type-tab {
    min-width: 64px;
    min-height: 54px;
    flex-direction: column;
    gap: 4px;
    padding-inline: 3px;
    font-size: 11px;
  }

  .more-trigger {
    min-width: 54px;
    min-height: 54px;
    flex-direction: column;
    gap: 4px;
    font-size: 11px;
  }

  .more-menu {
    position: fixed;
    top: auto;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    left: 12px;
    width: auto;
    max-height: min(60vh, 420px);
    overflow-y: auto;
    padding-top: 16px;
    border-radius: 18px;
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.28), 0 20px 50px var(--shadow-tint);
    animation: sheet-rise 220ms cubic-bezier(0.22, 1, 0.36, 1);
  }

  .more-menu::before {
    content: "";
    position: sticky;
    top: -8px;
    display: block;
    width: 40px;
    height: 4px;
    margin: 0 auto 12px;
    border-radius: 999px;
    background: var(--line-strong);
  }

  .more-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 19;
    background: rgba(8, 8, 15, 0.5);
    backdrop-filter: blur(2px);
    animation: backdrop-fade 220ms ease;
  }

  .more-backdrop[hidden] { display: none; }

  @keyframes sheet-rise {
    from { transform: translateY(16px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
  }

  @keyframes backdrop-fade {
    from { opacity: 0; }
    to { opacity: 1; }
  }

  .form-input,
  .form-select {
    min-height: 54px;
  }

  .generate-button {
    min-height: 58px;
    font-size: 16px;
  }

  .preview-heading {
    flex-direction: column;
  }

  .qr-stage {
    padding: 15px;
  }

  .preview-actions {
    grid-template-columns: 1fr;
  }

  .copy-button {
    min-width: 0;
  }

  .toast {
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    left: 12px;
    max-width: none;
  }
}

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

@media (forced-colors: active) {
  .type-tab.active::after,
  .type-tab[aria-selected="true"]::after,
  .status-dot {
    background: CanvasText;
  }
}

/* ═══════════════════════════════════════════
   ESTILO DE PUNTOS Y FORMA DEL QR
   ═══════════════════════════════════════════ */
.shape-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.shape-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 4px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: var(--muted);
  cursor: pointer;
  transition: transform var(--ease), border-color var(--ease), color var(--ease), background var(--ease);
}

.shape-option:hover {
  transform: translateY(-2px);
  border-color: var(--indigo);
  color: var(--ink);
}

.shape-option:focus-visible {
  box-shadow: var(--focus);
  outline: none;
}

.shape-option[aria-pressed="true"] {
  border-color: var(--indigo);
  background: var(--indigo-soft);
  color: var(--indigo);
  box-shadow: 0 0 0 1px var(--indigo) inset;
}

.shape-option svg {
  width: 26px;
  height: 26px;
}

.shape-option .shape-name {
  font-size: 11px;
  font-weight: 600;
  line-height: 1.15;
  text-align: center;
}

@media (max-width: 720px) {
  .shape-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 440px) {
  .shape-grid { gap: 6px; }
  .shape-option { padding: 9px 3px 7px; }
  .shape-option svg { width: 23px; height: 23px; }
  .theme-switch { width: 40px; }
}

/* ═══════════════════════════════════════════
   MODO OSCURO
   ═══════════════════════════════════════════ */
:root[data-theme="dark"] {
  --canvas: #0d0d15;
  --surface: #191926;
  --surface-soft: #16161f;
  --ink: #eceaf5;
  --muted: #9e9db2;
  --muted-strong: #c6c5d6;
  --line: #2b2b3c;
  --line-strong: #3a3a4f;
  --indigo: #a5b4fc;
  --indigo-hover: #c7d2fe;
  --indigo-soft: #23233a;
  --emerald: #4ade9f;
  --emerald-soft: #12291d;
  --danger: #ff9084;
  --danger-soft: #33191a;
  --warning: #f7c948;
  --warning-soft: #332a12;
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.4);
  --shadow-card: 0 18px 50px rgba(0, 0, 0, 0.5);
  --focus: 0 0 0 4px rgba(165, 180, 252, 0.28);

  --surface-glass: rgba(25, 25, 38, 0.88);
  --field-bg: #12121c;
  --stage-bg: #12121c;
  --footer-bg: rgba(25, 25, 38, 0.5);
  --chip-bg: rgba(18, 41, 29, 0.6);
  --control-bg: rgba(25, 25, 38, 0.7);
  --emerald-line: #2b5142;
  --shadow-tint: rgba(0, 0, 0, 0.5);
  --placeholder: #75748a;
  --line-hover: #4c4c66;
  --aurora-1: rgba(99, 91, 220, 0.22);
  --aurora-2: rgba(28, 160, 140, 0.16);
  --aurora-3: rgba(180, 90, 200, 0.14);
  --particle: rgba(190, 190, 255, 0.5);
  --toggle-border: rgba(165, 180, 252, 0.5);
  --toggle-glow: rgba(165, 180, 252, 0.65);
  --customizer-glow: rgba(165, 180, 252, 0.18);
  --customizer-glow-hover: rgba(165, 180, 252, 0.3);

  color-scheme: dark;
}

:root[data-theme="dark"] body {
  background:
    radial-gradient(circle at 50% 16%, rgba(86, 84, 156, 0.20) 0, rgba(0, 0, 0, 0) 37rem),
    var(--canvas);
}

:root[data-theme="dark"] .site-header {
  background: rgba(11, 11, 18, 0.97);
}

:root[data-theme="dark"] .generate-button {
  background: linear-gradient(112deg, #4f46b8 0%, #7c7ae0 100%);
  color: #fff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
}

:root[data-theme="dark"] .download-button:hover:not(:disabled) {
  color: #11111b;
}

:root[data-theme="dark"] .color-preview {
  border-color: rgba(255, 255, 255, 0.22);
}

/* El QR conserva su propio fondo claro para seguir siendo escaneable */
:root[data-theme="dark"] .qr-holder canvas {
  border-radius: 12px;
}

/* Botón de tema */
.theme-switch {
  width: 42px;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--control-bg);
  color: var(--muted-strong);
  cursor: pointer;
  transition: background var(--ease), border-color var(--ease), box-shadow var(--ease), color var(--ease);
}

.theme-switch:hover {
  border-color: var(--indigo);
  background: var(--surface);
  color: var(--ink);
}

.theme-switch:focus-visible {
  box-shadow: var(--focus);
  outline: none;
}

.theme-switch svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-switch .icon-sun { display: none; }
:root[data-theme="dark"] .theme-switch .icon-moon { display: none; }
:root[data-theme="dark"] .theme-switch .icon-sun { display: block; }

/* Transición suave al cambiar de tema */
.workspace,
.generator-panel,
.preview-panel,
.customizer-body,
.qr-stage,
.form-input,
.form-select,
.form-textarea,
.select-wrap select,
.steps article,
footer,
.site-header {
  transition: background-color 320ms ease, border-color 320ms ease, color 320ms ease;
}

/* ═══════════════════════════════════════════
   FONDO ANIMADO (aurora + partículas)
   ═══════════════════════════════════════════ */
.bg-fx {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.bg-fx canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.aurora {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  will-change: transform;
}

.aurora-a {
  width: 46vw;
  height: 46vw;
  min-width: 320px;
  min-height: 320px;
  top: -12vh;
  left: -8vw;
  background: var(--aurora-1);
  animation: aurora-drift-a 26s ease-in-out infinite alternate;
}

.aurora-b {
  width: 40vw;
  height: 40vw;
  min-width: 280px;
  min-height: 280px;
  top: 30vh;
  right: -10vw;
  background: var(--aurora-2);
  animation: aurora-drift-b 32s ease-in-out infinite alternate;
}

.aurora-c {
  width: 34vw;
  height: 34vw;
  min-width: 240px;
  min-height: 240px;
  bottom: -14vh;
  left: 28vw;
  background: var(--aurora-3);
  animation: aurora-drift-c 38s ease-in-out infinite alternate;
}

@keyframes aurora-drift-a {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(7vw, 9vh, 0) scale(1.14); }
}

@keyframes aurora-drift-b {
  from { transform: translate3d(0, 0, 0) scale(1.08); }
  to   { transform: translate3d(-9vw, -7vh, 0) scale(0.94); }
}

@keyframes aurora-drift-c {
  from { transform: translate3d(0, 0, 0) scale(0.96); }
  to   { transform: translate3d(6vw, -10vh, 0) scale(1.18); }
}

/* Las partículas solo aparecen en modo oscuro */
.bg-fx canvas { opacity: 0; transition: opacity 600ms ease; }
:root[data-theme="dark"] .bg-fx canvas { opacity: 1; }

/* En modo claro la aurora es mucho más tenue */
:root:not([data-theme="dark"]) .aurora { filter: blur(110px); opacity: 0.85; }

@media (prefers-reduced-motion: reduce) {
  .aurora { animation: none !important; }
  .bg-fx canvas { display: none; }
}

/* ═══════════════════════════════════════════
   MINIJUEGO FLOTANTE
   ═══════════════════════════════════════════ */
.game-toggle {
  position: fixed;
  right: 18px;
  bottom: 88px;
  z-index: 60;
  width: 52px;
  height: 52px;
  display: none;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--toggle-border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--indigo);
  cursor: pointer;
  box-shadow: var(--shadow-card), 0 0 0 0 var(--toggle-glow);
  transition: transform var(--ease), background var(--ease), box-shadow var(--ease);
  animation: game-bounce 2.6s ease-in-out infinite, game-glow 2.4s ease-in-out infinite;
  overflow: visible;
}

.game-toggle svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 0 3px var(--toggle-glow));
}

.game-toggle-glow {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--toggle-glow) 0%, transparent 68%);
  opacity: 0;
  animation: game-shine 2.4s ease-in-out infinite;
  pointer-events: none;
}

.game-toggle:not([hidden]) { display: flex; }
.game-toggle:hover {
  transform: translateY(-2px) scale(1.06);
  animation-play-state: paused;
  background: var(--indigo-soft);
}

@keyframes game-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

@keyframes game-glow {
  0%, 100% { box-shadow: var(--shadow-card), 0 0 0 0 var(--toggle-glow); }
  50% { box-shadow: var(--shadow-card), 0 0 16px 5px var(--toggle-glow); }
}

@keyframes game-shine {
  0%, 100% { opacity: 0; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1.15); }
}

.game-widget {
  position: fixed;
  right: 18px;
  bottom: 88px;
  z-index: 61;
  width: 280px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-glass);
  backdrop-filter: blur(16px) saturate(160%);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  animation: game-pop 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.game-widget[hidden] { display: none; }

@keyframes game-pop {
  from { transform: translateY(14px) scale(0.95); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.game-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 8px 10px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

#gameTitle {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-head-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.game-score { font-size: 11px; font-weight: 600; color: var(--muted); }

.game-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  border-radius: 9px;
  cursor: pointer;
  transition: background var(--ease), color var(--ease), border-color var(--ease), transform 120ms ease;
}

.game-close svg {
  width: 15px;
  height: 15px;
  pointer-events: none;
}

.game-close:hover { color: var(--ink); background: var(--indigo-soft); }
.game-close:active { transform: scale(0.92); }
.game-close:focus-visible { outline: none; box-shadow: var(--focus); border-color: var(--indigo); }

@media (max-width: 480px) {
  .game-close { width: 38px; height: 38px; }
  .game-close svg { width: 17px; height: 17px; }
  .game-head { padding-right: 6px; font-size: 12px; }
  .game-score-label { display: none; }
  .game-score::before { content: "★ "; }
}

#gameCanvas {
  display: block;
  width: 100%;
  height: auto;
  background: #0b0b12;
  cursor: pointer;
  touch-action: none;
  outline: none;
}

.game-widget.mode-light #gameCanvas { background: #e9eef3; }

.game-widget:focus-within #gameCanvas { box-shadow: inset 0 0 0 2px var(--indigo); }

.game-hint {
  margin: 0;
  padding: 8px 12px;
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  border-top: 1px solid var(--line);
}

@media (max-width: 480px) {
  .game-toggle, .game-widget { right: 12px; bottom: 76px; }
  .game-widget { width: 232px; }
}

@media (prefers-reduced-motion: reduce) {
  .game-toggle { animation: none; }
}

/* ═══════════════════════════════════════════
   MICRO-ANIMACIONES
   ═══════════════════════════════════════════ */
@keyframes select-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.16); }
  100% { transform: scale(1); }
}

.preset.pop,
.shape-option.pop {
  animation: select-pop 320ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes qr-pop-in {
  0% { opacity: 0; transform: scale(0.88); }
  60% { opacity: 1; transform: scale(1.03); }
  100% { opacity: 1; transform: scale(1); }
}

.qr-pop-in { animation: qr-pop-in 380ms cubic-bezier(0.22, 1, 0.36, 1); }

/* Feedback táctil en botones principales */
.generate-button:active,
.btn-secondary:active,
.download-button:active {
  transform: scale(0.97);
}

.generate-button,
.btn-secondary,
.download-button {
  transition: transform 120ms ease, background var(--ease), border-color var(--ease), box-shadow var(--ease), color var(--ease);
}

@media (prefers-reduced-motion: reduce) {
  .preset.pop,
  .shape-option.pop,
  .qr-pop-in {
    animation: none !important;
  }
  .generate-button:active,
  .btn-secondary:active,
  .download-button:active {
    transform: none;
  }
}

/* ═══════════════════════════════════════════
   INTERRUPTOR CREAR / LEER
   ═══════════════════════════════════════════ */
.mode-switch {
  display: inline-flex;
  gap: 4px;
  margin: 0 auto 22px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  width: fit-content;
}

.mode-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--ease), color var(--ease), box-shadow var(--ease);
}

.mode-tab svg { width: 16px; height: 16px; flex-shrink: 0; }

.mode-tab:hover { color: var(--ink); }

.mode-tab[aria-selected="true"] {
  background: var(--surface);
  color: var(--indigo);
  box-shadow: var(--shadow-sm);
}

.mode-tab:focus-visible { outline: none; box-shadow: var(--focus); }

@media (max-width: 480px) {
  .mode-switch { width: 100%; }
  .mode-tab { flex: 1; justify-content: center; padding: 9px 10px; font-size: 12.5px; }
}

/* ═══════════════════════════════════════════
   LECTOR DE QR
   ═══════════════════════════════════════════ */
.scanner-workspace .generator-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.scanner-title { margin: 0; font-size: 21px; font-weight: 800; color: var(--ink); }
.scanner-sub { margin: -8px 0 0; color: var(--muted); font-size: 14px; }

.scan-source-tabs {
  display: flex;
  gap: 8px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.scan-source-tab {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--ease), color var(--ease);
}

.scan-source-tab svg { width: 16px; height: 16px; }
.scan-source-tab[aria-selected="true"] { background: var(--surface); color: var(--indigo); box-shadow: var(--shadow-sm); }
.scan-source-tab:focus-visible { outline: none; box-shadow: var(--focus); }

.scan-camera-view {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 320px;
  border-radius: var(--radius);
  background: #0b0b12;
  overflow: hidden;
  padding: 20px;
  text-align: center;
}

#scanVideo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 260ms ease;
}

.scan-camera-view.is-live #scanVideo { opacity: 1; }
.scan-camera-view.is-live .scan-camera-msg { color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,0.6); }

.scan-reticle {
  position: absolute;
  inset: 14%;
  border: 2.5px solid rgba(255, 255, 255, 0.85);
  border-radius: 22px;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.28);
  opacity: 0;
  transition: opacity 260ms ease;
  pointer-events: none;
}

.scan-camera-view.is-live .scan-reticle { opacity: 1; }
.scan-camera-view.is-live .scan-reticle::after {
  content: "";
  position: absolute;
  left: 6%;
  right: 6%;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--emerald) 20%, var(--emerald) 80%, transparent);
  animation: scan-line 2.1s ease-in-out infinite;
}

@keyframes scan-line {
  0%, 100% { top: 4%; opacity: 0.9; }
  50% { top: 92%; opacity: 0.5; }
}

.scan-camera-msg { position: relative; z-index: 2; color: var(--muted); font-size: 13.5px; max-width: 260px; margin: 0; }

.scan-camera-btn { position: relative; z-index: 2; }

.scan-upload-view { display: flex; flex-direction: column; }

.scan-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 320px;
  border: 2px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--muted);
  text-align: center;
  padding: 24px;
  cursor: pointer;
  transition: border-color var(--ease), background var(--ease), transform var(--ease);
}

.scan-dropzone svg { width: 30px; height: 30px; color: var(--indigo); margin-bottom: 4px; }
.scan-dropzone-title { font-weight: 700; color: var(--ink); font-size: 14px; }
.scan-dropzone-sub { font-size: 12.5px; }

.scan-dropzone:hover,
.scan-dropzone:focus-visible {
  border-color: var(--indigo);
  background: var(--indigo-soft);
}

.scan-dropzone.drag-over {
  border-color: var(--indigo);
  background: var(--indigo-soft);
  transform: scale(1.01);
}

.scan-result {
  border: 1px solid var(--emerald-line);
  border-radius: var(--radius);
  background: var(--emerald-soft);
  padding: 16px;
  animation: qr-pop-in 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

.scan-result-head {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--emerald);
  font-weight: 700;
  font-size: 13.5px;
  margin-bottom: 8px;
}

.scan-result-head svg { width: 17px; height: 17px; }

.scan-result-text {
  margin: 0 0 14px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
  max-height: 140px;
  overflow-y: auto;
}

.scan-result-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.scan-result-actions .btn-secondary { flex: 1; min-width: 120px; justify-content: center; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--muted-strong);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: color var(--ease), background var(--ease), border-color var(--ease), transform var(--ease);
}

.btn-secondary svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn-secondary:hover {
  border-color: var(--indigo);
  color: var(--indigo);
  background: var(--indigo-soft);
}

.btn-secondary:focus-visible { outline: none; box-shadow: var(--focus); }
.btn-secondary[hidden] { display: none; }

.scanner-note {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 720px) {
  .scan-camera-view, .scan-dropzone { min-height: 260px; }
}
