/* ============================================================
   ΣΤΕΦΑΝΑ — onboarding builder (create.html)
   Two-pane: wizard (left) + live preview (right).
   ============================================================ */
html, body { height: 100%; overflow: hidden; }

.builder { height: 100dvh; display: flex; flex-direction: column; }

/* top bar */
.bhead {
  flex: none; display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: .7rem clamp(1rem, 3vw, 1.6rem);
  background: var(--surface); border-bottom: 1px solid var(--line); z-index: 20;
}
.bhead .brand__name { font-size: 1.2rem; }
.bhead__mid { display: flex; align-items: center; gap: .8rem; color: var(--ink-faint); font-size: var(--step--1); }
.save-dot { display: inline-flex; align-items: center; gap: .4em; }
.save-dot i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); display: block; }
.bhead__actions { display: flex; align-items: center; gap: .6rem; }
.bhead__exit { font-size: var(--step--1); color: var(--ink-soft); }
.preview-toggle { display: none; }

/* main grid */
.bgrid { flex: 1; display: grid; grid-template-columns: minmax(380px, 46%) 1fr; min-height: 0; }

/* ---- form pane ---- */
.bform { display: flex; flex-direction: column; min-height: 0; background: var(--paper); }
.bform__top { flex: none; padding: 1.2rem clamp(1.2rem, 3vw, 2.2rem) 0; }
.bprogress { height: 4px; border-radius: 100px; background: var(--paper-3); overflow: hidden; }
.bprogress i { display: block; height: 100%; background: var(--accent); width: 0; transition: width .4s var(--ease); }
.bsteps-dots { display: flex; flex-wrap: wrap; gap: 2px; margin-top: .4rem; }
.bsteps-dots button { position: relative; width: 30px; height: 26px; background: transparent; }
.bsteps-dots button::before { content: ""; position: absolute; left: 2px; right: 2px; top: calc(50% - 2.5px); height: 5px; border-radius: 100px; background: var(--paper-3); transition: background .3s var(--ease); }
.bsteps-dots button.done::before { background: var(--accent-tint); }
.bsteps-dots button.active::before { background: var(--accent); }
.bsteps-dots button.locked { opacity: .5; }

.bform__body { flex: 1; overflow-y: auto; padding: 1.4rem clamp(1.2rem, 3vw, 2.2rem) 2rem; }
.bstepmeta { font-size: var(--step--1); color: var(--accent-deep); font-weight: 600; letter-spacing: .04em; }
.bstepmeta .lock { display: inline-flex; align-items: center; gap: .3em; }
.bform__body h2 { font-size: var(--step-2); margin: .3rem 0 .4rem; }
.bstepdesc { color: var(--ink-soft); margin-bottom: 1.6rem; }

.bform__nav {
  flex: none; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1rem clamp(1.2rem, 3vw, 2.2rem); border-top: 1px solid var(--line); background: var(--surface);
}
.bform__nav .spacer { flex: 1; }

/* ---- fields ---- */
.field { margin-bottom: 1.3rem; }
.field > label, .field__label { display: block; font-weight: 600; font-size: var(--step--1); margin-bottom: .45rem; }
.field__help { color: var(--ink-faint); font-size: var(--step--2); margin-top: .4rem; line-height: 1.5; }
.inp, .ta, .sel {
  width: 100%; font: inherit; font-size: var(--step-0); color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: .75em .9em; transition: border-color .25s var(--ease), box-shadow .25s var(--ease);
}
.inp:focus, .ta:focus, .sel:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ta { resize: vertical; min-height: 92px; line-height: 1.5; }
.field--row { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.field--row .field { margin-bottom: 0; }
.inp-suffix { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; background: var(--surface); }
.inp-suffix:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.inp-suffix .inp { border: 0; box-shadow: none; }
.inp-suffix .sfx { display: flex; align-items: center; padding: 0 .9em; background: var(--paper-2); color: var(--ink-soft); font-size: var(--step--1); white-space: nowrap; }

/* toggle row */
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .9rem 0; }
.toggle-row .tl { font-weight: 600; font-size: var(--step-0); }
.toggle-row small { display: block; color: var(--ink-faint); font-size: var(--step--2); font-weight: 400; margin-top: .15rem; }

/* segmented (role, device) */
.seg { display: inline-flex; background: var(--paper-2); border-radius: 100px; padding: .3rem; gap: .3rem; }
.seg button { padding: .55em 1.1em; border-radius: 100px; font-size: var(--step--1); font-weight: 600; color: var(--ink-soft); }
.seg button.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

/* template choice */
.tpl-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .8rem; }
.tpl { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; cursor: pointer; background: var(--surface); text-align: left; transition: .25s var(--ease); position: relative; }
.tpl.active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.tpl img { width: 100%; aspect-ratio: 4/3; object-fit: cover; filter: grayscale(100%) contrast(1.04); }
.tpl .tpl__n { padding: .6rem .8rem; font-weight: 600; font-size: var(--step--1); }
.tpl.soon { opacity: .6; pointer-events: none; }
.tpl.soon::after { content: "σύντομα"; position: absolute; top: .5rem; right: .5rem; background: var(--ink); color: var(--paper); font-size: 10px; padding: .3em .6em; border-radius: 100px; }

/* color swatches */
.swatches { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.swatches button { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line); }
.swatches button.active { box-shadow: 0 0 0 2px var(--accent); }
.swatches input[type=color] { width: 40px; height: 34px; border: 1px solid var(--line); border-radius: 8px; background: none; padding: 2px; cursor: pointer; }

/* image dropzone */
.drop { border: 1.5px dashed var(--line); border-radius: var(--r); padding: 1.4rem; text-align: center; cursor: pointer; transition: .25s var(--ease); background: var(--surface); color: var(--ink-soft); }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-deep); }
.drop svg { width: 30px; height: 30px; margin: 0 auto .5rem; color: var(--accent); }
.thumb { position: relative; border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--line); }
.thumb img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4/3; }
.thumb button { position: absolute; top: 4px; right: 4px; background: rgba(20,18,15,.7); color: #fff; width: 24px; height: 24px; border-radius: 50%; font-size: 14px; line-height: 1; }
.thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-top: .7rem; }

/* programme editor */
.prow { display: grid; grid-template-columns: 90px 1fr auto; gap: .5rem; align-items: start; margin-bottom: .5rem; }
.prow .inp { padding: .55em .6em; font-size: var(--step--1); }
.prow .del { align-self: center; color: var(--ink-faint); width: 30px; height: 30px; border-radius: 8px; }
.prow .del:hover { background: var(--paper-2); color: var(--ink); }
.addrow { font-size: var(--step--1); color: var(--accent-deep); font-weight: 600; display: inline-flex; align-items: center; gap: .4em; margin-top: .3rem; }

/* plan step tiers */
.plan-tiers { display: grid; gap: .7rem; margin-top: 1rem; }
.plan-tier { border: 1px solid var(--line); border-radius: var(--r); padding: 1rem 1.1rem; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 1rem; transition: .2s var(--ease); background: var(--surface); }
.plan-tier.active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.plan-tier.locked { opacity: .55; cursor: not-allowed; }
.plan-tier__n { font-family: var(--display); font-size: var(--step-1); }
.plan-tier__t { font-size: var(--step--2); color: var(--ink-faint); }
.plan-tier__p { font-family: var(--display); font-size: var(--step-1); font-weight: 600; text-align: right; white-space: nowrap; }
.plan-tier__lock { font-size: var(--step--2); color: var(--gold); font-weight: 600; }
.pricebox { background: var(--night); color: var(--on-dark); border-radius: var(--r); padding: 1.2rem 1.4rem; margin-top: 1.2rem; }
.pricebox .pb-total { font-family: var(--display); font-size: clamp(2.4rem,7vw,3.4rem); font-weight: 600; line-height: 1; }
.pricebox .pb-total .cur { font-size: .5em; color: var(--on-dark-soft); }
.pricebox .pb-detail { color: var(--on-dark-soft); font-size: var(--step--1); line-height: 1.7; margin-top: .5rem; }

/* review summary */
.summary { display: grid; gap: .5rem; margin: 1rem 0 1.4rem; }
.summary .srow { display: flex; justify-content: space-between; gap: 1rem; padding: .6rem 0; border-bottom: 1px solid var(--line-soft); font-size: var(--step--1); }
.summary .srow span:first-child { color: var(--ink-faint); }
.summary .srow span:last-child { font-weight: 600; text-align: right; }
.check-row { display: flex; gap: .6rem; align-items: flex-start; margin: 1rem 0; font-size: var(--step--1); color: var(--ink-soft); }
.check-row input { margin-top: .25rem; width: 18px; height: 18px; accent-color: var(--accent); flex: none; }

/* ---- preview pane ---- */
.bpreview { background: var(--night); position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 1.4rem; min-height: 0; }
.bpreview__head { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; padding: .8rem 1.2rem; color: var(--on-dark-soft); font-size: var(--step--2); letter-spacing: .1em; text-transform: uppercase; z-index: 2; }
.bpreview__head .live { display: inline-flex; align-items: center; gap: .4em; }
.bpreview__head .live i { width: 7px; height: 7px; border-radius: 50%; background: #7ec27e; display: block; animation: lpulse 2s infinite; }
@keyframes lpulse { 0%,100%{opacity:1} 50%{opacity:.3} }
.device { position: relative; background: #000; border-radius: 26px; padding: 10px; box-shadow: var(--shadow-lg); transition: width .4s var(--ease), height .4s var(--ease); }
.device.phone { width: 340px; max-width: 92%; height: min(86%, 720px); }
.device.desktop { width: 96%; height: 88%; border-radius: 12px; padding: 8px; }
.device iframe { width: 100%; height: 100%; border: 0; border-radius: 18px; background: #F3EEE5; }
.device.desktop iframe { border-radius: 6px; }
.device-toggle { position: absolute; bottom: 1rem; left: 50%; transform: translateX(-50%); z-index: 2; }
.device-toggle .seg { background: rgba(0,0,0,.4); }
.device-toggle .seg button { color: var(--on-dark-soft); }
.device-toggle .seg button.active { background: rgba(244,239,230,.16); color: var(--on-dark); box-shadow: none; }

/* ---- publish modal ---- */
.modal { position: fixed; inset: 0; z-index: 300; display: none; align-items: center; justify-content: center; padding: 1.4rem; background: rgba(20,18,15,.55); backdrop-filter: blur(4px); overflow-y: auto; }
.modal.open { display: flex; }
.modal__card { background: var(--surface); border-radius: var(--r-lg); max-width: 520px; width: 100%; padding: clamp(1.6rem, 4vw, 2.6rem); text-align: center; box-shadow: var(--shadow-lg); margin: auto; }
.modal__seal { width: 64px; height: 64px; margin: 0 auto 1rem; border-radius: 50%; background: var(--accent-soft); display: grid; place-items: center; color: var(--accent-deep); }
.modal__seal svg { width: 32px; height: 32px; }
.modal__card h2 { font-size: var(--step-2); }
.modal__card p { color: var(--ink-soft); margin-top: .6rem; }
.modal__url { margin: 1.2rem 0; padding: .9rem 1rem; background: var(--paper-2); border-radius: var(--r-sm); font-weight: 600; display: flex; align-items: center; justify-content: space-between; gap: 1rem; word-break: break-all; }
.modal__url button { color: var(--accent-deep); font-weight: 600; font-size: var(--step--1); flex: none; }
.modal__actions { display: flex; gap: .7rem; justify-content: center; flex-wrap: wrap; margin-top: 1.2rem; }
.demo-tag { font-size: var(--step--2); color: var(--ink-faint); margin-top: 1rem; }

/* ---- responsive ---- */
@media (max-width: 900px) {
  .bhead { flex-wrap: wrap; row-gap: .3rem; }
  .bgrid { grid-template-columns: 1fr; }
  .bpreview { position: fixed; inset: 0; z-index: 50; transform: translateX(100%); visibility: hidden; transition: transform .4s var(--ease), visibility 0s linear .4s; }
  .bpreview.open { transform: translateX(0); visibility: visible; transition: transform .4s var(--ease), visibility 0s; }
  .preview-toggle { display: inline-flex; }
  .bpreview__close { position: absolute; top: .7rem; right: 1rem; z-index: 3; color: var(--on-dark); font-size: 1.6rem; background: rgba(0,0,0,.4); width: 40px; height: 40px; border-radius: 50%; }
  .device.desktop { width: 96%; }
}
.bpreview__close { display: none; }
@media (max-width: 900px) { .bpreview__close { display: grid; place-items: center; } }
/* small phones: drop the autosave note, tighten the preview toggle so the header fits 320px */
@media (max-width: 640px) {
  .bhead__mid { display: none; }
  .preview-toggle { padding: .7em 1em; }
}
