/* PageMakeover shared styles. Light UI with a dark "light box" stage for the artwork. */
:root {
  --bg: #f6f3ee;
  --panel: #fffdf9;
  --line: #e6e0d6;
  --fg: #17161a;
  --muted: #6b655c;
  --brand: #ff5b2e;
  --brand-ink: #ffffff;
  --brand-soft: #ffe6dc;
  --stage: #19181b;
  --stage-line: #2f2d31;
  --stage-fg: #e4e0da;
  --ok: #1f7a4a;
  --display: "Bricolage Grotesque", "Archivo", "Helvetica Neue", Arial, sans-serif;
  --body: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--fg); font: 15px/1.5 var(--body); }
[hidden] { display: none !important; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
a { color: inherit; }

.btn { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 8px 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; font-weight: 600; text-decoration: none; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { filter: brightness(1.05); }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn.big { padding: 13px 22px; font-size: 17px; border-radius: 10px; }
.btn:disabled { opacity: .55; cursor: default; }
.lock { width: 14px; height: 14px; }

.logo { font: 800 20px/1 var(--display); letter-spacing: -.01em; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.logo i { width: 26px; height: 26px; border-radius: 7px; background: var(--brand); display: inline-grid; place-items: center; font-style: normal; color: #fff; font-size: 15px; }

/* ---------- app ---------- */
.app { display: grid; grid-template-rows: auto 1fr; height: 100%; }
.top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--panel); }
.top .grow { flex: 1 1 160px; min-width: 0; }
.top select { border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; background: #fff; max-width: 100%; }
.main { display: grid; grid-template-columns: 360px minmax(0, 1fr); min-height: 0; }
.rail { background: var(--panel); border-right: 1px solid var(--line); overflow-y: auto; padding: 0 16px 40px; }
.sec { display: grid; gap: 10px; padding-block: 16px; border-bottom: 1px solid var(--line); }
.sec:last-child { border-bottom: 0; }
.sec h2 { margin: 0; font: 700 13px/1 var(--body); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
label.f { display: grid; gap: 3px; font-size: 12.5px; color: var(--muted); min-width: 0; }
label.f input, label.f textarea, label.f select { width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 7px; padding: 7px 9px; font-size: 14px; color: var(--fg); }
label.f textarea { resize: vertical; min-height: 56px; }
.hint { font-size: 12.5px; color: var(--muted); margin: 0; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.swatches { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; }
.sw { width: 28px; height: 28px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); cursor: pointer; padding: 0; }
.sw[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--fg); }
.sw-custom { width: 36px; height: 30px; border: 1px solid var(--line); border-radius: 6px; padding: 2px; background: #fff; cursor: pointer; }

.logo-row { display: flex; gap: 10px; align-items: center; }
.logo-box { width: 56px; height: 56px; border-radius: 8px; border: 1px dashed var(--line); background: repeating-conic-gradient(#eee 0 25%, #fff 0 50%) 0 0/10px 10px; display: grid; place-items: center; overflow: hidden; flex: none; font-size: 11px; color: var(--muted); }
.logo-box img { max-width: 100%; max-height: 100%; }

.photos { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.ph { position: relative; aspect-ratio: 1; border-radius: 7px; overflow: hidden; border: 2px solid transparent; padding: 0; cursor: pointer; background: var(--line); }
.ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph[aria-pressed="true"] { border-color: var(--brand); }
.ph .x { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; background: rgba(0,0,0,.65); color: #fff; font-size: 13px; line-height: 20px; text-align: center; display: none; }
.ph:hover .x { display: block; }
.ph .tag { position: absolute; left: 3px; bottom: 3px; font-size: 9.5px; background: rgba(0,0,0,.6); color: #fff; padding: 1px 4px; border-radius: 3px; }
.ph-add { border: 1.5px dashed var(--muted); background: transparent; color: var(--muted); font-size: 24px; display: grid; place-items: center; }

.layouts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.lay { border: 1px solid var(--line); background: #fff; border-radius: 9px; padding: 6px; cursor: pointer; display: grid; gap: 4px; text-align: left; }
.lay canvas { width: 100%; display: block; border-radius: 5px; background: #222; }
.lay b { font-size: 12.5px; }
.lay[aria-pressed="true"] { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }

.range { display: grid; grid-template-columns: 80px 1fr 40px; gap: 8px; align-items: center; font-size: 12.5px; color: var(--muted); }
.range output { font: 12px var(--mono); text-align: right; }
input[type=range] { width: 100%; accent-color: var(--brand); }

.stage { background: var(--stage); color: var(--stage-fg); display: grid; grid-template-rows: auto 1fr auto; min-height: 0; min-width: 0; }
.tabs { display: flex; gap: 2px; padding: 10px 16px 0; border-bottom: 1px solid var(--stage-line); overflow-x: auto; }
.tab { background: none; border: 0; color: var(--stage-fg); opacity: .62; padding: 9px 12px 11px; cursor: pointer; font-weight: 600; font-size: 14px; border-bottom: 2px solid transparent; white-space: nowrap; }
.tab[aria-selected="true"] { opacity: 1; border-bottom-color: var(--brand); }
.tab small { font: 10.5px var(--mono); opacity: .7; margin-left: 4px; }
.canvas-wrap { overflow: auto; display: grid; place-items: center; padding: 24px 16px; min-height: 0; }
#view { max-width: 100%; height: auto; display: block; box-shadow: 0 10px 40px rgba(0,0,0,.5); touch-action: none; }
#view.drag { cursor: grab; } #view.dragging { cursor: grabbing; }
.stage-foot { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 10px 16px; border-top: 1px solid var(--stage-line); }
.dims { font: 12px var(--mono); opacity: .8; flex: 1 1 200px; }
.stage .btn:not(.primary) { background: transparent; border-color: var(--stage-line); color: var(--stage-fg); }
.seg { display: inline-flex; border: 1px solid var(--stage-line); border-radius: 8px; overflow: hidden; }
.seg button { background: transparent; border: 0; color: var(--stage-fg); padding: 6px 10px; cursor: pointer; font-size: 13px; }
.seg button[aria-pressed="true"] { background: var(--stage-line); }

.modal { position: fixed; inset: 0; background: rgba(15,14,17,.72); display: grid; place-items: center; padding: 16px; z-index: 40; }
.card { background: var(--panel); color: var(--fg); border-radius: 14px; padding: 22px; width: min(820px, 100%); max-height: calc(100% - 8px); overflow: auto; display: grid; gap: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.4); }
.card h3 { margin: 0; font: 800 26px/1.15 var(--display); }
.card .x { justify-self: end; }
.pkgs { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.pkg { border: 1.5px solid var(--line); border-radius: 12px; padding: 14px; display: grid; gap: 6px; align-content: start; background: #fff; text-align: left; cursor: pointer; position: relative; }
.pkg:hover { border-color: var(--fg); }
.pkg .price { font: 800 30px/1 var(--display); }
.pkg .price s { font-size: 16px; color: var(--muted); font-weight: 600; margin-left: 4px; }
.pkg b { font-size: 15px; }
.pkg ul { margin: 2px 0 0; padding-left: 18px; font-size: 13px; color: var(--muted); }
.pkg .flag { position: absolute; top: -10px; right: 12px; background: var(--brand); color: #fff; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 99px; }
.pkg.best { border-color: var(--brand); }
.files { display: grid; gap: 8px; }
.file { display: flex; gap: 10px; align-items: center; justify-content: space-between; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fff; flex-wrap: wrap; }
.file span { min-width: 0; }
.progress { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--brand); width: 0; transition: width .2s; }
.toast { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--fg); color: #fff; padding: 10px 16px; border-radius: 9px; font-size: 14px; z-index: 60; max-width: calc(100% - 32px); box-shadow: 0 6px 24px rgba(0,0,0,.3); }
.paid-badge { background: #e3f4ea; color: var(--ok); font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: 99px; }

.note-warn { font-size: 13px; background: #fff3d6; border-radius: 8px; padding: 8px 10px; margin: 0; }
.steps-list { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 13.5px; }
.steps-list b { font-weight: 700; }
.cap { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 10px 12px; display: grid; gap: 6px; }
.cap pre { margin: 0; white-space: pre-wrap; font: 13.5px/1.45 var(--body); }
.cap .row { justify-content: space-between; }
.upsell { display: grid; gap: 10px; }
.up { border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; background: #fff; display: grid; gap: 6px; }
.up.best { border-color: var(--brand); }
.up b { font-size: 15px; } .up .price { font: 800 22px var(--display); }
.lp-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 16px; min-height: 0; }
.lp-form { display: grid; gap: 10px; align-content: start; max-height: 66vh; overflow: auto; padding-right: 4px; }
.lp-prev iframe { width: 100%; height: 66vh; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.chk2 { display: flex; gap: 8px; align-items: center; font-size: 13.5px; }
.bump { display: flex; gap: 10px; align-items: flex-start; border: 1.5px dashed var(--brand); background: var(--brand-soft); border-radius: 10px; padding: 10px 12px; font-size: 14px; cursor: pointer; }
.bump input { margin-top: 3px; accent-color: var(--brand); }

@media (max-width: 880px) {
  .lp-grid { grid-template-columns: 1fr; }
  .lp-prev iframe { height: 60vh; }
  .app { height: auto; }
  .main { grid-template-columns: 1fr; }
  .stage { order: -1; }
  .rail { border-right: 0; overflow: visible; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
