/* ============================================================================
   ZIVOGIFT · DIGITAL GIFT STUDIO  — studio.css
   ============================================================================ */

/* ── LAYOUT ── */
#studio-wrap {
  display: grid;
  grid-template-columns: 1fr 420px;
  min-height: 100vh;
  padding-top: 68px;
}

#studio-builder {
  padding: 40px 44px 100px;
  overflow-y: auto;
  max-height: calc(100vh - 68px);
  position: sticky;
  top: 68px;
  overflow-y: auto;
}

#studio-preview {
  background: #0e0c14;
  border-left: 1px solid rgba(168,85,247,.15);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  position: sticky;
  top: 68px;
  height: calc(100vh - 68px);
}

/* ── STEP SYSTEM ── */
.studio-step { display: none; animation: stepIn .35s ease; }
.studio-step.active { display: block; }
@keyframes stepIn {
  from { opacity:0; transform:translateY(16px); }
  to   { opacity:1; transform:translateY(0); }
}

.step-eyebrow {
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--purple-pop, #A855F7);
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 8px;
}
.step-heading {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(30px, 4vw, 46px);
  letter-spacing: .5px;
  color: var(--white);
  margin-bottom: 28px;
  line-height: 1.05;
}
.sub-heading {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 18px;
  letter-spacing: .5px;
  color: var(--white);
  margin-bottom: 14px;
}
.back-btn {
  background: none;
  border: none;
  color: var(--grey);
  font-size: 13px;
  cursor: pointer;
  padding: 0;
  margin-bottom: 20px;
  transition: color .2s;
}
.back-btn:hover { color: var(--white); }

/* ── PROGRESS BAR ── */
#studio-progress {
  position: fixed;
  top: 68px;
  left: 0;
  right: 420px;
  height: 3px;
  background: rgba(255,255,255,.06);
  display: flex;
  align-items: center;
  padding: 0 44px;
  gap: 0;
  z-index: 100;
  pointer-events: none;
}
.sp-line {
  flex: 1;
  height: 2px;
  background: rgba(168,85,247,.2);
  transition: background .4s;
}
.sp-line.done { background: var(--purple-pop, #A855F7); }
.sp-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(168,85,247,.3);
  transition: background .4s, transform .4s;
  flex-shrink: 0;
}
.sp-dot.active {
  background: var(--purple-pop, #A855F7);
  transform: scale(1.4);
  box-shadow: 0 0 10px rgba(168,85,247,.5);
}
.sp-dot.done { background: var(--coral, #FF4D2E); transform: scale(1); }

/* ── TYPE GRID (step 0) ── */
.type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}
.type-card {
  background: rgba(255,255,255,.04);
  border: 1.5px solid rgba(255,255,255,.1);
  border-radius: 16px;
  padding: 20px 18px;
  text-align: left;
  cursor: pointer;
  transition: all .25s;
  position: relative;
  overflow: hidden;
}
.type-card:hover {
  border-color: var(--purple-pop, #A855F7);
  background: rgba(168,85,247,.08);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(168,85,247,.15);
}
.type-card.selected {
  border-color: var(--coral, #FF4D2E);
  background: rgba(255,77,46,.08);
  box-shadow: 0 0 0 2px rgba(255,77,46,.3);
}
.type-icon { font-size: 32px; margin-bottom: 10px; display: block; }
.type-name { font-weight: 700; font-size: 15px; color: var(--white); margin-bottom: 4px; }
.type-desc { font-size: 12px; color: var(--grey); line-height: 1.5; margin-bottom: 10px; }
.type-price { font-size: 13px; font-weight: 700; color: var(--gold-light, #F5C842); }
.type-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255,77,46,.15);
  border: 1px solid rgba(255,77,46,.3);
  color: #ff7b62;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 50px;
}

/* ── VIBE GRID (step 1) ── */
.vibe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}
.vibe-card {
  border: 2px solid transparent;
  border-radius: 14px;
  padding: 16px 14px;
  cursor: pointer;
  transition: all .2s;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.vibe-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,.3); }
.vibe-card.selected { border-color: #fff !important; box-shadow: 0 0 0 3px rgba(255,255,255,.2) !important; }
.vibe-icon { font-size: 28px; margin-bottom: 8px; }
.vibe-name { font-size: 12px; font-weight: 700; color: #fff; }
.vibe-sub  { font-size: 10px; color: rgba(255,255,255,.6); margin-top: 3px; }

/* ── MESSAGE STEP (step 2) ── */
.message-area-wrap {
  background: rgba(255,255,255,.04);
  border: 1.5px solid rgba(255,255,255,.1);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 20px;
  transition: border-color .2s;
}
.message-area-wrap:focus-within { border-color: var(--purple-pop, #A855F7); }
#msg-input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: var(--white);
  font-size: 15px;
  line-height: 1.6;
  font-family: 'DM Sans', sans-serif;
  resize: none;
}
.msg-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  border-top: 1px solid rgba(255,255,255,.06);
  padding-top: 10px;
}
#msg-char-count { font-size: 11px; color: var(--grey); }
.ai-polish-btn {
  background: linear-gradient(135deg, #A855F7, #EC4899);
  border: none;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 16px;
  border-radius: 50px;
  cursor: pointer;
  transition: opacity .2s, transform .2s;
}
.ai-polish-btn:hover { opacity: .85; transform: scale(1.04); }
.ai-polish-btn:disabled { opacity: .5; cursor: not-allowed; }
.ai-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--grey);
  padding: 10px 0 6px;
}
.ai-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(168,85,247,.3);
  border-top-color: #A855F7;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
.ai-suggestions { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.ai-suggestion-pill {
  background: rgba(168,85,247,.08);
  border: 1.5px solid rgba(168,85,247,.25);
  color: #d4aaff;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.5;
  cursor: pointer;
  transition: all .2s;
  text-align: left;
}
.ai-suggestion-pill:hover {
  border-color: #A855F7;
  background: rgba(168,85,247,.15);
  color: #fff;
}
.ai-suggestion-pill .pill-use {
  display: block;
  font-size: 10px;
  color: #A855F7;
  font-weight: 700;
  margin-top: 4px;
}

/* ── FIELDS ── */
.field-row {
  margin-bottom: 18px;
}
.field-row label {
  display: block;
  font-size: 13px;
  color: var(--grey);
  margin-bottom: 7px;
  font-weight: 500;
}
.req { color: var(--coral, #FF4D2E); }
.field-row input,
.field-row select {
  width: 100%;
  background: rgba(255,255,255,.05);
  border: 1.5px solid rgba(255,255,255,.12);
  border-radius: 10px;
  color: var(--white);
  font-size: 15px;
  padding: 12px 14px;
  font-family: 'DM Sans', sans-serif;
  transition: border-color .2s;
  box-sizing: border-box;
}
.field-row input:focus,
.field-row select:focus {
  outline: none;
  border-color: var(--purple-pop, #A855F7);
  background: rgba(168,85,247,.06);
}
.field-row input.valid { border-color: #39FF14; }
.field-row input.invalid { border-color: #FF4D2E; }
.field-err {
  display: block;
  font-size: 11px;
  color: var(--coral, #FF4D2E);
  margin-top: 5px;
  min-height: 16px;
  transition: opacity .2s;
}

/* phone wrap */
.phone-wrap {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,.05);
  border: 1.5px solid rgba(255,255,255,.12);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color .2s;
}
.phone-wrap:focus-within { border-color: var(--purple-pop, #A855F7); }
.phone-flag {
  padding: 12px 12px;
  font-size: 14px;
  color: var(--grey);
  border-right: 1px solid rgba(255,255,255,.1);
  white-space: nowrap;
  background: rgba(255,255,255,.03);
}
.phone-wrap input {
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  flex: 1;
}
.phone-wrap input:focus { border: none; background: transparent; }

/* ── SCHEDULE OPTIONS ── */
#schedule-options { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.schedule-opt {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: rgba(255,255,255,.04);
  border: 1.5px solid rgba(255,255,255,.1);
  border-radius: 14px;
  padding: 14px 16px;
  cursor: pointer;
  transition: all .2s;
}
.schedule-opt:hover { border-color: rgba(168,85,247,.5); background: rgba(168,85,247,.06); }
.schedule-opt.selected {
  border-color: var(--purple-pop, #A855F7);
  background: rgba(168,85,247,.1);
  box-shadow: 0 0 0 1px rgba(168,85,247,.2);
}
.schedule-opt input[type="radio"] { display: none; }
.sched-icon { font-size: 26px; flex-shrink: 0; margin-top: 2px; }
.sched-label { font-weight: 700; font-size: 14px; color: var(--white); margin-bottom: 3px; }
.sched-sub   { font-size: 12px; color: var(--grey); }

/* anonymous toggle */
.anon-row { margin: 14px 0 20px; }
.anon-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--grey);
  cursor: pointer;
}
.anon-label input { width: auto; accent-color: #A855F7; }

/* ── BUTTONS ── */
.studio-next-btn, .studio-add-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--coral, #FF4D2E), #ff7b62);
  border: none;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  padding: 16px;
  border-radius: 50px;
  cursor: pointer;
  margin-top: 24px;
  transition: opacity .2s, transform .2s, box-shadow .3s;
  box-shadow: 0 4px 20px rgba(255,77,46,.3);
  letter-spacing: .3px;
}
.studio-next-btn:hover, .studio-add-btn:hover {
  opacity: .92;
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(255,77,46,.4);
}
.studio-add-btn { background: linear-gradient(135deg, #A855F7, #EC4899); }
.secure-note {
  text-align: center;
  font-size: 12px;
  color: var(--grey);
  margin-top: 10px;
}

/* ── CONFIRM SUMMARY ── */
.confirm-summary {
  background: rgba(255,255,255,.04);
  border: 1.5px solid rgba(255,255,255,.1);
  border-radius: 16px;
  padding: 20px;
}
.cs-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,.06);
  font-size: 13px;
}
.cs-row:last-child { border: none; }
.cs-label { color: var(--grey); }
.cs-value { color: var(--white); font-weight: 600; text-align: right; max-width: 60%; }

/* ── LIVE PREVIEW ── */
.preview-label {
  font-size: 10px;
  letter-spacing: 2px;
  color: rgba(168,85,247,.7);
  text-transform: uppercase;
  margin-bottom: 20px;
  font-weight: 700;
}
#preview-phone-frame {
  width: 300px;
  height: 520px;
  background: #1a1520;
  border-radius: 36px;
  border: 8px solid #2a2535;
  box-shadow:
    0 20px 60px rgba(0,0,0,.6),
    0 0 0 1px rgba(168,85,247,.15),
    inset 0 1px 0 rgba(255,255,255,.05);
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* phone notch */
#preview-phone-frame::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 70px;
  height: 5px;
  background: #2a2535;
  border-radius: 3px;
  z-index: 10;
}
#preview-card {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .5s;
}
#preview-bg-layer {
  position: absolute;
  inset: 0;
  transition: background .5s, opacity .5s;
}
#preview-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 28px 20px;
}
#preview-icon {
  font-size: 54px;
  margin-bottom: 12px;
  animation: previewBounce 2s ease-in-out infinite;
}
@keyframes previewBounce {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%       { transform: translateY(-8px) rotate(5deg); }
}
#preview-to {
  font-size: 11px;
  color: rgba(255,255,255,.5);
  margin-bottom: 8px;
  font-family: 'Space Mono', monospace;
}
#preview-to-name { font-weight: 700; color: rgba(255,255,255,.8); }
#preview-message-text {
  font-family: 'Caveat', cursive;
  font-size: 18px;
  color: #fff;
  line-height: 1.5;
  margin-bottom: 14px;
  min-height: 54px;
  transition: all .3s;
  text-shadow: 0 1px 8px rgba(0,0,0,.4);
}
#preview-from {
  font-size: 13px;
  color: rgba(255,255,255,.6);
  font-style: italic;
  margin-bottom: 14px;
}
#preview-from span { color: rgba(255,255,255,.85); font-weight: 600; font-style: normal; }
#preview-tag {
  display: inline-block;
  font-size: 10px;
  color: rgba(255,255,255,.4);
  border: 1px solid rgba(255,255,255,.15);
  padding: 3px 10px;
  border-radius: 50px;
}
#preview-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}
.preview-hint {
  margin-top: 16px;
  font-size: 11px;
  color: rgba(168,85,247,.5);
  text-align: center;
}

/* ── VIBE THEMES  — applied to preview card ── */
.vibe-warm    { background: linear-gradient(135deg, #2d1a0e, #4a2510) !important; }
.vibe-cosmic  { background: linear-gradient(135deg, #0d0a1f, #1a0d2e) !important; }
.vibe-neon    { background: linear-gradient(135deg, #001a0d, #002810) !important; }
.vibe-golden  { background: linear-gradient(135deg, #1a1500, #2d2200) !important; }
.vibe-minimal { background: linear-gradient(135deg, #0f0f0f, #1a1a1a) !important; }
.vibe-roast   { background: linear-gradient(135deg, #1a0000, #2d0000) !important; }
.vibe-retro   { background: linear-gradient(135deg, #0d1a00, #1a2d00) !important; }
.vibe-pastel  { background: linear-gradient(135deg, #1a0d1a, #2d1a2d) !important; }

/* ── MOBILE ── */
/* BUGFIX: this used to be TWO separate @media (max-width: 860px) blocks for
   #studio-preview — one setting display:none, a second (added later) setting
   display:flex right after it. CSS cascade always resolves to the LAST rule
   for equal specificity, so the display:none never actually applied; the
   preview panel (a phone-mockup, with an animated confetti/particle layer)
   was rendering on every mobile screen, nested inside an already-phone-sized
   viewport. That's the flicker + stray dots reported on mobile — the
   particle animation kicking in on load for a panel that was supposed to be
   hidden. Consolidated into one block, correctly hidden on mobile: a
   phone-frame preview of a phone doesn't add anything when you're already
   looking at your phone, and hiding it removes the wasted vertical space
   and the animation-driven layout shift. */
@media (max-width: 860px) {
  #studio-wrap {
    grid-template-columns: 1fr;
    max-width: 100vw;
  }
  #studio-preview {
    display: none;
  }
  #studio-builder {
    max-height: none;
    position: static;
    padding: 28px 20px 80px;
  }
  #studio-progress {
    right: 0;
    padding: 0 20px;
  }
}
