/* Name tag configurator. Uses the site's own tokens from global.css. */

@font-face {
  font-family: 'NTPacifico';
  src: url('/nametaggenerator/fonts/Pacifico-Regular.woff2') format('woff2');
  font-display: swap;
}
@font-face {
  font-family: 'NTMontserrat';
  src: url('/nametaggenerator/fonts/Montserrat-SemiBold.woff2') format('woff2');
  font-display: swap;
}
@font-face {
  font-family: 'NTRobotoSlab';
  src: url('/nametaggenerator/fonts/RobotoSlab-Bold.woff2') format('woff2');
  font-display: swap;
}
@font-face {
  font-family: 'NTNunito';
  src: url('/nametaggenerator/fonts/Nunito-Bold.woff2') format('woff2');
  font-display: swap;
}
@font-face {
  font-family: 'NTOswald';
  src: url('/nametaggenerator/fonts/Oswald-SemiBold.woff2') format('woff2');
  font-display: swap;
}

/* BaseLayout wraps pages in a 760px column; the configurator needs more room,
   so it breaks out of that container without touching the shared layout. */
.nt-wide {
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  width: min(1160px, calc(100vw - 2.5rem));
}

.nt-head .glow {
  position: absolute;
  inset: -40% 20% auto 20%;
  height: 320px;
  background: radial-gradient(closest-side, var(--glow), transparent 70%);
  pointer-events: none;
  z-index: -1;
}
.nt-head { position: relative; padding-top: 2.5rem; }
.nt-head h1 { margin: 0.2rem 0 0.6rem; font-size: clamp(2rem, 5vw, 2.8rem); }
.nt-head .lead { max-width: 60ch; }

/* ------------------------------------------------------------- designer */
.nt-designer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 420px);
  gap: 1.5rem;
  align-items: start;
  margin: 2rem 0;
}

.nt-panel {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem;
}

.nt-controls {
  display: grid;
  gap: 0.75rem;
  padding: 0.75rem;
}

.design-section {
  margin: 0;
  padding: 1.1rem;
  background: rgba(7, 8, 10, 0.36);
  border: 1px solid rgba(255, 255, 255, 0.065);
  border-radius: 11px;
}

.section-heading,
.preview-heading,
.range-heading,
.motif-card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.section-heading { margin-bottom: 1rem; }
.section-heading h2,
.preview-heading h2 {
  margin: 0.05rem 0 0;
  font-size: 1.05rem;
  line-height: 1.2;
}
/* One optional marker, used identically on section headings and on the
   collapsible summaries, so "you can skip this" reads the same everywhere. */
.pill-optional {
  flex: none;
  align-self: center;
  padding: 0.24rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.028);
  color: var(--fg-muted);
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.09em;
  line-height: 1.5;
  text-transform: uppercase;
  white-space: nowrap;
}

.quick-styles {
  overflow: hidden;
  background:
    radial-gradient(circle at 15% 0, rgba(126, 87, 255, 0.13), transparent 42%),
    rgba(7, 8, 10, 0.36);
}
.preset-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.55rem;
}
.preset-card {
  display: flex;
  min-width: 0;
  min-height: 98px;
  padding: 0.75rem 0.65rem;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem;
  text-align: left;
}
.preset-card:hover:not(:disabled) {
  background: rgba(126, 87, 255, 0.09);
  transform: translateY(-1px);
}
.preset-card > span:last-child { min-width: 0; }
.preset-card strong,
.preset-card small { display: block; }
.preset-card strong { font-size: 0.82rem; }
.preset-card small {
  margin-top: 0.18rem;
  color: var(--fg-muted);
  font-size: 0.66rem;
  line-height: 1.25;
}
.preset-mark {
  display: grid;
  width: 1.75rem;
  height: 1.75rem;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--accent-2);
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 700;
}
.preset-mark-clean::before {
  width: 0.85rem;
  height: 0.38rem;
  border: 2px solid currentColor;
  border-radius: 2px;
  content: '';
}
.preset-mark-playful { color: #f19bd0; }
.preset-mark-bold { color: #ffe48d; }
.preset-mark-surprise { color: #9de8c0; }
.preset-reset { opacity: 0.78; }

.control-pair { align-items: start; }
.section-intro {
  margin: -0.15rem 0 1rem;
  color: var(--fg-muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.nt-stage {
  position: sticky;
  top: 1.5rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem;
}

.preview-heading { margin-bottom: 0.7rem; }
.preview-status {
  padding: 0.3rem 0.55rem;
  border: 1px solid rgba(157, 232, 192, 0.35);
  border-radius: 999px;
  background: rgba(157, 232, 192, 0.08);
  color: #9de8c0;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.preview-badges {
  display: flex;
  margin: 0 0 0.85rem;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.preview-badges span {
  padding: 0.3rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #0e0f11;
  color: var(--fg-muted);
  font-size: 0.69rem;
}

.nt-stage .canvas {
  background:
    linear-gradient(45deg, rgba(255, 255, 255, 0.035) 25%, transparent 25%) -8px 0/16px 16px,
    linear-gradient(-45deg, rgba(255, 255, 255, 0.035) 25%, transparent 25%) -8px 0/16px 16px,
    linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.035) 75%) -8px 0/16px 16px,
    linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.035) 75%) -8px 0/16px 16px;
  border-radius: 10px;
  padding: 1rem;
  display: grid;
  place-items: center;
  min-height: 300px;
}

#preview { width: 100%; max-width: 340px; height: auto; display: block; }

.fit-note {
  margin: 0.85rem 0 0;
  font-size: 0.86rem;
  line-height: 1.45;
  min-height: 2.6em;
}
.fit-note[data-kind='ok'] { color: var(--fg-muted); }
.fit-note[data-kind='info'] { color: var(--fg-muted); }
.fit-note[data-kind='error'] { color: #ff9d9d; }

.preview-summary {
  display: grid;
  margin: 0.85rem 0 0;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}
.preview-summary div {
  min-width: 0;
  padding: 0.6rem 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.16);
}
.preview-summary dt {
  color: var(--fg-muted);
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.preview-summary dd {
  margin: 0.2rem 0 0;
  font-size: 0.76rem;
  overflow-wrap: anywhere;
}
.stage-footnote {
  margin: 0.8rem 0 0;
  color: var(--fg-muted);
  font-size: 0.7rem;
  line-height: 1.45;
}

/* --------------------------------------------------------------- fields */
.field { margin-bottom: 1.15rem; }
.field > span.label,
.nt-panel label > span,
.range-heading > label {
  display: block;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 0.45rem;
}

input[type='text'],
input[type='email'],
input[type='number'],
select,
textarea {
  width: 100%;
  background: #0e0f11;
  border: 1px solid var(--border);
  color: var(--fg);
  border-radius: 8px;
  padding: 0.6rem 0.7rem;
  font: inherit;
  font-size: 0.95rem;
}
textarea { resize: vertical; }

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.choices { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.choices input { position: absolute; opacity: 0; pointer-events: none; }
.choices label {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.45rem 0.95rem;
  cursor: pointer;
  font-size: 0.9rem;
  background: #0e0f11;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.choices label:hover { border-color: var(--accent-2); }
.choices input:checked + label {
  border-color: var(--accent);
  background: var(--glow);
  color: var(--fg);
}
.choices input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }

.two-up { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.field-help {
  margin: 0.45rem 0 0;
  color: var(--fg-muted);
  font-size: 0.72rem;
  line-height: 1.45;
}

.range-field { margin-bottom: 0.15rem; }
.range-heading { margin-bottom: 0.6rem; }
.range-heading > label { margin: 0; }
.range-output {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  color: var(--accent-2);
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.2;
}
.range-output small {
  margin-top: 0.12rem;
  color: var(--fg-muted);
  font-size: 0.6rem;
}
.range-heading > output {
  color: var(--accent-2);
  font-family: var(--mono);
  font-size: 0.74rem;
  text-align: right;
}
.name-emphasis,
.custom-depth {
  margin-top: 0.15rem;
  padding: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.065);
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.13);
}
.name-emphasis .range-heading { align-items: flex-start; }
.name-emphasis .range-heading > output { max-width: 58%; }
.name-emphasis[hidden],
.custom-depth[hidden] { display: none; }
.balance-labels {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.4rem;
  margin-top: 0.2rem;
  color: var(--fg-muted);
  font-size: 0.63rem;
}
.balance-labels span:nth-child(2) { text-align: center; }
.balance-labels span:last-child { text-align: right; }
input[type='range'] {
  width: 100%;
  height: 1.3rem;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}
input[type='range']::-webkit-slider-runnable-track {
  height: 5px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), rgba(255, 255, 255, 0.14));
}
input[type='range']::-webkit-slider-thumb {
  width: 17px;
  height: 17px;
  margin-top: -6px;
  border: 2px solid #0e0f11;
  border-radius: 50%;
  background: var(--accent-2);
  -webkit-appearance: none;
}
input[type='range']::-moz-range-track {
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}
input[type='range']::-moz-range-progress {
  height: 5px;
  border-radius: 999px;
  background: var(--accent);
}
input[type='range']::-moz-range-thumb {
  width: 15px;
  height: 15px;
  border: 2px solid #0e0f11;
  border-radius: 50%;
  background: var(--accent-2);
}

/* Collapsed customisation panels.

   These read as their own interactive cards rather than as headings with a
   small "Show" chip: a title says what it covers, a subtitle says what is
   inside so nobody has to open it to find out, and a Customise button with a
   chevron makes it obvious there is more to reveal. */
.detail-section {
  padding: 0;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.detail-section > summary {
  display: flex;
  padding: 1rem 1.1rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  list-style: none;
  cursor: pointer;
  border-radius: 14px;
}
.detail-section > summary::-webkit-details-marker { display: none; }
.detail-section:hover { border-color: var(--accent-2); }
.detail-section > summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.summary-text { display: flex; flex-direction: column; gap: 0.18rem; min-width: 0; }
.summary-title { font-size: 1.02rem; font-weight: 700; line-height: 1.2; }
.summary-sub {
  color: var(--fg-muted);
  font-size: 0.83rem;
  line-height: 1.35;
}

.summary-toggle {
  display: flex;
  flex: none;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #0e0f11;
  color: var(--fg);
  font-size: 0.8rem;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.detail-section:hover .summary-toggle {
  border-color: var(--accent);
  color: var(--accent-2);
}
/* Real text in both states rather than CSS content: the label was previously in
   the markup AND in an ::after, which rendered "Customise Customise". Keeping it
   as markup also means screen readers get it reliably. */
.when-open { display: none; }
.detail-section[open] .when-closed { display: none; }
.detail-section[open] .when-open { display: inline; }

/* Millimetres under each tag-size option, so a size choice reads as a size. */
.choices label .dim {
  display: block;
  margin-top: 0.1rem;
  color: var(--fg-muted);
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.02em;
  line-height: 1.3;
  text-transform: none;
}
.choices input:checked + label .dim { color: var(--accent-2); }

.summary-chevron {
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translate(-1px, -1px);
  transition: transform 0.18s ease;
}
.detail-section[open] .summary-chevron {
  transform: rotate(-135deg) translate(-1px, -1px);
}

.detail-section[open] { border-color: var(--accent); }
.detail-section[open] > summary {
  border-bottom: 1px solid rgba(255, 255, 255, 0.065);
  border-radius: 14px 14px 0 0;
}
.detail-body { padding: 1.1rem; }
.range-stack { display: grid; gap: 0.9rem; }
.compact-range {
  margin: 0;
  padding: 0.75rem 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.13);
}

.motif-card {
  padding: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.065);
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.14);
}
.motif-card-heading {
  margin-bottom: 0.75rem;
  color: var(--fg);
  font-size: 0.82rem;
}
.motif-card-heading span { color: var(--accent-2); }
.motif-card .field:last-child { margin-bottom: 0; }
.quantity-field { max-width: 160px; }
.finish-actions { align-items: center; }
.finish-actions .small { flex: 1 1 180px; }

.colour-row {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 0.75rem;
  padding: 0.25rem 0.65rem 0.25rem 0.3rem;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #0e0f11;
}
.colour-row > span { color: var(--fg); font-size: 0.9rem; }
.colour-row input[type='color'] {
  inline-size: 52px;
  block-size: 40px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #0e0f11;
  cursor: pointer;
  flex: none;
}
.colour-code-options {
  margin: -0.25rem 0 1rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.1);
}
.colour-code-options > summary {
  color: var(--fg-muted);
  cursor: pointer;
  font-size: 0.76rem;
}
.colour-code-options .two-up { padding-top: 0.8rem; }
.colour-code-options .field { margin-bottom: 0; }
.colour-code-options input { font-family: var(--mono); text-transform: uppercase; }

.font-preview-pacifico { font-family: 'NTPacifico', cursive; }
.font-preview-montserrat { font-family: 'NTMontserrat', sans-serif; }
.font-preview-roboto_slab { font-family: 'NTRobotoSlab', serif; }
.font-preview-nunito { font-family: 'NTNunito', sans-serif; }
.font-preview-oswald { font-family: 'NTOswald', sans-serif; }

/* -------------------------------------------------------------- buttons */
button {
  font: inherit;
  cursor: pointer;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #0e0f11;
  color: var(--fg);
  padding: 0.5rem 0.9rem;
  transition: border-color 0.15s ease, background 0.15s ease, opacity 0.15s ease, transform 0.15s ease;
}
button:hover:not(:disabled) { border-color: var(--accent-2); }
button:disabled { opacity: 0.45; cursor: not-allowed; }
button.danger:hover:not(:disabled) { border-color: #ff8080; color: #ff9d9d; }

.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #0e0f11;
  font-weight: 650;
  padding: 0.7rem 1.3rem;
}
.primary:hover:not(:disabled) { background: var(--accent-2); border-color: var(--accent-2); }

.add-row { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }

/* ----------------------------------------------------------------- cart */
.nt-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin: 2.5rem 0 1rem;
}
.nt-section-head h2 { margin: 0; font-size: 1.3rem; }

.cart-item {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  padding: 0.85rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-soft);
  margin-bottom: 0.7rem;
}
.cart-item .thumb {
  width: 78px;
  height: 78px;
  background: #0e0f11;
  border-radius: 8px;
  padding: 4px;
}
.cart-info { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.cart-info strong { overflow-wrap: anywhere; }
.cart-actions { display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.cart-actions .qty { width: 68px; }
.cart-actions button { font-size: 0.85rem; padding: 0.4rem 0.7rem; }

.small { font-size: 0.85rem; }

/* ------------------------------------------------------------- checkout */
.feedback { margin-top: 0.9rem; font-size: 0.9rem; }
.feedback[data-kind='error'] { color: #ff9d9d; }
.feedback[data-kind='ok'] { color: #9de8c0; }
#cartTotals[data-kind='error'] { color: #ff9d9d; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.done-card {
  border: 1px solid var(--accent);
  background: var(--glow);
  border-radius: 14px;
  padding: 2rem 1.5rem;
  text-align: center;
  margin: 2rem 0;
}
.done-card .ref {
  font-family: var(--mono);
  font-size: 1.4rem;
  color: var(--accent-2);
  display: block;
  margin: 0.6rem 0 1rem;
  overflow-wrap: anywhere;
}

.notice {
  border-left: 3px solid var(--accent);
  padding: 0.6rem 0 0.6rem 0.9rem;
  margin: 1rem 0 0;
  color: var(--fg-muted);
  font-size: 0.86rem;
}

@media (max-width: 1080px) {
  .preset-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .preset-card { min-height: 86px; }
}

@media (max-width: 880px) {
  .nt-designer { grid-template-columns: 1fr; }
  .nt-stage { position: static; order: -1; }
  .cart-item { grid-template-columns: 60px minmax(0, 1fr); }
  .cart-item .thumb { width: 60px; height: 60px; }
  .cart-actions { grid-column: 1 / -1; justify-content: flex-start; }
}

@media (max-width: 640px) {
  .nt-wide { width: min(100% - 1.25rem, 1160px); }
  .nt-head { padding-top: 1.8rem; }
  .nt-controls { padding: 0.5rem; }
  .design-section { padding: 0.9rem; }
  .control-pair { grid-template-columns: 1fr; gap: 0; }
  .preset-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .preset-card { min-height: 94px; }
  .detail-section { padding: 0; }
  .detail-body { padding: 0.9rem; }
  .preview-summary { grid-template-columns: 1fr; }
}

@media (max-width: 460px) {
  .two-up { grid-template-columns: 1fr; }
  .motif-grid { gap: 0.75rem; }
  .section-heading { align-items: flex-start; }
  .preset-card { min-height: 88px; }
}
