/* Styles Tailwind utilities don't cover well: background glows and component classes. */

/* Same page background as the other irvinPH tools (Pixelate, Cropper, PDF Rebrander). */
.app-bg {
  background:
    radial-gradient(60rem 40rem at 72% -10%, rgb(30 110 190 / 0.22), transparent 65%),
    radial-gradient(50rem 35rem at 110% 110%, rgb(20 90 170 / 0.18), transparent 60%),
    radial-gradient(40rem 30rem at -10% 40%, rgb(20 70 140 / 0.12), transparent 60%),
    #050c18;
}

.preview-bg {
  background:
    radial-gradient(ellipse at 50% 40%, rgb(24 70 120 / 0.45), transparent 70%),
    #060f1c;
}

/* 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.18em;
  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;
}

.panel-title {
  margin-top: 6px;
  font-size: 1.3rem;
  line-height: 1.75rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #fff;
}
.step-copy {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.6;
  color: #94a3b8;
}
.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);
}

kbd {
  display: inline-flex;
  min-width: 24px;
  align-items: center;
  justify-content: center;
  padding: 1px 6px;
  border-radius: 6px;
  border: 1px solid rgb(255 255 255 / 0.15);
  background-color: rgb(255 255 255 / 0.06);
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  color: #e2e8f0;
  white-space: nowrap;
}

/* ---------- 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,
.option-card[aria-checked="true"] > i { 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); }
}

/* ---------- Download consent checkbox ---------- */
.consent {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 0.75rem;
  border: 1px solid rgb(255 255 255 / 0.08);
  background-color: rgb(15 30 50 / 0.5);
  font-size: 13px;
  line-height: 1.5;
  color: #cbd5e1;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}
.consent:hover { border-color: rgb(255 255 255 / 0.18); }
.consent:has(:checked) {
  border-color: rgb(63 190 247 / 0.45);
  background-color: rgb(63 190 247 / 0.07);
}
/* Nudge when there's a code ready but the box isn't ticked yet. */
.consent[data-attention] { border-color: rgb(251 191 36 / 0.45); }
/* Compact version used in the pinned Step 3 footer */
.consent-inline:hover { color: #cbd5e1; }
.consent-inline[data-attention] .consent-box { border-color: rgb(251 191 36 / 0.75); }
.consent-inline:has(:checked) { color: #cbd5e1; }

.consent-box {
  appearance: none;
  -webkit-appearance: none;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 1px;
  border-radius: 5px;
  border: 1.5px solid rgb(255 255 255 / 0.35);
  background-color: rgb(8 17 30 / 0.7);
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s;
}
.consent-box:checked {
  border-color: #3fbef7;
  background: #3fbef7 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23040b16' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 8.5l3 3 6-7'/%3E%3C/svg%3E") center / 12px no-repeat;
}
.consent-box:focus-visible { outline: 2px solid #6fd4ff; outline-offset: 2px; }

/* ---------- 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); }
