/* LocaleWeb Studio — builder UI
   Brand tokens mirror localeweb.co.uk so Studio reads as the same company. */

:root {
  --green: #2F8F4F;
  --green-dark: #1F6B39;
  --green-soft: #E8F3EC;
  --amber: #E8A13A;
  --blue: #2B6FB8;
  --red: #A63D3D;

  --ink: #14241B;
  --ink-soft: #3F5247;
  --muted: #6B7C71;
  --cream: #FAF6EC;
  --line: #E5E0CE;
  --white: #FFFFFF;

  --shadow-sm: 0 1px 2px rgba(20,36,27,.06), 0 1px 3px rgba(20,36,27,.08);
  --shadow-md: 0 4px 12px rgba(20,36,27,.08), 0 12px 30px rgba(20,36,27,.10);
  --shadow-lg: 0 10px 30px rgba(20,36,27,.12), 0 25px 60px rgba(20,36,27,.16);

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;

  --rail: 460px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--ink);
  background: var(--cream);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 0 0 .5em;
  line-height: 1.15;
}

button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }

/* ─────────── App shell ─────────── */

.studio {
  display: grid;
  grid-template-columns: var(--rail) 1fr;
  height: 100vh;
  overflow: hidden;
}

.rail {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border-right: 1px solid var(--line);
  overflow: hidden;
}

.stage {
  position: relative;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(47,143,79,.10) 0%, transparent 55%),
    radial-gradient(ellipse at 90% 10%, rgba(232,161,58,.12) 0%, transparent 50%),
    var(--cream);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ─────────── Rail header ─────────── */

.rail-head {
  padding: 18px 24px 14px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: .95rem;
  letter-spacing: -.01em;
  text-decoration: none;
  color: var(--ink);
}

.brand-mark {
  width: 32px; height: 32px;
  border-radius: 9px;
  background: linear-gradient(145deg, var(--green), var(--green-dark));
  color: #fff;
  display: grid; place-items: center;
  font-size: .8rem; font-weight: 800;
  letter-spacing: -.03em;
  box-shadow: var(--shadow-sm);
}

.brand small {
  display: block;
  font-weight: 500;
  font-size: .72rem;
  color: var(--muted);
  letter-spacing: .02em;
  text-transform: uppercase;
}

.save-pill {
  margin-left: auto;
  font-size: .72rem;
  font-weight: 600;
  color: var(--green-dark);
  background: var(--green-soft);
  border-radius: 999px;
  padding: 5px 11px;
  transition: opacity .3s;
}
.save-pill[data-state='saving'] { opacity: .5; }

/* ─────────── Progress ─────────── */

.progress {
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
}

.progress-track {
  height: 5px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--green), var(--amber));
  transition: width .35s cubic-bezier(.4,0,.2,1);
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 8px;
  font-size: .78rem;
  color: var(--muted);
}
.progress-meta strong { color: var(--ink); font-weight: 600; }

/* ─────────── Steps ─────────── */

.rail-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.step { display: none; animation: rise .3s ease both; }
.step.is-active { display: block; }

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.step-eyebrow {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 8px;
}

.step h2 { font-size: 1.45rem; }

.step-lead {
  color: var(--ink-soft);
  font-size: .92rem;
  margin: -.2em 0 22px;
}

/* ─────────── Fields ─────────── */

.field { margin-bottom: 18px; }

.field label {
  display: block;
  font-size: .84rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.field .hint {
  font-size: .78rem;
  color: var(--muted);
  margin: 0 0 7px;
}

/* The repeater (services, testimonials) appends bare inputs straight into .item
   with no .field wrapper, so it has to be named here too — otherwise those
   inputs fall back to the browser's ~20-character intrinsic width. */
.field input[type='text'],
.field input[type='email'],
.field input[type='tel'],
.field input[type='url'],
.field select,
.field textarea,
.item input[type='text'],
.item textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--white);
  transition: border-color .15s, box-shadow .15s;
}

.field textarea { min-height: 92px; resize: vertical; line-height: 1.5; }

.field input:focus,
.field select:focus,
.field textarea:focus,
.item input:focus,
.item textarea:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(47,143,79,.14);
}

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.char-count { font-size: .72rem; color: var(--muted); text-align: right; margin-top: 4px; }

/* ─────────── Trade picker ─────────── */

.trade-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
}

.trade-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 12px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--white);
  text-align: left;
  font-size: .86rem;
  font-weight: 500;
  transition: all .15s;
}

.trade-chip:hover { border-color: var(--green); transform: translateY(-1px); }

.trade-chip[aria-pressed='true'] {
  border-color: var(--green);
  background: var(--green-soft);
  font-weight: 600;
  box-shadow: 0 0 0 3px rgba(47,143,79,.12);
}

.trade-chip .ico { font-size: 1.15rem; line-height: 1; }

/* "Something else" spans the row and is dashed, so it reads as the catch-all
   rather than as a fifteenth trade. */
.trade-chip.is-other {
  grid-column: 1 / -1;
  border-style: dashed;
  justify-content: center;
  color: var(--ink-soft);
}
.trade-chip.is-other[aria-pressed='true'] { border-style: solid; color: var(--ink); }

/* ─────────── Colour picker ─────────── */

.swatches { display: flex; flex-wrap: wrap; gap: 10px; }

.swatch {
  width: 42px; height: 42px;
  border-radius: 12px;
  border: 2.5px solid transparent;
  box-shadow: var(--shadow-sm);
  transition: transform .15s;
  position: relative;
}
.swatch:hover { transform: scale(1.08); }
.swatch[aria-pressed='true'] {
  border-color: var(--ink);
  transform: scale(1.08);
}
.swatch[aria-pressed='true']::after {
  content: '✓';
  position: absolute; inset: 0;
  display: grid; place-items: center;
  color: #fff; font-size: 1rem; font-weight: 700;
  text-shadow: 0 1px 3px rgba(0,0,0,.4);
}

/* ─────────── Repeatable items ─────────── */

.items { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }

.item {
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px;
  background: var(--white);
  position: relative;
}

.item-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.item-head .idx {
  width: 20px; height: 20px;
  border-radius: 6px;
  background: var(--green-soft);
  color: var(--green-dark);
  display: grid; place-items: center;
  font-size: .7rem; font-weight: 700;
  flex-shrink: 0;
}

.item input, .item textarea { margin-bottom: 8px; }
.item textarea { min-height: 60px; }
.item > *:last-child { margin-bottom: 0; }

.item-remove {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1;
  padding: 2px 5px;
  border-radius: 6px;
}
.item-remove:hover { color: var(--red); background: rgba(166,61,61,.08); }

.add-btn {
  width: 100%;
  padding: 10px;
  border: 1.5px dashed var(--line);
  border-radius: var(--radius-sm);
  background: none;
  color: var(--ink-soft);
  font-weight: 600;
  font-size: .86rem;
  transition: all .15s;
}
.add-btn:hover { border-color: var(--green); color: var(--green-dark); background: var(--green-soft); }

/* ─────────── Tag input ─────────── */

.tags { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 9px; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green-dark);
  font-size: .8rem;
  font-weight: 600;
}
.tag button {
  background: none; border: none; padding: 0;
  color: inherit; opacity: .6; font-size: .95rem; line-height: 1;
}
.tag button:hover { opacity: 1; }

/* ─────────── Checkbox list ─────────── */

.checks { display: flex; flex-direction: column; gap: 7px; }

.check {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--white);
  font-size: .86rem;
  cursor: pointer;
  transition: all .15s;
}
.check:hover { border-color: var(--green); }
.check input { accent-color: var(--green); width: 16px; height: 16px; }
.check:has(input:checked) { border-color: var(--green); background: var(--green-soft); font-weight: 600; }

/* ─────────── Uploads ─────────── */

.uploader {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  padding: 16px;
  border: 1.5px dashed var(--line);
  border-radius: var(--radius-sm);
  background: var(--white);
  cursor: pointer;
  transition: all .15s;
}
.uploader:hover { border-color: var(--green); background: var(--green-soft); }

.up-ico {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--green-soft);
  color: var(--green-dark);
  display: grid; place-items: center;
  font-size: 1.1rem; font-weight: 700;
  flex-shrink: 0;
}
.up-txt { font-size: .88rem; font-weight: 600; }
.up-txt small { display: block; font-weight: 500; color: var(--muted); font-size: .76rem; }

.up-warn {
  font-size: .8rem;
  color: var(--red);
  background: rgba(166,61,61,.07);
  border-radius: 8px;
  padding: 8px 11px;
  margin: 9px 0 0;
}

.logo-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--white);
  margin-bottom: 18px;
}
.logo-preview img {
  height: 52px; max-width: 150px;
  object-fit: contain;
}
.logo-preview .btn { margin-left: auto; padding: 8px 14px; font-size: .82rem; }

.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin-bottom: 11px;
}

.photo-item { position: relative; aspect-ratio: 4 / 3; }
.photo-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 9px;
  border: 1.5px solid var(--line);
  display: block;
}
.photo-item button {
  position: absolute; top: 5px; right: 5px;
  width: 23px; height: 23px;
  border: none; border-radius: 50%;
  background: rgba(20,36,27,.72);
  color: #fff; font-size: .72rem; line-height: 1;
  display: grid; place-items: center;
  backdrop-filter: blur(3px);
}
.photo-item button:hover { background: var(--red); }

/* ─────────── Hours ─────────── */

.hours { display: flex; flex-direction: column; gap: 6px; }

.hour-row {
  display: grid;
  grid-template-columns: 46px 1fr;
  align-items: center;
  gap: 10px;
}
.hour-row span { font-size: .8rem; font-weight: 600; color: var(--ink-soft); }
.hour-row input { padding: 8px 11px !important; }

/* ─────────── Rail footer ─────────── */

.rail-foot {
  padding: 16px 24px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 10px;
  align-items: center;
  background: var(--white);
}

.btn {
  border: none;
  border-radius: var(--radius-sm);
  padding: 11px 20px;
  font-weight: 600;
  font-size: .9rem;
  transition: all .18s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.btn-primary {
  background: linear-gradient(145deg, var(--green), var(--green-dark));
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }

.btn-ghost {
  background: none;
  color: var(--ink-soft);
  border: 1.5px solid var(--line);
}
.btn-ghost:hover { border-color: var(--ink-soft); }

.btn-lg { padding: 14px 26px; font-size: .98rem; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none !important; }

.rail-foot .spacer { flex: 1; }

/* ─────────── Stage / preview ─────────── */

.stage-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.72);
  backdrop-filter: blur(8px);
}

.stage-title {
  font-size: .82rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.devices { display: flex; gap: 4px; margin-left: auto; background: var(--cream); padding: 3px; border-radius: 10px; }

.device-btn {
  border: none;
  background: none;
  padding: 6px 13px;
  border-radius: 8px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--muted);
  transition: all .15s;
}
.device-btn[aria-pressed='true'] { background: var(--white); color: var(--ink); box-shadow: var(--shadow-sm); }

.stage-body {
  flex: 1;
  overflow: auto;
  display: grid;
  place-items: start center;
  padding: 26px;
}

.frame-wrap {
  width: 100%;
  max-width: 1180px;
  height: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: #fff;
  transition: max-width .35s cubic-bezier(.4,0,.2,1);
}
.frame-wrap[data-device='tablet'] { max-width: 810px; }
.frame-wrap[data-device='mobile'] { max-width: 400px; }

#preview { width: 100%; height: 100%; border: 0; display: block; }

/* ─────────── Launch screen ─────────── */

.launch { max-width: 560px; }

.plan-card {
  border: 2px solid var(--green);
  border-radius: var(--radius);
  padding: 20px;
  background: var(--green-soft);
  margin-bottom: 18px;
}

.plan-price {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 2.6rem;
  font-weight: 800;
  line-height: 1;
  color: var(--green-dark);
}
.plan-price span { font-family: 'Inter', sans-serif; font-size: .95rem; font-weight: 500; color: var(--ink-soft); }

.plan-list { list-style: none; padding: 0; margin: 14px 0 0; font-size: .88rem; }
.plan-list li { padding-left: 24px; position: relative; margin-bottom: 7px; }
.plan-list li::before {
  content: '✓';
  position: absolute; left: 0;
  color: var(--green); font-weight: 700;
}

.upsell {
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  background: var(--white);
  font-size: .86rem;
  color: var(--ink-soft);
}
.upsell strong { color: var(--ink); }

.done-banner {
  text-align: center;
  padding: 30px 20px;
}
.done-banner .tick {
  width: 62px; height: 62px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green);
  display: grid; place-items: center;
  font-size: 1.9rem;
}

/* ─────────── Mobile ─────────── */

@media (max-width: 980px) {
  .studio { grid-template-columns: 1fr; height: auto; overflow: visible; }
  .stage { height: 78vh; position: sticky; top: 0; order: -1; }
  .rail { border-right: none; border-top: 1px solid var(--line); }
  .rail-body { overflow: visible; }
}
