/* ==========================================================================
   VEDHAVERTEX - Passport Size & ID Photo Maker
   Design language: precision print production. The recurring visual motif
   is the corner "registration/crop mark" used on real cut sheets - it shows
   up in the eyebrow, the stepper, and the hero mock-up because it is the
   literal mechanism the product outputs (cutting guide ticks on the A4
   sheet), not a decorative flourish.
   ========================================================================== */

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-sunken: #eef0f4;
  --ink: #0f1b33;
  --ink-soft: #4c5670;
  --ink-faint: #8791a8;
  --line: #e1e5ec;
  --line-strong: #c7ccd8;

  --navy: #101b33;
  --navy-700: #16233f;
  --cyan: #0d9a92;
  --cyan-600: #0b7f79;
  --red: #d94a3d;
  --amber: #c8791a;
  --green: #16824f;

  --font-display: 'Space Grotesk', 'Inter', sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;

  --shadow-sm: 0 1px 2px rgba(15, 27, 51, 0.06);
  --shadow-md: 0 8px 24px -8px rgba(15, 27, 51, 0.18);
  --shadow-lg: 0 24px 60px -20px rgba(15, 27, 51, 0.28);

  --container: 1180px;
  --tap-min: 44px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--navy);
  line-height: 1.15;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

p { margin: 0 0 1em; }
img { max-width: 100%; display: block; }

.wrap {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--navy);
  color: #fff;
  padding: 10px 16px;
  z-index: 1000;
  border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

a { color: inherit; }

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

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--tap-min);
  padding: 0 20px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1.5px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.15s ease, opacity 0.15s ease;
  user-select: none;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.btn--primary {
  background: var(--navy);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn--primary:hover:not(:disabled) { background: var(--navy-700); box-shadow: var(--shadow-md); }

.btn--secondary {
  background: var(--cyan);
  color: #fff;
}
.btn--secondary:hover:not(:disabled) { background: var(--cyan-600); }

.btn--ghost {
  background: transparent;
  color: var(--navy);
  border-color: var(--line-strong);
}
.btn--ghost:hover:not(:disabled) { background: var(--surface-sunken); }

.btn--lg { min-height: 52px; padding: 0 30px; font-size: 1.05rem; }
.btn--sm { min-height: 38px; padding: 0 16px; font-size: 0.88rem; }

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(246, 247, 249, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand__mark { color: var(--cyan); display: inline-flex; }
.brand__text { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; color: var(--navy); }

/* ---------- eyebrow (registration-tick motif) ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  color: var(--ink-soft);
  text-transform: uppercase;
  margin-bottom: 18px;
}
.eyebrow__tick {
  width: 10px;
  height: 10px;
  border-left: 2px solid var(--red);
  border-top: 2px solid var(--red);
}

/* ---------- hero ---------- */
.hero { padding: 56px 0 40px; }
.hero__grid {
  display: grid;
  gap: 40px;
}
.hero__copy h1 {
  font-size: clamp(2rem, 5.5vw, 3.1rem);
}
.hero__sub {
  font-size: 1.1rem;
  color: var(--ink-soft);
  max-width: 46ch;
}
.hero__actions { margin: 22px 0 30px; }
.hero__flow {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0;
  margin: 0 0 22px;
}
.hero__flow li {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
  color: var(--ink-soft);
}
.hero__flow li:not(:last-child)::after { content: '\2192'; margin-left: 10px; color: var(--ink-faint); }
.hero__privacy {
  font-size: 0.85rem;
  color: var(--ink-faint);
  margin: 0;
}

.hero__art { display: flex; align-items: center; justify-content: center; }
.sheet-mock {
  width: min(100%, 320px);
  aspect-ratio: 210 / 297;
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 5%;
  border: 1px solid var(--line);
}
.sheet-mock__grid {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3%;
}
.sheet-mock__grid .cell {
  background: linear-gradient(160deg, #dfe7f5, #c8d3e6);
  border-radius: 2px;
  position: relative;
}
.sheet-mock__grid .cell::before,
.sheet-mock__grid .cell::after { content: ''; position: absolute; width: 6px; height: 6px; border-color: var(--red); }
.sheet-mock__grid .cell::before { top: -3px; left: -3px; border-top: 1.5px solid var(--red); border-left: 1.5px solid var(--red); }
.sheet-mock__grid .cell::after { bottom: -3px; right: -3px; border-bottom: 1.5px solid var(--red); border-right: 1.5px solid var(--red); }

/* ---------- tool shell ---------- */
.tool { padding: 20px 0 90px; }

.stepper { margin-bottom: 26px; position: sticky; top: 64px; z-index: 20; background: var(--bg); padding: 10px 0; }
.stepper ol {
  list-style: none;
  display: flex;
  gap: 6px;
  padding: 0;
  margin: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.stepper ol::-webkit-scrollbar { display: none; }
.stepper li { flex: 0 0 auto; }
.stepper button {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px 8px 8px;
  cursor: pointer;
  min-height: var(--tap-min);
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--ink-soft);
  transition: all 0.15s ease;
}
.stepper__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--surface-sunken);
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.78rem;
}
.stepper li[data-state="active"] button { border-color: var(--navy); color: var(--navy); box-shadow: var(--shadow-sm); }
.stepper li[data-state="active"] .stepper__num { background: var(--navy); color: #fff; }
.stepper li[data-state="done"] .stepper__num { background: var(--cyan); color: #fff; }
.stepper li[data-state="locked"] button { opacity: 0.5; cursor: not-allowed; }
.stepper__label { display: none; }
@media (min-width: 640px) { .stepper__label { display: inline; } }

.toast {
  background: #fff3f1;
  border: 1px solid #f3c4bd;
  color: #8a2e23;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
  font-size: 0.9rem;
}
.toast[data-kind="info"] { background: #eef6ff; border-color: #bfdcf7; color: #234f77; }

/* ---------- panels ---------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px 18px 26px;
  box-shadow: var(--shadow-sm);
}
@media (min-width: 768px) { .panel { padding: 34px 36px 32px; } }

.panel__title { font-size: 1.4rem; }
.panel__hint { color: var(--ink-soft); max-width: 68ch; }
.panel__note { color: var(--ink-soft); font-size: 0.9rem; }
.panel__error {
  background: #fff3f1;
  border: 1px solid #f3c4bd;
  color: #8a2e23;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
}
.panel__actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px dashed var(--line);
  gap: 12px;
}

/* ---------- upload ---------- */
.dropzone {
  border: 2px dashed var(--line-strong);
  border-radius: var(--radius-md);
  padding: 44px 20px;
  text-align: center;
  cursor: pointer;
  background: var(--surface-sunken);
  color: var(--ink-soft);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.dropzone:hover, .dropzone.is-dragover { border-color: var(--cyan); background: #eef8f7; }
.dropzone svg { margin: 0 auto 10px; color: var(--ink-faint); }
.dropzone__title { font-weight: 600; color: var(--navy); margin-bottom: 2px; }
.dropzone__sub { font-size: 0.88rem; margin-bottom: 16px; }

.upload-preview {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  flex-wrap: wrap;
}
.upload-preview img { width: 96px; height: 96px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.upload-preview__meta { flex: 1; min-width: 160px; }
.upload-preview__meta p { margin: 0 0 8px; font-size: 0.88rem; color: var(--ink-soft); font-family: var(--font-mono); }

.privacy-note {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  color: var(--ink-faint);
  font-size: 0.85rem;
  margin-top: 18px;
}
.privacy-note svg { flex: none; margin-top: 2px; color: var(--cyan); }

/* ---------- size grid ---------- */
.size-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin: 20px 0;
}
.size-card {
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: left;
  background: var(--surface);
  cursor: pointer;
  min-height: var(--tap-min);
}
.size-card__ratio {
  width: 34px;
  border: 1.5px solid var(--ink-faint);
  margin-bottom: 10px;
}
.size-card__label { font-weight: 700; font-family: var(--font-mono); color: var(--navy); display: block; }
.size-card__sub { font-size: 0.8rem; color: var(--ink-soft); }
.size-card[aria-checked="true"] { border-color: var(--navy); background: #eef1f7; box-shadow: var(--shadow-sm); }

.custom-size { margin-top: 6px; padding: 16px; background: var(--surface-sunken); border-radius: var(--radius-md); }
.field-row { display: grid; grid-template-columns: 1fr 1fr 100px; gap: 12px; }
@media (max-width: 480px) { .field-row { grid-template-columns: 1fr 1fr; } .field--unit { grid-column: 1 / -1; } }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 0.85rem; font-weight: 600; color: var(--ink-soft); }
.field input, .field select {
  min-height: var(--tap-min);
  border-radius: 10px;
  border: 1.5px solid var(--line-strong);
  padding: 0 12px;
  font-size: 1rem;
  font-family: var(--font-mono);
  background: #fff;
  color: var(--ink);
}
.field-hint { font-size: 0.8rem; color: var(--ink-faint); margin: 10px 0 0; }

/* ---------- editor ---------- */
.editor-layout { display: grid; gap: 22px; }
@media (min-width: 900px) { .editor-layout { grid-template-columns: 1.1fr 0.9fr; align-items: start; } }

.crop-stage { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.crop-frame-wrap {
  width: min(100%, 340px);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  background: #111;
  touch-action: none;
}
.crop-canvas { width: 100%; height: auto; display: block; cursor: grab; touch-action: none; }
.crop-canvas:active { cursor: grabbing; }
.crop-hint { font-size: 0.85rem; color: var(--ink-faint); text-align: center; }

.editor-controls { display: flex; flex-direction: column; gap: 16px; }
.control { display: flex; flex-direction: column; gap: 6px; }
.control label { font-size: 0.85rem; font-weight: 600; color: var(--ink-soft); }
.control input[type="range"] { width: 100%; accent-color: var(--cyan); min-height: var(--tap-min); }
.control output { font-family: var(--font-mono); font-size: 0.8rem; color: var(--ink-faint); }
.drag-hint { font-size: 0.82rem; color: var(--ink-faint); margin: 4px 0 0; }

/* ---------- background ---------- */
.bg-options { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0; }
.bg-option {
  display: flex; align-items: center; gap: 10px;
  border: 1.5px solid var(--line); border-radius: 999px;
  padding: 8px 16px 8px 8px; background: var(--surface); cursor: pointer;
  min-height: var(--tap-min); font-weight: 600; font-size: 0.9rem; color: var(--ink-soft);
}
.bg-option[aria-pressed="true"] { border-color: var(--navy); color: var(--navy); background: #eef1f7; }
.bg-swatch { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line-strong); display: inline-block; }
.bg-swatch--original { background: repeating-conic-gradient(#d7dbe4 0% 25%, #fff 0% 50%) 0 0/10px 10px; }

.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 18px 0; }
.compare__label { font-size: 0.8rem; font-weight: 700; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 6px; }
.compare__canvas { width: 100%; aspect-ratio: 35 / 45; background: var(--surface-sunken); border-radius: var(--radius-sm); border: 1px solid var(--line); object-fit: contain; }

.quality-panel { margin-top: 22px; padding: 16px; border-radius: var(--radius-md); background: var(--surface-sunken); border: 1px solid var(--line); }
.quality-panel__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.quality-panel h3 { margin: 0; font-size: 1rem; }
.quality-badge { font-family: var(--font-mono); font-size: 0.78rem; font-weight: 700; padding: 5px 12px; border-radius: 999px; background: var(--green); color: #fff; }
.quality-badge[data-status="PLEASE ADJUST"] { background: var(--red); }
.quality-list { list-style: none; padding: 0; margin: 0 0 10px; display: flex; flex-direction: column; gap: 8px; }
.quality-list li { display: flex; gap: 10px; align-items: flex-start; font-size: 0.86rem; }
.q-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; margin-top: 5px; }
.q-dot[data-s="ok"] { background: var(--green); }
.q-dot[data-s="warn"] { background: var(--amber); }
.q-dot[data-s="fail"] { background: var(--red); }
.q-dot[data-s="info"] { background: var(--ink-faint); }
.quality-panel__note { font-size: 0.78rem; color: var(--ink-faint); margin: 0; }

/* ---------- copies & A4 ---------- */
.field--copies input { max-width: 160px; font-size: 1.2rem; text-align: center; }
.printer-grid { display: grid; gap: 12px; grid-template-columns: 1fr; margin: 20px 0; }
@media (min-width: 640px) { .printer-grid { grid-template-columns: 1fr 1fr; } }
.printer-card {
  text-align: left; border: 1.5px solid var(--line); border-radius: var(--radius-md);
  padding: 16px; background: var(--surface); cursor: pointer; min-height: var(--tap-min);
}
.printer-card[aria-checked="true"] { border-color: var(--navy); background: #eef1f7; }
.printer-card__name { font-weight: 700; color: var(--navy); display: flex; align-items: center; gap: 8px; }
.printer-card__badge { font-family: var(--font-mono); font-size: 0.68rem; background: var(--surface-sunken); color: var(--ink-soft); padding: 2px 8px; border-radius: 999px; }
.printer-card__desc { font-size: 0.84rem; color: var(--ink-soft); margin-top: 6px; }

.layout-summary {
  margin-top: 8px; padding: 16px; border-radius: var(--radius-md);
  background: var(--navy); color: #fff; display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}
.layout-summary .stat { display: flex; flex-direction: column; gap: 2px; }
.layout-summary .stat b { font-family: var(--font-mono); font-size: 1.15rem; }
.layout-summary .stat span { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: #b9c3dc; }
.layout-summary.is-error { background: #fff3f1; color: #8a2e23; }

/* ---------- preview & download ---------- */
.preview-layout { display: grid; gap: 26px; }
@media (min-width: 900px) { .preview-layout { grid-template-columns: 1fr 1.4fr; } }
.preview-photo { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.preview-photo__canvas { width: 180px; height: auto; border-radius: var(--radius-sm); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.preview-sheet__head { display: flex; align-items: center; justify-content: space-between; }
.sheet-nav { display: flex; align-items: center; gap: 10px; font-family: var(--font-mono); font-size: 0.85rem; }
.sheet-nav button { min-width: 36px; min-height: 36px; border-radius: 8px; border: 1px solid var(--line-strong); background: #fff; cursor: pointer; }
.preview-sheet__canvas { width: 100%; max-width: 420px; border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); background: #fff; }
.sheet-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin: 14px 0; padding: 0; }
.sheet-facts div { background: var(--surface-sunken); border-radius: 10px; padding: 8px 12px; }
.sheet-facts dt { font-size: 0.7rem; text-transform: uppercase; color: var(--ink-faint); letter-spacing: 0.04em; }
.sheet-facts dd { margin: 2px 0 0; font-family: var(--font-mono); font-weight: 600; color: var(--navy); }
.preview-sheet__downloads { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }

.print-instructions, .studio-note {
  margin-top: 30px; padding: 18px 20px; border-radius: var(--radius-md);
  border: 1px solid var(--line); background: var(--surface-sunken);
}
.print-instructions h3, .studio-note h3 { font-size: 1.05rem; }
.print-instructions ol { padding-left: 20px; margin: 0; }
.print-instructions li { margin-bottom: 6px; }
.print-instructions__note { font-size: 0.8rem; color: var(--ink-faint); margin: 12px 0 0; }
.studio-note { background: #eef8f7; border-color: #cdeae7; }

/* ---------- footer ---------- */
.site-footer { padding: 30px 0 60px; color: var(--ink-faint); font-size: 0.82rem; text-align: center; }
.site-footer p { margin: 0 0 6px; }

/* ---------- utility ---------- */
[hidden] { display: none !important; }
