/* TagPro — print-shop precision
   The product prints Courier-Bold on die-cut tag sheets; the interface
   borrows its voice: mono type for specification, paper neutrals, ink. */

:root {
  --green: #2fae35;
  --green-bright: #03c70b;
  --green-dark: #1f8f26;
  --fibre-blue: #2c3ce0;
  --fibre-blue-dark: #2230b8;
  --red: #c10504;
  --ink: #17181a;
  --ink-soft: #45474c;
  --muted: #7c7e85;
  --charcoal: #2f3033;
  --paper: #f6f5f2;
  --paper-deep: #edecE7;
  --card: #ffffff;
  --line: #e4e2dc;
  --line-strong: #d2d0c9;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(23, 24, 26, 0.05), 0 10px 28px rgba(23, 24, 26, 0.06);
  --mono: ui-monospace, "SF Mono", SFMono-Regular, "Cascadia Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* page accent: green by default, blue on the fibre page */
  --accent: var(--green);
  --accent-dark: var(--green-dark);
  --accent-glow: rgba(47, 174, 53, 0.15);
}

body[data-tag-type="fibre"] {
  --accent: var(--fibre-blue);
  --accent-dark: var(--fibre-blue-dark);
  --accent-glow: rgba(44, 60, 224, 0.15);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
  font-size: 16px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img { max-width: 100%; }

h1, h2, h3 { font-family: var(--mono); letter-spacing: -0.01em; }

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- header ---------- */

.site-header {
  background: var(--charcoal);
  padding: 14px 24px;
}

.site-header .inner {
  max-width: 1020px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.site-header img { height: 32px; display: block; }

.help-link {
  color: #c9cdd3;
  font-family: var(--mono);
  font-size: 13px;
  text-decoration: none;
}

.help-link:hover { color: #fff; }

/* ---------- layout ---------- */

main {
  max-width: 1020px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 20px 64px;
  flex: 1;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin: 0 0 6px;
}

/* ---------- physical tag mock (signature element) ---------- */

.tag-stage {
  background: var(--paper-deep);
  background-image: radial-gradient(var(--line-strong) 1px, transparent 1px);
  background-size: 14px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tag-mock {
  position: relative;
  width: 216px;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(23, 24, 26, 0.14);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  padding: 8px 14px;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 13px;
  line-height: 1.35;
  text-align: center;
  word-break: break-all;
}

/* true tag proportions: data 27x18mm, fibre 27x12.5mm */
.tag-mock.data { min-height: 144px; }
.tag-mock.fibre { min-height: 100px; }

/* die-cut slit notches at the fold points */
.tag-mock::before,
.tag-mock::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 12px;
  height: 12px;
  transform: translateY(-50%);
  background: var(--paper-deep);
  border: 1px solid var(--line-strong);
  border-radius: 50%;
}

.tag-mock::before { left: -7px; }
.tag-mock::after { right: -7px; }

/* fold line between the two printed faces */
.tag-mock.data .preview-line:nth-child(2),
.tag-mock.fibre .preview-line:nth-child(1) {
  border-bottom: 1px dashed var(--line-strong);
  padding-bottom: 5px;
  margin-bottom: 5px;
}

.preview-line { min-height: 18px; }

.tag-mock.is-placeholder .preview-line { color: var(--muted) !important; opacity: 0.55; }

/* ---------- home ---------- */

.hero {
  text-align: center;
  padding: 46px 24px 38px;
}

.hero img { height: 78px; margin-bottom: 18px; }

.hero h1 { margin: 0 0 8px; font-size: 26px; }

.hero p {
  margin: 0 auto;
  max-width: 560px;
  color: var(--ink-soft);
  font-size: 16.5px;
}

.product-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 20px;
}

.product-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  padding: 24px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.product-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 8px rgba(23, 24, 26, 0.06), 0 18px 44px rgba(23, 24, 26, 0.12);
}

.product-card .tag-stage { margin-bottom: 18px; height: 200px; flex-shrink: 0; }

.product-card .cta { margin-top: auto; padding-top: 14px; }

.product-card h2 { margin: 0 0 4px; font-size: 19px; }

.product-card .spec {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--ink-soft);
  margin: 0 0 14px;
}

.product-card .cta {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 14px;
}

.product-card.data .eyebrow, .product-card.data .cta { color: var(--green-dark); }
.product-card.fibre .eyebrow, .product-card.fibre .cta { color: var(--fibre-blue); }

/* ---------- generator page banner: the spec header ---------- */

.page-banner {
  border-radius: var(--radius);
  padding: 22px 26px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
  background-image: radial-gradient(rgba(255, 255, 255, 0.16) 1px, transparent 1px);
  background-size: 14px 14px;
}

.page-banner.data { background-color: var(--green-dark); }
.page-banner.fibre { background-color: var(--fibre-blue-dark); }

.page-banner .eyebrow { opacity: 0.85; }

.page-banner h1 { margin: 0; font-size: 22px; }

.page-banner .spec {
  font-family: var(--mono);
  margin: 6px 0 0;
  font-size: 13px;
  opacity: 0.92;
}

.banner-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.eyebrow-link { text-decoration: none; color: inherit; display: inline-block; }
.eyebrow-link:hover { text-decoration: underline; }

.type-switch {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  padding: 3px;
}

.type-switch a {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  padding: 7px 14px;
  border-radius: 6px;
}

.type-switch a.active {
  background: #fff;
  color: var(--accent-dark);
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 15px;
  font-weight: 650;
  font-family: var(--sans);
  cursor: pointer;
  text-decoration: none;
  transition: filter 0.12s ease;
}

.btn:hover { filter: brightness(1.06); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary { background: var(--accent); color: #fff; }
.btn-generate { background: var(--red); color: #fff; padding: 13px 28px; font-size: 16px; }
.btn-ghost { background: rgba(255, 255, 255, 0.16); color: #fff; }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.28); }
.btn-neutral { background: #eceae5; color: var(--ink); }

/* ---------- sequence cards ---------- */

.sequence-card { margin-bottom: 20px; overflow: hidden; }

.sequence-card .card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 22px;
  border-bottom: 1px solid var(--line);
}

.sequence-card .card-head h2 { margin: 0; font-size: 15px; }

.seq-delete {
  background: none;
  border: 0;
  color: var(--red);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
}

.sequence-card .card-body { padding: 22px; }

.seq-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 30px;
}

.seq-field-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.seq-field-row .field-label,
.side-label,
.control label,
.option-block > label,
.stat-label {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.09em;
}

.seq-field-row .field-label { width: 82px; flex-shrink: 0; }

input[type="text"],
input[type="number"],
input[type="email"],
textarea,
select {
  font-family: var(--mono);
  font-size: 14.5px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  padding: 9px 12px;
  width: 100%;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.increment-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  font-size: 13px;
  color: var(--ink-soft);
  white-space: nowrap;
  user-select: none;
}

.increment-toggle input { accent-color: var(--accent); width: 16px; height: 16px; }

.seq-error { color: var(--red); font-size: 13.5px; margin: 10px 0 0; }

.seq-side .side-label { display: block; margin: 0 0 8px; }

.seq-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 16px;
}

.seq-controls .control label { display: block; margin-bottom: 5px; }

input[type="color"].seq-color {
  width: 100%;
  height: 40px;
  padding: 3px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
  cursor: pointer;
}

.add-sequence-row { margin: 4px 0 24px; }

/* ---------- overview: sheets you can see ---------- */

.overview { padding: 22px 26px; }

.overview h2 { margin: 0 0 18px; font-size: 16px; }

.overview-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  justify-content: space-between;
}

.stat .stat-value {
  font-family: var(--mono);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.stat .stat-value .unit {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  margin-left: 5px;
}

.stat-value.accent { color: var(--accent-dark); }

/* miniature die-cut sheets, one cell per real tag position */
.sheet-viz {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  min-height: 92px;
  flex-wrap: wrap;
}

.mini-sheet {
  display: grid;
  gap: 1px;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  padding: 4px;
  box-shadow: 0 1px 3px rgba(23, 24, 26, 0.1);
}

.mini-sheet .cell {
  width: 7px;
  height: 4px;
  border-radius: 1px;
  background: var(--paper-deep);
}

.mini-sheet .cell.filled { background: var(--accent); }

.sheet-more {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
  align-self: center;
}

.overview-options { display: flex; gap: 18px; flex-wrap: wrap; align-items: flex-end; }

.option-block > label { display: block; margin-bottom: 6px; }

.segmented {
  display: inline-flex;
  background: #eceae5;
  border-radius: 8px;
  padding: 3px;
}

.segmented button {
  border: 0;
  background: transparent;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  padding: 8px 14px;
  border-radius: 6px;
  cursor: pointer;
}

.segmented button.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(23, 24, 26, 0.16);
}

.generate-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 14px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.paper-note { font-size: 13.5px; color: var(--muted); }

/* ---------- feedback footer ---------- */

.feedback {
  background: var(--charcoal);
  color: #fff;
  margin-top: 48px;
  padding: 48px 24px;
}

.feedback .inner {
  max-width: 1020px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
}

.feedback h2 { margin: 0 0 10px; font-size: 19px; }

.feedback .blurb { color: #b9bdc4; font-size: 14.5px; }

.feedback label {
  display: block;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: #b9bdc4;
  margin: 14px 0 5px;
}

.feedback input, .feedback textarea {
  background: #3a3b3f;
  border-color: #4a4c51;
  color: #fff;
}

.feedback input:focus, .feedback textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.feedback .btn { margin-top: 16px; width: 100%; }

.feedback-error { color: #ff8b8b; font-size: 14px; margin-top: 10px; }

.site-footer {
  background: var(--charcoal);
  color: #8d9097;
  font-family: var(--mono);
  text-align: center;
  font-size: 12px;
  padding: 18px 24px 26px;
  border-top: 1px solid #3c3d41;
}

/* ---------- dialogs ---------- */

dialog {
  border: 0;
  border-radius: var(--radius);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.25);
  padding: 28px;
  max-width: 430px;
  width: calc(100vw - 48px);
  font-family: var(--sans);
  color: var(--ink);
}

dialog::backdrop { background: rgba(23, 24, 26, 0.45); }

dialog h3 { margin: 0 0 14px; font-size: 16px; }

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.file-row { display: flex; gap: 10px; margin-top: 14px; }
.file-row input { flex: 1; }

dialog.loading-dialog {
  background: transparent;
  box-shadow: none;
  width: auto;
}

.loader {
  width: 52px;
  height: 52px;
  border: 5px solid rgba(255, 255, 255, 0.3);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.success-dialog { text-align: center; }
.success-dialog img { height: 56px; margin-bottom: 12px; }

/* ---------- responsive ---------- */

@media (max-width: 760px) {
  .product-grid, .seq-grid, .feedback .inner { grid-template-columns: 1fr; }
  .overview-grid { flex-direction: column; }
  .generate-row { flex-direction: column; align-items: stretch; text-align: center; }
  .page-banner { flex-direction: column; align-items: flex-start; }
}
