@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&display=swap");

:root {
  color-scheme: dark;

  --background: #080510;
  --surface: #13101d;
  --text: #f7f5fc;
  --muted: #b6afc7;
  --border: rgb(255 255 255 / 10%);
  --purple: #923bff;
  --pink: #ed399d;
  --error: #ffaaaa;
  --gradient: linear-gradient(110deg, #8538f5, #e83c9e);

  font-family: "Poppins", sans-serif;
  color: var(--text);
  background: var(--background);
}

* {
  box-sizing: border-box;
}

body {
  min-width: 280px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(
      ellipse at 10% 15%,
      rgb(125 48 204 / 20%),
      transparent 42%
    ),
    radial-gradient(
      ellipse at 95% 65%,
      rgb(222 47 139 / 14%),
      transparent 42%
    ),
    var(--background);
}

button,
input,
textarea {
  font: inherit;
}

button,
a,
input,
label {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid #d1a1ff;
  outline-offset: 4px;
}

::selection {
  background: #7734bb;
  color: white;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Header */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  max-width: 1280px;
  margin: auto;
  padding: 24px 40px;
  border-bottom: 1px solid var(--border);
}

.brand {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
}

.brand-name {
  background: linear-gradient(110deg, #c066f4, #fb5297);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -1.2px;
}

.brand-product {
  padding: 5px 10px;
  border: 1px solid #624078;
  border-radius: 7px;
  background: #21132d;
  color: #e4c5ff;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.header-caption {
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.4px;
}

/* Introduction */

.app {
  max-width: 1160px;
  margin: auto;
  padding: 40px 28px 28px;
}

.app-header {
  margin-bottom: 30px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  margin: 0 0 18px;
  padding: 8px 14px;
  border: 1px solid #513064;
  border-radius: 100px;
  background: #130b20;
  color: #ddd2eb;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 1px;
}

.eyebrow > span {
  flex-shrink: 0;
  color: #e6b8ff;
  font-size: 15px;
}

.app-header h1 {
  margin: 0 0 16px;
  font-size: clamp(32px, 4.6vw, 56px);
  font-weight: 700;
  line-height: 1.16;
  letter-spacing: -1.8px;
  text-wrap: balance;
}

.gradient-text {
  background: linear-gradient(
    100deg,
    #f16cae 0%,
    #c48cf9 50%,
    #82a8fc 100%
  );
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
}

.app-header > p:last-child {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
}

/* Workspace */

.generator {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 20px;
  align-items: start;
}

.input-panel,
.preview-panel {
  min-width: 0;
  padding: 30px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: rgb(21 16 31 / 92%);
  box-shadow:
    0 16px 45px rgb(0 0 0 / 18%),
    inset 0 1px 0 rgb(255 255 255 / 3%);
}

@supports (backdrop-filter: blur(16px)) {
  .input-panel,
  .preview-panel {
    background: rgb(26 20 36 / 68%);
    backdrop-filter: blur(16px);
  }
}

.preview-panel {
  background:
    radial-gradient(
      ellipse at 100% 100%,
      rgb(218 49 138 / 10%),
      transparent 65%
    ),
    rgb(21 16 31 / 92%);
}

.panel-heading {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 25px;
}

.panel-heading > div {
  min-width: 0;
}

.step-number {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 41px;
  height: 41px;
  border: 1px solid #634080;
  border-radius: 13px;
  background: #2b173e;
  color: #e0b7ff;
  font-size: 13px;
  font-weight: 600;
}

.preview-panel .step-number {
  border-color: #7a365d;
  background: #371628;
  color: #ffb5d9;
}

.panel-kicker {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 1.4px;
}

.panel-heading h2 {
  margin: 0;
  font-size: 19px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.5px;
}

/* Content tabs */

.content-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  min-width: 0;
  margin: 0 0 25px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #0c0813;
}

.type-option {
  position: relative;
  min-width: 0;
  cursor: pointer;
}

.type-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
}

.type-option > span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 8px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
}

.tab-symbol {
  font-size: 17px;
  line-height: 1;
}

.type-option:hover > span {
  background: #241731;
  color: white;
}

.type-option input:checked + span {
  border-color: #9856cf;
  background: linear-gradient(110deg, #542482, #6d2457);
  color: white;
  box-shadow: 0 3px 16px rgb(154 52 219 / 13%);
}

.type-option input:focus-visible + span {
  outline: 3px solid #e3bcff;
  outline-offset: 2px;
}

/* Text and link input */

#text-fields > label,
#image-fields > label {
  display: block;
  margin-bottom: 10px;
  color: #eee7f6;
  font-size: 14px;
  font-weight: 500;
}

textarea {
  display: block;
  width: 100%;
  min-height: 165px;
  padding: 16px;
  resize: vertical;
  border: 1px solid #50405e;
  border-radius: 12px;
  background: #0f0a17;
  color: var(--text);
  font-size: 16px;
  line-height: 1.7;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}

textarea::placeholder {
  color: #a296af;
}

textarea:focus-visible {
  border-color: #b86df4;
  box-shadow: 0 0 22px rgb(156 63 233 / 8%);
}

.field-hint,
.processing-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.processing-note {
  margin-top: 17px;
}

/* Image upload */

.upload-area {
  padding: 24px 18px;
  border: 2px dashed #674878;
  border-radius: 14px;
  background: #170e22;
  text-align: center;
  transition:
    border-color 160ms ease,
    background-color 160ms ease;
}

.upload-area:hover,
.upload-area:focus-within {
  border-color: #c67bf5;
  background: #21122f;
}

.upload-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin: 0 auto 15px;
  border: 1px solid #784695;
  border-radius: 16px;
  background: linear-gradient(135deg, #482363, #582344);
  color: #f0c8ff;
  font-size: 30px;
}

.upload-area h3 {
  margin: 0 0 9px;
  font-size: 16px;
  font-weight: 600;
}

.upload-area p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

input[type="file"] {
  display: block;
  width: 100%;
  min-width: 0;
  color: var(--muted);
  font-size: 14px;
}

input[type="file"]::file-selector-button {
  margin-right: 10px;
  padding: 11px 14px;
  border: 1px solid #85559b;
  border-radius: 8px;
  background: #342044;
  color: #f0dcff;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}

input[type="file"]::file-selector-button:hover {
  background: #49265e;
}

.image-preview {
  overflow: hidden;
  margin-top: 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #0d0912;
}

#image-preview {
  display: block;
  width: 100%;
  height: 210px;
  padding: 12px;
  object-fit: contain;
}

.image-details {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  background: #1b1225;
}

#image-name {
  min-width: 0;
  max-width: 100%;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.text-button {
  flex-shrink: 0;
  padding: 8px 0;
  border: none;
  background: transparent;
  color: #efb1e0;
  font-size: 14px;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* Generate and download buttons */

.primary-button,
.download-button {
  display: block;
  width: 100%;
  min-height: 52px;
  padding: 14px 18px;
  border: 1px solid transparent;
  border-radius: 100px;
  background: var(--gradient);
  color: white;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  text-shadow: 0 1px 2px rgb(0 0 0 / 20%);
  box-shadow: 0 6px 22px rgb(163 44 195 / 16%);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    filter 160ms ease;
}

.primary-button:hover:not(:disabled),
.download-button:hover:not(:disabled) {
  transform: translateY(-2px);
  filter: brightness(1.08);
  box-shadow: 0 10px 28px rgb(192 49 179 / 28%);
}

.primary-button:active:not(:disabled),
.download-button:active:not(:disabled) {
  transform: translateY(0);
}

button:disabled {
  cursor: not-allowed;
}

.primary-button:disabled,
.download-button:disabled {
  border-color: #4e3b5c;
  background: #302237;
  color: #bfb0c8;
  box-shadow: none;
  text-shadow: none;
}

.error {
  min-height: 22px;
  margin: 14px 0;
  color: var(--error);
  font-size: 14px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

/* QR preview */

.qr-container {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 280px;
  padding: 22px;
  border: 1px solid #eee7f5;
  border-radius: 17px;
  background: white;
  color: #24172f;
  box-shadow: 0 8px 30px rgb(0 0 0 / 15%);
}

.empty-state {
  text-align: center;
}

.empty-icon {
  display: block;
  margin-bottom: 18px;
  color: #9b76b8;
  font-size: 80px;
  line-height: 1;
}

.empty-state h3 {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.4px;
}

.empty-state p {
  max-width: 235px;
  margin: auto;
  color: #72627d;
  font-size: 14px;
  line-height: 1.8;
}

#qr-canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

.status {
  min-height: 24px;
  margin: 17px 0;
  color: #d7c6e3;
  font-size: 14px;
  line-height: 1.7;
  text-align: center;
  overflow-wrap: anywhere;
}

.download-hint {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
  text-align: center;
}

.scan-tip {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin-top: 23px;
  padding: 16px;
  border: 1px solid #50314e;
  border-radius: 12px;
  background: #251424;
}

.tip-icon {
  flex-shrink: 0;
  color: #f3a0d0;
  font-size: 21px;
  line-height: 1.4;
}

.scan-tip h3 {
  margin: 0 0 7px;
  color: #f4d6eb;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.6;
}

.scan-tip p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

/* Footer */

.site-footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
  padding-top: 19px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.site-footer p {
  margin: 0;
}

.site-footer p:first-child {
  color: #ddafea;
  font-weight: 600;
}

/* Tablet and mobile */

@media (max-width: 800px) {
  .site-header {
    padding: 20px 24px;
  }

  .app {
    padding: 32px 20px 24px;
  }

  .generator {
    grid-template-columns: 1fr;
  }

  .input-panel,
  .preview-panel {
    padding: 26px;
  }

  .qr-container {
    min-height: 280px;
  }

  #qr-canvas {
    width: min(100%, 340px);
  }
}

@media (max-width: 480px) {
  .site-header {
    padding: 18px;
  }

  .header-caption {
    display: none;
  }

  .brand-name {
    font-size: 25px;
  }

  .app {
    padding: 28px 14px 22px;
  }

  .app-header h1 {
    font-size: 34px;
    letter-spacing: -1.1px;
  }

  .eyebrow {
    padding: 8px 11px;
    font-size: 11px;
    letter-spacing: 0.6px;
  }

  .input-panel,
  .preview-panel {
    padding: 20px;
    border-radius: 18px;
  }

  .panel-heading {
    gap: 10px;
  }

  .panel-heading h2 {
    font-size: 17px;
  }

  .type-option > span {
    gap: 5px;
    padding: 10px 5px;
  }

  .qr-container {
    min-height: 250px;
    padding: 16px;
  }
}

@media (max-width: 350px) {
  .input-panel,
  .preview-panel {
    padding: 16px;
  }

  .tab-symbol {
    display: none;
  }

  .site-footer {
    flex-direction: column;
  }
}

/* Motion and contrast preferences */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
  }
}

@media (forced-colors: active) {
  .brand-name,
  .gradient-text {
    background: none;
    color: CanvasText;
  }

  .type-option input:checked + span {
    outline: 2px solid Highlight;
  }

  .primary-button,
  .download-button {
    border: 1px solid ButtonText;
  }
}
.site-footer {
  align-items: center;
}

.developer-credit {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.site-footer a {
  color: #edb9ff;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 4px;
  transition: color 160ms ease;
}

.site-footer a:hover {
  color: #ff91cb;
}