/* Styles Tailwind utilities don't cover well: background glows, component
   classes and the sample QR layers. */

.app-bg {
  background:
    radial-gradient(60rem 40rem at 80% -10%, rgb(30 110 190 / 0.14), transparent 65%),
    radial-gradient(40rem 30rem at 10% 110%, rgb(20 70 140 / 0.1), transparent 60%),
    #08111e;
}

.rail-bg {
  background: linear-gradient(180deg, #0d2238 0%, #0a1829 45%, #08121f 100%);
}

.preview-card {
  overflow: hidden;
  border-radius: 1.75rem;
  border: 1px solid rgb(63 190 247 / 0.22);
  background: linear-gradient(180deg, #0c1d31, #0a1729);
  box-shadow: 0 30px 80px -30px rgb(0 0 0 / 0.6);
}

.qr-glow {
  background: radial-gradient(ellipse 60% 55% at 50% 42%, rgb(30 130 210 / 0.22), transparent 70%);
}


/* Match Tailwind's layer order so utilities (e.g. h-11, w-full) can override these components. */
@layer theme, base, components, utilities;

/* ---------- Components ---------- */
@layer components {
.eyebrow {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #3fbef7;
}
.step-title {
  margin-top: 6px;
  font-size: 1.5rem;
  line-height: 2rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #fff;
}

.section-title {
  display: flex;
  align-items: baseline;
  gap: 18px;
  font-size: 1.2rem;
  font-weight: 900;
  letter-spacing: 0.01em;
  color: #fff;
}
.section-num {
  font-size: 13px;
  font-weight: 800;
  color: #3fbef7;
}
.field-caption {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94a3b8;
}

.card {
  border-radius: 1rem;
  border: 1px solid rgb(255 255 255 / 0.07);
  background-color: rgb(10 23 40 / 0.6);
}

/* ---------- Rail ---------- */
.rail-btn {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 68px;
  height: 62px;
  border-radius: 14px;
  border: 1px solid transparent;
  font-size: 10.5px;
  font-weight: 800;
  color: #64748b;
  transition: color 0.15s, background-color 0.15s, border-color 0.15s;
}
.rail-btn:hover { color: #cbd5e1; background-color: rgb(255 255 255 / 0.04); }
.rail-btn[aria-pressed="true"] {
  color: #3fbef7;
  border-color: rgb(63 190 247 / 0.35);
  background-color: rgb(63 190 247 / 0.12);
}
.rail-help {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: 0 auto;
  border-radius: 12px;
  color: #94a3b8;
  transition: color 0.15s, background-color 0.15s;
}
.rail-help:hover { color: #fff; background-color: rgb(255 255 255 / 0.06); }
.rail-btn:focus-visible,
.rail-help:focus-visible,
.type-chip:focus-visible { outline: 2px solid #6fd4ff; outline-offset: 2px; }

/* QR type chips (mobile) */
.type-chip {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgb(255 255 255 / 0.1);
  background-color: rgb(15 30 50 / 0.7);
  font-size: 13px;
  font-weight: 800;
  color: #cbd5e1;
  transition: border-color 0.15s, background-color 0.15s, color 0.15s;
}
.type-chip[aria-pressed="true"] {
  border-color: #3fbef7;
  background-color: rgb(63 190 247 / 0.12);
  color: #6fd4ff;
}

/* ---------- Form fields ---------- */
.field {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border-radius: 0.75rem;
  border: 1px solid rgb(255 255 255 / 0.1);
  background-color: rgb(15 33 54 / 0.8);
  font-size: 15px;
  color: #fff;
  color-scheme: dark;
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea.field { height: auto; min-height: 96px; padding: 12px 16px; resize: vertical; }
select.field { cursor: pointer; }
/* Hide number spinners (latitude / longitude) — they clash with the dark fields. */
.field[type="number"] { -moz-appearance: textfield; appearance: textfield; }
.field[type="number"]::-webkit-inner-spin-button,
.field[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.field::placeholder { color: #64748b; }
.field:hover { border-color: rgb(255 255 255 / 0.2); }
.field:focus {
  outline: none;
  border-color: #3fbef7;
  box-shadow: 0 0 0 3px rgb(63 190 247 / 0.18);
}

/* ---------- URL field ---------- */
.field-shell {
  display: flex;
  align-items: center;
  gap: 18px;
  height: 54px;
  padding: 0 7px 0 20px;
  border-radius: 0.75rem;
  border: 1px solid rgb(63 190 247 / 0.35);
  background-color: rgb(15 33 54 / 0.8);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field-shell:focus-within {
  border-color: #3fbef7;
  box-shadow: 0 0 0 3px rgb(63 190 247 / 0.18);
}
.badge-valid {
  flex-shrink: 0;
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 800;
  color: #6ee7b7;
  background-color: rgb(16 185 129 / 0.16);
}
.badge-valid[data-valid="false"] { color: #fcd34d; background-color: rgb(245 158 11 / 0.14); }
.badge-valid[data-valid="true"] .invalid-only,
.badge-valid[data-valid="false"] .valid-only { display: none; }

.scan-badge {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgb(52 211 153 / 0.2);
  background-color: rgb(52 211 153 / 0.1);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #6ee7b7;
  transition: color 0.2s, background-color 0.2s, border-color 0.2s;
}
/* ok = decoded and good contrast · warn = decodes but risky · fail = doesn't decode · idle = nothing to check yet */
.scan-badge[data-state="warn"] {
  border-color: rgb(251 191 36 / 0.3);
  background-color: rgb(251 191 36 / 0.12);
  color: #fcd34d;
}
.scan-badge[data-state="fail"] {
  border-color: rgb(244 63 94 / 0.35);
  background-color: rgb(244 63 94 / 0.12);
  color: #fda4af;
}
.scan-badge[data-state="idle"],
.scan-badge[data-state="checking"] {
  border-color: rgb(255 255 255 / 0.1);
  background-color: rgb(255 255 255 / 0.04);
  color: #94a3b8;
}
.scan-badge[data-state="checking"] > :first-child { animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.3; } }

/* ---------- Custom colours ---------- */
.color-field {
  position: relative; /* anchors the hidden native picker so its popup opens by the swatch */
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 10px 0 7px;
  border-radius: 0.6rem;
  border: 1px solid rgb(255 255 255 / 0.1);
  background-color: rgb(8 17 30 / 0.7);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.color-field:hover { border-color: rgb(255 255 255 / 0.2); }
.color-field:focus-within { border-color: #3fbef7; box-shadow: 0 0 0 3px rgb(63 190 247 / 0.18); }
.color-field[data-invalid] { border-color: #f59e0b; }

.swatch {
  position: relative;
  display: block;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 0.25);
  border-radius: 6px;
  cursor: pointer;
}
.swatch:focus-visible { outline: 2px solid #6fd4ff; outline-offset: 2px; }

/* ---------- Option cards (dot shape, eyes, palette, export format) ---------- */
.option-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 0.6rem;
  border: 1px solid rgb(255 255 255 / 0.08);
  background-color: rgb(15 30 50 / 0.7);
  font-size: 13px;
  font-weight: 800;
  color: #cbd5e1;
  transition: border-color 0.15s, background-color 0.15s, color 0.15s;
}
.option-card svg { color: #e2e8f0; }
.option-card:hover { border-color: rgb(255 255 255 / 0.18); color: #fff; }
.option-card[aria-checked="true"] {
  border-color: #3fbef7;
  background-color: rgb(63 190 247 / 0.1);
  color: #fff;
}
.option-card[aria-checked="true"] svg { color: #3fbef7; }
.option-card[data-option="format"][aria-checked="true"] { color: #6fd4ff; }
.option-card:focus-visible { outline: 2px solid #6fd4ff; outline-offset: 2px; }

/* Horizontal option rows. The edges fade while there is more to scroll to (data-more set by app.js). */
.scroller {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 2px;
  padding: 2px;
  margin: -2px;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
}
.scroller::-webkit-scrollbar { display: none; }
@media (pointer: fine) {
  .scroller { cursor: grab; }
  .scroller .option-card { cursor: inherit; }
}
.scroller[data-dragging] { cursor: grabbing; scroll-snap-type: none; user-select: none; }
.scroller[data-more="end"]   { mask-image: linear-gradient(to right, #000 85%, transparent); }
.scroller[data-more="start"] { mask-image: linear-gradient(to left, #000 85%, transparent); }
.scroller[data-more="both"]  { mask-image: linear-gradient(to right, transparent, #000 12%, #000 88%, transparent); }

.scroll-btn {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 1px solid rgb(255 255 255 / 0.1);
  color: #cbd5e1;
  transition: color 0.15s, border-color 0.15s, background-color 0.15s, opacity 0.15s;
}
.scroll-btn:hover:not(:disabled) { color: #fff; border-color: rgb(63 190 247 / 0.5); background-color: rgb(63 190 247 / 0.1); }
.scroll-btn:disabled { opacity: 0.3; cursor: default; }
.scroll-btn:focus-visible { outline: 2px solid #6fd4ff; outline-offset: 2px; }

/* Eye style previews: frame follows the card's text colour, centre is always the accent. */
.option-card .eye-centre { fill: #4fc6f7; }
.option-card[aria-checked="true"] svg:has(.eye-centre) { color: #fff; }

/* ---------- Buttons ---------- */
.btn-primary,
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 800;
  transition: filter 0.15s, background-color 0.15s, opacity 0.15s;
}
.btn-primary:focus-visible,
.btn-icon:focus-visible {
  outline: 2px solid #6fd4ff;
  outline-offset: 2px;
}
.btn-primary {
  border-radius: 0.6rem;
  font-size: 14px;
  color: #06223a;
  background-color: #4fc6f7;
  box-shadow: 0 12px 30px -10px rgb(63 190 247 / 0.55);
}
.btn-primary:hover:not(:disabled) { filter: brightness(1.08); }
.btn-primary:disabled { cursor: not-allowed; opacity: 0.55; }

.btn-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 0.5rem;
  color: #fff;
}
.btn-icon:hover { background-color: rgb(255 255 255 / 0.1); }
}

/* ---------- Range slider (logo size) ---------- */
.range {
  --p: 0%;
  appearance: none;
  -webkit-appearance: none;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(to right, #3fbef7 var(--p), rgb(255 255 255 / 0.14) var(--p));
  cursor: pointer;
  outline: none;
}
.range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid #3fbef7;
  box-shadow: 0 0 0 4px rgb(63 190 247 / 0.2);
}
.range::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid #3fbef7;
  box-shadow: 0 0 0 4px rgb(63 190 247 / 0.2);
}
.range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 5px rgb(63 190 247 / 0.45); }
