/* MalletMaker POC — VisionCraft palette: red / black / white / gray */
:root {
  --vc-red: #c8102e;
  --vc-red-dark: #9c0c23;
  --ink: #1a1a1a;
  --muted: #6b6b6b;
  --line: #e4e4e4;
  --bg: #f7f6f4;
  --panel: #ffffff;
  --wood-shadow: rgba(43, 26, 13, 0.18);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ---- Concept header ---- */
header.concept {
  text-align: center;
  padding: 38px 20px 5px;
}
header.concept .brand-banner {
  display: block;
  width: auto;
  /* Admin-adjustable in the Configuration Studio (Branding tab); --banner-width is
     set from /api/branding. Falls back to 800px and never exceeds the viewport. */
  max-width: min(var(--banner-width, 800px), 100%);
  height: auto;
  margin: 0 auto;
}
/* The author display:block above would otherwise override the [hidden] attribute,
   so honor it explicitly when the admin toggles the banner off. */
header.concept .brand-banner[hidden] {
  display: none;
}
header.concept .brand {
  font-family: "Cinzel", Georgia, serif;
  font-size: 13px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--vc-red);
  font-weight: 600;
}
header.concept h1 {
  font-family: "Cinzel", Georgia, serif;
  font-size: clamp(34px, 6vw, 56px);
  margin: 6px 0 4px;
  letter-spacing: 0.01em;
}
header.concept p.tagline {
  font-size: 17px;
  color: var(--muted);
  max-width: 620px;
  margin: 8px auto 0;
  line-height: 1.5;
}
header.concept .attribution {
  margin-top: 14px;
  font-size: 12.5px;
  color: var(--muted);
  letter-spacing: 0.02em;
}

/* ---- Main two-column layout ---- */
main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  max-width: 1180px;
  margin: 6px auto 18px;
  padding: 0 24px;
  align-items: start;
}
@media (max-width: 860px) {
  main { grid-template-columns: 1fr; }
}

/* ---- Stage (the mallet preview) ---- */
.stage {
  background: linear-gradient(180deg, #fbfaf8, #f0eeea);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 10px 30px rgba(0,0,0,0.05);
  position: relative;
}
#mallet {
  width: auto;
  max-width: 100%;
  max-height: 62vh;
  border-radius: 8px;
  /* preview is canvas, not a savable <img> — light asset friction per spec §8 */
  user-select: none;
  -webkit-user-drag: none;
}
.stage .hint {
  margin-top: 14px;
  font-size: 12.5px;
  color: var(--muted);
}

/* ---- Controls panel ---- */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}
.panel h2 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin: 0 0 14px;
  font-weight: 700;
}
.field { margin-bottom: 22px; }
.field > label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
}

/* segmented control: Text / Logo */
.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 24px;
}
.segmented button {
  appearance: none;
  border: none;
  background: #fff;
  padding: 11px 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.segmented button[aria-selected="true"] {
  background: var(--vc-red);
  color: #fff;
}

input[type="text"] {
  width: 100%;
  padding: 12px 14px;
  font-size: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  transition: border-color 0.15s;
}
input[type="text"]:focus { border-color: var(--vc-red); }

#line2-wrap { margin-top: 10px; }

.linklike {
  appearance: none;
  background: none;
  border: none;
  padding: 8px 0 0;
  margin: 0;
  color: var(--vc-red);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.linklike:hover { text-decoration: underline; }

/* font chips */
.fonts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.fonts button {
  appearance: none;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 12px 6px;
  font-size: 18px;
  cursor: pointer;
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.fonts button[aria-selected="true"] {
  border-color: var(--vc-red);
  box-shadow: inset 0 0 0 1px var(--vc-red);
}

/* upload */
.dropzone {
  border: 1.5px dashed #cfccc6;
  border-radius: 12px;
  padding: 26px 16px;
  text-align: center;
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.dropzone:hover { border-color: var(--vc-red); background: #fffafa; }
.dropzone strong { color: var(--ink); }
.dropzone input { display: none; }

.mode-note {
  font-size: 12px;
  color: var(--muted);
  margin-top: 10px;
  line-height: 1.45;
}
.mode-note .exact {
  display: inline-block;
  font-weight: 700;
  color: var(--vc-red);
}

.status {
  font-size: 13px;
  margin-top: 12px;
  min-height: 18px;
  color: var(--muted);
}
.status.error { color: var(--vc-red); }
.status.ok { color: #1a7f37; }

/* Converted 1-bit art shown beside the explanation. */
.logo-result {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}
.logo-art-wrap {
  flex: 0 0 96px;
  width: 96px;
  height: 72px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background:
    linear-gradient(45deg, #f0eee9 25%, transparent 25%, transparent 75%, #f0eee9 75%) 0 0/14px 14px,
    linear-gradient(45deg, #f0eee9 25%, #fff 25%, #fff 75%, #f0eee9 75%) 7px 7px/14px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.logo-art-wrap img { max-width: 88%; max-height: 88%; display: block; }
.logo-art-cap { font-size: 12px; color: var(--muted); line-height: 1.4; }

/* Honest confidence-gate banner (review verdict). */
.logo-verdict {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #f0d8a8;
  background: #fdf6e8;
  font-size: 13px;
  line-height: 1.5;
  color: #6b5418;
}
.logo-verdict strong { display: block; margin-bottom: 4px; color: #8a5a00; }
.logo-verdict ul { margin: 4px 0 0; padding-left: 18px; }
.logo-verdict li { margin: 2px 0; }

.toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  margin-top: 6px;
}

/* Side selector as folder tabs; the editor sits inside the active side's card. */
.side-tabs { display: flex; gap: 4px; }
.side-tab {
  appearance: none;
  border: 1px solid var(--line);
  border-bottom: none;
  background: #f3f1ee;
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
  padding: 10px 18px;
  min-width: 126px;
  text-align: center;
  border-radius: 10px 10px 0 0;
  cursor: pointer;
  position: relative;
  top: 1px;
  transition: background 0.15s, color 0.15s;
}
.side-tab[aria-selected="true"] { background: var(--panel); color: var(--vc-red); }
.side-tabcard {
  border: 1px solid var(--line);
  border-radius: 0 12px 12px 12px;
  padding: 18px 18px 4px;
  margin-bottom: 8px;
}
.side-hint { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 12.5px; color: var(--muted); margin: 0 0 14px; }
.side-hint .linklike { padding: 0; font-size: 12.5px; white-space: nowrap; }

/* "What to engrave" — quiet underline mini-tabs (secondary to the side tabs). */
.engrave-tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.engrave-tabs button {
  appearance: none;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 4px 1px 9px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
}
.engrave-tabs button[aria-selected="true"] { color: var(--vc-red); border-bottom-color: var(--vc-red); }

.lifestyle {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.lifestyle h2 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin: 0 0 12px;
  font-weight: 700;
}
#lifestyle {
  width: 100%;
  height: auto;
  border-radius: 10px;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

.hidden { display: none !important; }

/* ---- Panel tabs (Customize / Order) ---- */
.panel-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--line);
  margin: -4px -4px 20px;
}
.ptab {
  appearance: none;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 8px 12px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.ptab[aria-selected="true"] {
  color: var(--vc-red);
  border-bottom-color: var(--vc-red);
}

/* ---- Order section (now nested inside the panel's Order tab) ---- */
.order { /* flat — the panel already provides the card */ }
.order h2 { /* e.g. the post-submit "Thank you" — override .panel h2 */
  font-size: 20px;
  text-transform: none;
  letter-spacing: normal;
  color: var(--ink);
  margin: 0 0 6px;
  font-weight: 700;
}
.order-intro { color: var(--muted); margin: 0 0 22px; font-size: 14px; }
.order-row { display: flex; gap: 10px; }
.order-row input { margin-bottom: 10px; }
.order .ship-state { flex: 0 0 70px; }
.order .ship-zip { flex: 0 0 110px; }

/* Shipping / billing address tabs (Order form). */
.addr-tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.addr-tab {
  appearance: none;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 4px 1px 9px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
}
.addr-tab[aria-selected="true"] { color: var(--vc-red); border-bottom-color: var(--vc-red); }
.addr-same { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--ink); margin: 2px 0 14px; cursor: pointer; }
.addr-same input { width: auto; margin: 0; }
/* Compact quantity + price bar; tapping it reveals the volume pricing table. */
.price-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #faf7f2;
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
}
.price-bar #order-qty { width: 64px; text-align: center; padding: 9px 6px; font-size: 16px; margin-bottom: 0; background: #fff; }
.pb-mult { font-size: 14px; }
.pb-unit { font-weight: 700; }
.pb-ea { color: var(--muted); font-size: 12px; }
.pb-second { font-size: 12px; color: var(--muted); }
.pb-spacer { flex: 1; }
.pb-total { font-size: 18px; font-weight: 700; color: var(--ink); }
.pb-chev { appearance: none; background: none; border: none; cursor: pointer; color: var(--muted); font-size: 15px; line-height: 1; padding: 2px 4px; }
.price-table { margin: 12px 2px 0; }
.ptable { width: 100%; border-collapse: collapse; font-size: 13px; }
.ptable th { text-align: left; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 4px 0; border-bottom: 1px solid var(--line); }
.ptable td { padding: 5px 0; border-bottom: 1px solid #f1f1f1; }
.ptable td:last-child { text-align: right; font-weight: 600; }
.ptable-note { font-size: 12px; color: var(--muted); margin-top: 8px; }
.order-block { margin-bottom: 22px; }
.order-q {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
}
.order .segmented { margin-bottom: 12px; }
.order-note { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.order input[type="number"],
.order input[type="email"],
.order input[type="tel"],
.order input[type="text"] {
  width: 100%;
  padding: 12px 14px;
  font-size: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  transition: border-color 0.15s;
  margin-bottom: 10px;
}
.order input:focus { border-color: var(--vc-red); }
.btn-order {
  appearance: none;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  background: var(--vc-red);
  color: #fff;
  width: 100%;
  padding: 15px;
  font-size: 16px;
}
.btn-order:hover { background: var(--vc-red-dark); }
.btn-order:disabled { opacity: 0.6; cursor: default; }
.order-sides { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
.order-actions { margin-top: 26px; }
.order-status { min-height: 18px; margin-top: 12px; font-size: 13.5px; color: var(--muted); text-align: center; }
.order-status.err { color: var(--vc-red); font-weight: 600; }

/* Email-verification panel (shown after the order is submitted). */
.verify-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.verify-head h2 { margin: 0; }
.verify-mail { width: 34px; height: 34px; border-radius: 50%; background: #fdeef0; color: var(--vc-red); display: flex; align-items: center; justify-content: center; font-size: 17px; flex: 0 0 auto; }
.verify-explain { font-size: 14px; color: var(--muted); line-height: 1.5; margin: 0 0 10px; }
.verify-spam { font-size: 13px; color: #6b5418; background: #fdf6e8; border: 1px solid #f0d8a8; border-radius: 10px; padding: 9px 12px; margin: 0 0 16px; line-height: 1.45; }
.verify-spam strong { color: #8a5a00; }
.verify-explain strong { color: var(--ink); }
#verify-code { width: 100%; text-align: center; font-size: 26px; letter-spacing: 12px; font-weight: 700; padding: 14px 10px 14px 22px; margin-bottom: 8px; font-variant-numeric: tabular-nums; }
.verify-err { min-height: 18px; font-size: 13px; font-weight: 600; color: var(--vc-red); margin: 2px 0 8px; }
.verify-err.ok { color: #1a7f37; }
.verify-meta { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; color: var(--muted); margin-bottom: 16px; }
.verify-back { text-align: center; margin-top: 14px; }

footer {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  padding: 0 20px 50px;
  line-height: 1.6;
}
footer .nap { font-weight: 600; color: var(--ink); }
