/* ==========================================================
   CUSTOMIZE PAGE — form + live preview
   ========================================================== */

.customize-body{
  min-height: 100vh;
  background: radial-gradient(ellipse at 50% 0%, var(--bg-2), var(--bg) 60%);
  padding-bottom: 4rem;
}

.cz-header{
  max-width: 900px;
  margin: 0 auto;
  padding: 28px 20px 8px;
  text-align: center;
}

.cz-back{
  display: inline-block;
  color: var(--muted);
  font-size: .9rem;
  text-decoration: none;
  margin-bottom: 1.4rem;
  transition: color .3s var(--ease);
}
.cz-back:hover{ color: var(--gold); }

.cz-title{
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  margin: 0 0 .4rem;
}

.cz-subtitle{
  color: var(--muted);
  font-size: .98rem;
  max-width: 480px;
  margin: 0 auto;
}

.cz-layout{
  max-width: 1100px;
  margin: 2rem auto 0;
  padding: 0 20px;
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 2rem;
  align-items: start;
}

@media (max-width: 860px){
  .cz-layout{ grid-template-columns: 1fr; }
}

/* -------------------- Form -------------------- */

.cz-form{
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 24px;
  padding: clamp(1.4rem, 3vw, 2.2rem);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.cz-block{
  margin-bottom: 2rem;
}
.cz-block:last-of-type{ margin-bottom: 1.5rem; }

.cz-block-title{
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  margin: 0 0 1rem;
  color: var(--text);
}

.cz-hint{
  font-family: var(--font-ui);
  font-weight: 300;
  font-size: .8rem;
  color: var(--muted);
}

.cz-label{
  display: block;
  font-size: .85rem;
  color: var(--muted);
  margin: 1rem 0 .4rem;
}
.cz-label:first-of-type{ margin-top: 0; }

.cz-input{
  width: 100%;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  padding: .8em 1em;
  color: var(--text);
  font-family: var(--font-ui);
  font-size: .95rem;
  transition: border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.cz-input::placeholder{ color: rgba(216,174,150,.55); }
.cz-input:focus{
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(232,184,75,.15);
}

.cz-textarea{ resize: vertical; min-height: 100px; font-family: var(--font-ui); }

.cz-upload{
  display: inline-flex;
  align-items: center;
  gap: .5em;
  padding: .8em 1.4em;
  border: 1px dashed rgba(232,184,75,.4);
  border-radius: 100px;
  color: var(--gold);
  font-size: .9rem;
  cursor: pointer;
  transition: background .3s var(--ease), border-color .3s var(--ease);
}
.cz-upload:hover{ background: rgba(232,184,75,.08); border-color: var(--gold); }

.cz-photo-grid{
  display: flex;
  flex-wrap: wrap;
  gap: .7rem;
  margin-top: 1rem;
}

.cz-photo-thumb{
  position: relative;
  width: 84px;
  height: 84px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.12);
}
.cz-photo-thumb img{ width: 100%; height: 100%; object-fit: cover; }

.cz-photo-remove{
  position: absolute;
  top: 3px;
  right: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: none;
  background: rgba(7,7,11,.75);
  color: #fff;
  font-size: .7rem;
  line-height: 1;
  cursor: pointer;
}

.cz-actions{
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: .5rem;
}

.cz-note{
  font-size: .78rem;
  color: var(--muted);
  margin-top: 1rem;
  line-height: 1.6;
}

.cz-link-result{
  margin-top: 1.5rem;
  padding: 1.25rem 1.4rem;
  text-align: left;
}

.cz-link-row{
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
  margin-top: .6rem;
}

.cz-link-row .cz-input{
  flex: 1 1 220px;
  min-width: 0;
}

.cz-link-preview{
  display: inline-block;
  margin-top: .8rem;
  font-size: .85rem;
  color: var(--gold, #d98a5f);
  text-decoration: none;
}

.cz-link-preview:hover{ text-decoration: underline; }

/* -------------------- Live preview -------------------- */

.cz-preview{ position: sticky; top: 24px; }

.cz-preview-label{
  font-size: .8rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 .8rem;
}

.cz-preview-card{ text-align: left; }

.cz-preview-madefor{ font-size: .8rem; color: var(--muted); margin: 0 0 .3rem; }

.cz-preview-name{
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  margin: 0 0 1.2rem;
}

.cz-preview-caption{
  font-size: .75rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 1.1rem 0 .4rem;
}

.cz-preview-msg{
  font-size: .9rem;
  color: var(--text);
  line-height: 1.7;
  white-space: pre-line;
  margin: 0;
}

.cz-preview-photos{
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.cz-preview-photos img{
  width: 56px; height: 56px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.1);
}
.cz-preview-photos-empty{ font-size: .82rem; color: var(--muted); }

.cz-preview-song{ font-size: .85rem; color: var(--muted); margin: 0; }

.cz-preview-yt{ margin-top: .6rem; }
.cz-preview-yt img{
  width: 100%;
  max-width: 220px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.1);
}

.cz-preview-sign{
  font-family: var(--font-display);
  font-style: italic;
  color: var(--muted);
  text-align: right;
  margin-top: 1.6rem;
}

.cz-toast{
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(20,20,28,.95);
  border: 1px solid rgba(232,184,75,.4);
  color: var(--text);
  padding: .9em 1.6em;
  border-radius: 100px;
  font-size: .9rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s var(--ease), transform .35s var(--ease);
  z-index: 10000;
}
.cz-toast.show{
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ==========================================================
   SETUP POPUP (index.html) — first-visit modal where the
   brother fills details and gets a shareable link, without
   needing to visit a separate customize.html page.
   ========================================================== */

.setup-modal-overlay{
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(10,3,3,.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  overflow-y: auto;
}

.setup-modal-overlay[hidden]{ display: none; }

.setup-modal{
  width: 100%;
  max-width: 480px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 1.8rem 1.6rem;
  text-align: left;
  margin: auto;
}

.setup-modal-title{
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin: 0 0 .4rem;
}

.setup-modal-subtitle{
  font-size: .85rem;
  color: var(--muted);
  margin: 0 0 1.2rem;
  line-height: 1.5;
}

.setup-modal .cz-label{ margin-top: .9rem; }

.setup-modal-actions{
  display: flex;
  gap: .8rem;
  flex-wrap: wrap;
  margin-top: 1.4rem;
}

.setup-modal .cz-note{ margin-top: .8rem; }

.setup-modal .cz-link-result{
  margin-top: 0;
  padding: 0;
  background: none;
  border: none;
  box-shadow: none;
}

.cz-video-preview{
  margin-top: 1rem;
  display: flex;
  align-items: center;
  gap: .8rem;
  flex-wrap: wrap;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  padding: .7rem 1rem;
}
.cz-video-preview video{
  width: 100%;
  max-width: 260px;
  max-height: 160px;
  border-radius: 8px;
  background: #000;
}

/* -------------------- Small phones (≤400px) -------------------- */
@media (max-width: 400px){
  .setup-modal-overlay{ padding: 10px; }
  .setup-modal{
    padding: 1.4rem 1.1rem;
    max-height: calc(100vh - 20px);
    border-radius: 18px;
  }
  .setup-modal-title{ font-size: 1.3rem; }
  .setup-modal-actions{ flex-direction: column; }
  .setup-modal-actions .btn{ width: 100%; justify-content: center; }
  .cz-photo-thumb{ width: 72px; height: 72px; }
  .cz-link-row{ flex-direction: column; }
  .cz-link-row .btn{ width: 100%; justify-content: center; }
}
