/* =====================================================================
   Amritaz — QR Code Generator
   Brand tokens mirrored from the AITS theme
   (purple #6502BD, pink #D7458D, gradient CTA, Outfit/Poppins)
   ===================================================================== */

:root {
  --purple: #6502BD;
  --pink: #D7458D;
  --a-grad: linear-gradient(120deg, #6502BD 0%, #9a2bd0 55%, #D7458D 100%);
  --a-band: linear-gradient(125deg, #16042c 0%, #33096a 38%, #5a06b0 70%, #a3378a 100%);
  --focus: #fbcfe8;

  --hf: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
  --bf: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;

  --radius: 18px;
  --radius-sm: 12px;

  /* defaults for dark theme (site default) */
  --bg: #0b0b10;
  --surface: #151520;
  --surface-2: #111116;
  --text: #f5f4f9;
  --muted: #a3a3b5;
  --hairline: rgba(255, 255, 255, .09);
  --input-bg: rgba(255, 255, 255, .04);
  --chip-bg: rgba(168, 85, 247, .14);
  --chip-ic: #d8b4fe;
  --shadow: 0 24px 60px -30px rgba(0, 0, 0, .55);
}

/* Light theme override */
[data-theme="light"] {
  --bg: #f7f5fb;
  --surface: #ffffff;
  --surface-2: #f1edf8;
  --text: #1a1a2e;
  --muted: #55536b;
  --hairline: rgba(26, 26, 46, .10);
  --input-bg: rgba(101, 2, 189, .045);
  --chip-bg: rgba(101, 2, 189, .07);
  --chip-ic: #6502BD;
  --shadow: 0 24px 60px -34px rgba(80, 20, 130, .28);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

html, body { overflow-x: hidden; }

body {
  margin: 0;
  font-family: var(--bf);
  font-weight: 400;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  min-height: 100vh;
  transition: background .3s ease, color .3s ease;
}

/* Frosted colour beacons behind the glass surfaces (pure CSS, no tracking). */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(620px 620px at 6% -4%, rgba(101, 2, 189, .5), transparent 68%),
    radial-gradient(560px 560px at 96% 8%, rgba(215, 69, 141, .38), transparent 70%),
    radial-gradient(560px 560px at 52% 104%, rgba(124, 58, 237, .34), transparent 72%);
  animation: orbsDrift 32s ease-in-out infinite alternate;
}
[data-theme="light"] body::before {
  background:
    radial-gradient(620px 620px at 6% -4%, rgba(101, 2, 189, .18), transparent 66%),
    radial-gradient(560px 560px at 96% 8%, rgba(215, 69, 141, .16), transparent 68%),
    radial-gradient(560px 560px at 52% 104%, rgba(124, 58, 237, .14), transparent 70%);
}

@keyframes orbsDrift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(36px, 28px, 0) scale(1.07); }
}

/* Entrance + ambient animations */
@keyframes rise {
  from { transform: translateY(20px); }
  to   { transform: none; }
}
@keyframes qrGlow {
  0%, 100% { box-shadow: 0 30px 70px -30px rgba(120, 30, 180, .5); }
  50%       { box-shadow: 0 38px 88px -28px rgba(215, 69, 141, .75); }
}

h1, h2, h3, h4 { font-family: var(--hf); margin: 0; font-weight: 700; }

button { font-family: var(--bf); cursor: pointer; }
input, select, textarea { font-family: var(--bf); color: var(--text); }

a { color: var(--chip-ic); }

::selection { background: var(--pink); color: #fff; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }

/* ============ Layout ============ */
.wrap { width: min(1160px, 92%); margin: 0 auto; }

/* ============ Header ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--hairline);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
}

.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }

.brand-logo { display: flex; align-items: center; flex: 0 0 auto; }
.brand-logo img {
  height: 36px;
  width: auto;
  display: block;
  max-width: 170px;
  object-fit: contain;
}
.brand-logo img.logo-color { display: none; }
[data-theme="light"] .brand-logo img.logo-white { display: none; }
[data-theme="light"] .brand-logo img.logo-color { display: block; }

.brand-text { line-height: 1.15; min-width: 0; }
.brand-name { font-family: var(--hf); font-weight: 800; font-size: 1.05rem; letter-spacing: .2px; }
.brand-name em { font-style: normal; background: var(--a-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-sub { font-size: .78rem; color: var(--muted); font-weight: 500; }

.header-cta { display: flex; align-items: center; gap: 12px; }

.icon-btn {
  width: 42px; height: 42px;
  border-radius: 12px;
  border: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--text);
  display: grid; place-items: center;
  transition: transform .15s ease, border-color .2s, background .2s;
}
.icon-btn:hover { transform: translateY(-2px); border-color: var(--chip-ic); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn .icon-sun { display: none; }
[data-theme="light"] .icon-btn .icon-moon { display: none; }
[data-theme="light"] .icon-btn .icon-sun { display: block; }

/* ============ Hero ============ */
.hero {
  text-align: center;
  padding: 56px 0 8px;
  margin: 0 auto 28px;
}
.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .4px;
  text-transform: uppercase;
  color: var(--chip-ic);
  background: var(--chip-bg);
  border: 1px solid var(--hairline);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 18px;
}
.hero-kicker .dot { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; }
.hero h1 { font-size: clamp(1.9rem, 5vw, 3rem); letter-spacing: -.5px; line-height: 1.12; }
.hero h1 .grad { background: var(--a-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p {
  color: var(--muted);
  max-width: 640px;
  margin: 14px auto 0;
  font-size: 1rem;
}

/* ============ Tool grid ============ */
.tool {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 24px;
  align-items: start;
  margin: 0 auto 48px;
}

.card {
  background: rgba(21, 21, 32, .55);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .08);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  margin-bottom: 24px;
  animation: rise .7s cubic-bezier(.22, .7, .25, 1) both;
}
[data-theme="light"] .card {
  background: rgba(255, 255, 255, .62);
  border-color: rgba(101, 2, 189, .14);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .95);
}

.card-title {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--hf);
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 16px;
}
.card-title svg { width: 18px; height: 18px; color: var(--chip-ic); }

/* ---- Type tabs ---- */
.type-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.type-tab {
  border: 1px solid var(--hairline);
  background: var(--input-bg);
  color: var(--text);
  font-weight: 500;
  font-size: .85rem;
  padding: 9px 15px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform .15s ease, background .2s, border-color .2s;
}
.type-tab svg { width: 16px; height: 16px; color: var(--muted); transition: color .2s; }
.type-tab:hover { transform: translateY(-2px); border-color: var(--chip-ic); }
.type-tab.active { background: var(--a-grad); color: #fff; border-color: transparent; }
.type-tab.active svg { color: #fff; }

/* ---- Form ---- */
.field { margin-bottom: 14px; }
.field > label { display: block; font-weight: 600; font-size: .86rem; margin-bottom: 7px; color: var(--text); }
.field .hint { font-size: .8rem; color: var(--muted); margin-top: 6px; }

.input {
  width: 100%;
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: .94rem;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
[data-theme="light"] .input {
  background: rgba(101, 2, 189, .05);
  border-color: rgba(101, 2, 189, .14);
}
.input:focus { outline: 3px solid var(--focus); border-color: var(--chip-ic); }
textarea.input { resize: vertical; min-height: 96px; }
select.input { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }

.callout {
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .04);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: .84rem;
  color: var(--muted);
  margin-bottom: 14px;
}
[data-theme="light"] .callout {
  background: rgba(101, 2, 189, .05);
  border-color: rgba(101, 2, 189, .12);
}
.callout strong { color: var(--chip-ic); font-weight: 600; }

/* ---- Style & branding ---- */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  clip: rect(0 0 0 0); clip-path: inset(50%);
  overflow: hidden; white-space: nowrap;
}
.sb-block { border-top: 1px solid var(--hairline); padding-top: 18px; margin-top: 18px; }
.sb-block:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.sb-block-title {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--hf); font-weight: 700; font-size: .82rem;
  text-transform: uppercase; letter-spacing: .6px;
  color: var(--muted);
  margin-bottom: 12px;
}
.sb-block-title svg { width: 15px; height: 15px; color: var(--chip-ic); }

.preset-chips { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--hairline);
  background: rgba(255, 255, 255, .04);
  color: var(--text);
  font-weight: 600; font-size: .82rem;
  padding: 8px 16px; border-radius: 999px;
  transition: transform .15s ease, border-color .2s, background .2s, color .2s;
}
[data-theme="light"] .chip { background: rgba(101, 2, 189, .05); }
.chip:hover { transform: translateY(-2px); border-color: var(--chip-ic); }
.chip.active { background: var(--a-grad); color: #fff; border-color: transparent; }

.seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 10px; }
.seg-opt {
  border: 1px solid var(--hairline);
  background: rgba(255, 255, 255, .04);
  color: var(--text);
  font-weight: 600; font-size: .82rem;
  padding: 9px 4px; border-radius: 10px;
  transition: transform .15s ease, background .2s, border-color .2s, color .2s;
}
[data-theme="light"] .seg-opt { background: rgba(101, 2, 189, .05); }
.seg-opt:hover { transform: translateY(-1px); border-color: var(--chip-ic); }
.seg-opt.active { background: var(--a-grad); color: #fff; border-color: transparent; }

.color-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 8px; }
.swatch-row { display: flex; align-items: center; gap: 10px; }
.swatch-row input[type="color"] {
  width: 46px; height: 40px; flex: 0 0 46px;
  border: 1px solid var(--hairline); border-radius: 10px;
  background: rgba(255, 255, 255, .05); padding: 3px; cursor: pointer;
}
.swatch-hex {
  font-family: var(--hf); font-weight: 600; font-size: .84rem;
  letter-spacing: .5px; color: var(--muted); text-transform: uppercase;
}

.dropzone {
  position: relative;
  border: 1.5px dashed rgba(215, 69, 141, .45);
  border-radius: 14px;
  padding: 18px 14px 16px;
  text-align: center;
  background: rgba(215, 69, 141, .06);
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.dropzone:hover { border-color: var(--pink); background: rgba(215, 69, 141, .1); }
.dropzone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone svg { width: 22px; height: 22px; color: var(--pink); }
.dz-title { font-weight: 600; font-size: .88rem; }
.dz-sub { font-size: .74rem; color: var(--muted); }

.range-wrap { display: flex; align-items: center; gap: 10px; }
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--purple), var(--pink));
  outline-offset: 4px;
  background: var(--chip-bg);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--a-grad);
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.35);
  cursor: pointer;
}
input[type="range"]::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--a-grad); border: 2px solid #fff; cursor: pointer;
}
.range-val { font-weight: 700; font-family: var(--hf); min-width: 34px; text-align: right; color: var(--chip-ic); }

input[type="color"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 42px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  padding: 4px;
  cursor: pointer;
}
input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"]::-webkit-color-swatch { border: none; border-radius: 8px; }
input[type="color"]::-moz-color-swatch { border: none; border-radius: 8px; }

.logo-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.logo-upload { position: relative; overflow: hidden; }
.logo-upload input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.logo-preview {
  width: 40px; height: 40px;
  border-radius: 10px;
  border: 1px solid var(--hairline);
  background: var(--input-bg);
  display: grid; place-items: center;
  font-size: .7rem; color: var(--muted);
  overflow: hidden;
  object-fit: contain;
}
.logo-preview img { width: 100%; height: 100%; object-fit: contain; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 12px 18px;
  font-weight: 600;
  font-size: .94rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: transform .15s ease, box-shadow .2s, background .2s;
  text-decoration: none;
}
.btn:hover { transform: translateY(-2px); }
.btn svg { width: 18px; height: 18px; }

.btn-primary { background: var(--a-grad); color: #fff; border-color: rgba(255,255,255,.18); box-shadow: 0 10px 26px -12px rgba(215,69,141,.8); }
.btn-ghost { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.34); color: var(--text); }
[data-theme="light"] .btn-ghost { background: rgba(101,2,189,.06); border-color: rgba(101,2,189,.3); }
.btn-white { background: #fff; color: #2c0a5a; }
[data-theme="light"] .btn-white { background: var(--purple); color: #fff; }

.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ---- Preview column ---- */
.preview-card { position: sticky; top: 84px; text-align: center; }

.qr-stage {
  background: radial-gradient(120% 120% at 50% 0%, rgba(168,85,247,.18), transparent 60%);
  border-radius: var(--radius);
  padding: 26px;
  display: grid;
  place-items: center;
}

.qr-frame {
  width: min(100%, 360px);
  aspect-ratio: 1;
  background: #fff;
  border-radius: 20px;
  padding: 14px;
  box-shadow: 0 30px 70px -30px rgba(120, 30, 180, .5);
  display: grid;
  place-items: center;
}
[data-theme="light"] .qr-frame { background: #fff; }

#qrCanvas { display: block; width: 100%; height: 100%; image-rendering: pixelated; }

.qr-status { min-height: 22px; font-size: .84rem; color: var(--muted); margin-top: 14px; }
.qr-status.err { color: #f87171; }
.qr-status.ok { color: #4ade80; }

.download-row { display: flex; gap: 10px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.download-row .btn { flex: 1; min-width: 130px; }

.dl-counter {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 14px;
  font-size: .82rem;
  font-weight: 500;
  color: var(--muted);
  background: var(--chip-bg);
  border: 1px solid var(--hairline);
  padding: 6px 12px;
  border-radius: 999px;
}
.dl-counter svg { width: 15px; height: 15px; color: var(--chip-ic); }
.dl-counter b { color: var(--chip-ic); font-weight: 700; font-family: var(--hf); }

/* ============ Features ============ */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
  margin: 0 auto 56px;
}
.feature {
  background: rgba(21, 21, 32, .5);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: var(--radius);
  padding: 20px 18px;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .06);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  animation: rise .7s cubic-bezier(.22, .7, .25, 1) both;
}
[data-theme="light"] .feature {
  background: rgba(255, 255, 255, .6);
  border-color: rgba(101, 2, 189, .12);
}
.features .feature:nth-child(1) { animation-delay: .30s; }
.features .feature:nth-child(2) { animation-delay: .38s; }
.features .feature:nth-child(3) { animation-delay: .46s; }
.features .feature:nth-child(4) { animation-delay: .54s; }
.feature .ic {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--chip-bg);
  color: var(--chip-ic);
  display: grid; place-items: center;
  margin-bottom: 14px;
}
.feature .ic svg { width: 22px; height: 22px; }
.feature h3 { font-size: 1rem; margin-bottom: 6px; }
.feature p { font-size: .85rem; color: var(--muted); margin: 0; }

/* ============ Footer ============ */
.site-footer {
  border-top: 1px solid var(--hairline);
  padding: 26px 0 34px;
  text-align: center;
}
.site-footer .trustline { font-size: .85rem; color: var(--muted); margin-bottom: 10px; }
.pv-counter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .8rem;
  color: var(--muted);
  margin-bottom: 8px;
}
.pv-counter svg { width: 14px; height: 14px; color: var(--chip-ic); }
.pv-counter b { color: var(--chip-ic); font-weight: 700; font-family: var(--hf); }
.site-footer .copyright { font-size: .8rem; color: var(--muted); opacity: .8; }
.site-footer a { font-weight: 500; }

/* ============ Entrance stagger ============ */
.hero-kicker { animation: rise .7s cubic-bezier(.22, .7, .25, 1) both; animation-delay: .02s; }
.hero h1 { animation: rise .7s cubic-bezier(.22, .7, .25, 1) both; animation-delay: .06s; }
.hero p { animation: rise .7s cubic-bezier(.22, .7, .25, 1) both; animation-delay: .12s; }
.tool-left .card:nth-child(1) { animation-delay: .18s; }
.tool-left .card:nth-child(2) { animation-delay: .26s; }
.tool-right .card { animation-delay: .22s; }
.qr-frame { animation: qrGlow 4s ease-in-out infinite; }

/* ============ Responsive ============ */
@media (max-width: 940px) {
  .tool { grid-template-columns: 1fr; }
  .preview-card { position: static; }
}
@media (max-width: 560px) {
  .form-grid { grid-template-columns: 1fr; }
  .color-grid { grid-template-columns: 1fr; }
  .hero { padding-top: 40px; }
  .brand-sub { display: none; }
}
@media (max-width: 380px) {
  .seg { grid-template-columns: repeat(2, 1fr); }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
