/* Crear evento + vista del invitado. El panel del DJ está en panel.css. */

body {
  margin: 0;
  background: #f4f0f5;
  padding: 24px;
}

#dpe-create {
  max-width: 1100px;
  margin: auto;
  font-family: system-ui, sans-serif;
  color: light-dark(#282431, #f6f2fa);
}
#dpe-create [hidden] { display: none !important; }

/* Encabezado */
#dpe-create .shell {
  position: relative;
  background: light-dark(#faf8fc, #211e27);
  padding: 24px;
  border-radius: 16px;
}
#dpe-create .brand { display: block; margin: 0 100px 18px 0; line-height: 0; }
#dpe-create .jump { display: inline-block; margin: 14px 0; color: #63437a; }
#dpe-create h2 { font-size: 24px; margin: 0 0 8px; }
#dpe-create .sub { font-size: 13px; color: light-dark(#696171, #c6bdcd); }

/* Selector de idioma (DJ arriba a la derecha, invitado sobre la portada) */
#dpe-create .lang-row { position: absolute; top: 18px; right: 24px; display: flex; align-items: center; gap: 8px; }
#dpe-create .lang-switch {
  display: inline-flex;
  border: 1px solid light-dark(#d8cfdf, #63576e);
  border-radius: 999px;
  overflow: hidden;
  background: light-dark(#fff, #302a38);
}
#dpe-create .lang-switch button {
  min-height: 32px;
  padding: 4px 12px;
  border-radius: 0;
  font-size: 13px;
  letter-spacing: 1px;
  background: transparent;
  color: inherit;
}
#dpe-create .lang-switch button[aria-pressed=true] {
  background: light-dark(#63437a, #dac2ec);
  color: light-dark(#fff, #211a29);
}
#dpe-create .guest-lang {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  background: rgba(255, 255, 255, .88);
  border-color: transparent;
  color: #241e2b;
}
#dpe-create .phone .guest-lang button { width: auto; margin: 0; background: transparent; color: #241e2b; }
#dpe-create .phone .guest-lang button[aria-pressed=true] { background: var(--photo-accent, #63437a); color: #fff; }

/* Formulario */
#dpe-create .layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 28px;
  margin-top: 24px;
}
#dpe-create label { display: block; margin-bottom: 18px; font-size: 14px; }
#dpe-create input,
#dpe-create select {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  margin-top: 7px;
  padding: 11px;
  border: 1px solid light-dark(#d8cfdf, #63576e);
  border-radius: 8px;
  background: light-dark(#fff, #302a38);
  color: inherit;
  font: inherit;
  font-size: 16px;
}
#dpe-create input[type=file] { font-size: 13px; }
#dpe-create input[type=checkbox] { width: 20px; margin: 0 8px 0 0; vertical-align: middle; }
#dpe-create textarea {
  box-sizing: border-box;
  width: 100%;
  min-height: 85px;
  font: inherit;
  padding: 10px;
  border: 1px solid #d8cfdf;
  border-radius: 8px;
}
fieldset { border: 1px solid #d8cfdf; border-radius: 10px; margin: 0 0 20px; padding: 15px; }
#dpe-create fieldset label { margin: 8px 0; }
#dpe-create button {
  font: inherit;
  border: 0;
  border-radius: 9px;
  padding: 12px 18px;
  min-height: 44px;
  color: light-dark(#fff, #211a29);
  background: light-dark(#63437a, #dac2ec);
}
#dpe-create button:disabled { opacity: .45; cursor: not-allowed; }
#dpe-create .error { color: light-dark(#a32c37, #ffb0b8); }
#dpe-create .status { font-size: 14px; }
#dpe-create .footer {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 12px;
  background: #e9f0e9;
  color: #25412e;
  border-radius: 8px;
}
#dpe-create .event-actions { margin: 14px 0; display: flex; gap: 8px; flex-wrap: wrap; }
#dpe-create .event-actions button { background: #ece4f1; color: #463451; }

/* Vista del invitado (teléfono). --photo-* salen de los colores de la portada (event.js). */
#dpe-create .phone {
  background: var(--photo-bg, #f5eef8);
  color: #241e2b;
  border: 1px solid light-dark(#d8cfdf, #63576e);
  border-radius: 24px;
  overflow: hidden;
  max-width: 340px;
  margin: auto;
}
#dpe-create .phone .sub { color: #514955; }
#dpe-create .cover {
  aspect-ratio: 4/3;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: light-dark(#ede1ef, #423046);
  padding: 20px;
  box-sizing: border-box;
}
#dpe-create[data-template=quince] .cover { background: #ead9f7; color: #583074; }
#dpe-create[data-template=gala] .cover { background: #252437; color: #f0d496; }
#dpe-create[data-template=privado] .cover { background: #d9eae5; color: #245d52; }
#dpe-create .cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
#dpe-create .ornament { font-family: Georgia, serif; font-size: 34px; line-height: 1.3; overflow-wrap: anywhere; }
#dpe-create .content { padding: 22px; text-align: center; }
#dpe-create .phone .content { background: linear-gradient(var(--photo-soft, #eee3f1), var(--photo-bg, #f5eef8)); }
#dpe-create .name { font-family: Georgia, serif; font-size: 26px; line-height: 1.2; overflow-wrap: anywhere; margin: 12px 0; }
.notice { padding: 12px; background: #eee8f2; border-radius: 8px; font-size: 13px; color: #42384c; }
#dpe-create .phone .notice { background: var(--photo-soft, #e9dfee); color: #241e2b; }
#dpe-create .guest { text-align: left; }
#dpe-create .guest button { width: 100%; margin: 6px 0; }
#dpe-create .guest label { margin: 14px 0; }
#dpe-create .guest form { border-top: 1px solid #d8cfdf; margin-top: 12px; }
#dpe-create .guest img { max-width: 100%; max-height: 160px; }
#dpe-create .phone button { background: var(--photo-accent, #63437a); color: white; }
#dpe-create .phone input,
#dpe-create .phone textarea { background: #fff; color: #241e2b; }

/* Ingreso del DJ y barra de eventos (con Supabase) */
body.needs-login #dpe-create,
body.needs-login #dj-panel { display: none; }
.login {
  max-width: 380px;
  margin: 48px auto;
  padding: 28px;
  background: light-dark(#faf8fc, #211e27);
  color: light-dark(#282431, #f6f2fa);
  border-radius: 16px;
  font-family: system-ui, sans-serif;
}
.login-brand { display: block; margin: 0 0 18px; line-height: 0; }
.login h2 { font-size: 24px; margin: 0 0 20px; }
.login label { display: block; margin-bottom: 16px; font-size: 14px; }
.login input {
  box-sizing: border-box;
  width: 100%;
  margin-top: 7px;
  padding: 11px;
  border: 1px solid light-dark(#d8cfdf, #63576e);
  border-radius: 8px;
  background: light-dark(#fff, #302a38);
  color: inherit;
  font: inherit;
  font-size: 16px;
}
.login button {
  width: 100%;
  font: inherit;
  border: 0;
  border-radius: 9px;
  padding: 12px 18px;
  min-height: 44px;
  color: light-dark(#fff, #211a29);
  background: light-dark(#63437a, #dac2ec);
}
.login button:disabled { opacity: .45; }
.login-error { color: light-dark(#a32c37, #ffb0b8); min-height: 20px; }
.login-note { font-size: 13px; color: light-dark(#696171, #c6bdcd); }
#dpe-create .event-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px 12px;
  margin: 18px 0 0;
  padding: 12px;
  background: light-dark(#f1ebf5, #2a2431);
  border-radius: 10px;
}
#dpe-create .event-bar label { margin: 0; flex: 1 1 260px; }
#dpe-create .event-bar button { background: #ece4f1; color: #463451; }

/* Tu marca de DJ */
#dpe-create .brand-box { margin: 12px 0 0; padding: 12px 14px; border-radius: 10px; background: light-dark(#f1ebf5, #2a2431); }
#dpe-create .brand-box summary { cursor: pointer; font-weight: 600; }
#dpe-create .brand-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; margin-top: 12px; }
#dpe-create .brand-preview { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 12px; max-width: 520px; }
#dpe-create .brand-preview img { width: 100%; height: 110px; object-fit: contain; padding: 12px; border-radius: 10px; box-sizing: border-box; }
#dpe-create .brand-preview img:first-child { background: #faf7f0; border: 1px solid #e6ddd3; }
#dpe-create .brand-preview img:last-child { background: #19151f; }
#dpe-create .brand-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* Registro de prueba */
#dpe-create .log { font-size: 14px; padding: 12px; border-top: 1px solid #ddd; overflow-wrap: anywhere; }

@media (max-width: 580px) {
  body { padding: 8px; }
  #dpe-create .layout { grid-template-columns: 1fr; }
  #dpe-create .shell { padding: 16px; }
  #dpe-create .lang-row { position: static; margin: 0 0 12px; }
  #dpe-create .brand-fields { grid-template-columns: 1fr; }
}

/* Cuenta del DJ (C1/C2): enlaces del ingreso, registro y avisos. */
.login-links { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 14px; margin: 4px 0 14px; }
.login-links a { color: light-dark(#63437a, #dac2ec); }
.login-ok { background: light-dark(#eef7f0, #1f3326); color: light-dark(#1f5130, #c3ecd0); border-radius: 10px; padding: 12px 14px; font-size: 14px; }
.login-ok p { margin: 0 0 8px; }
.login-ok p:last-child { margin: 0; }
.login .login-check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; }
.login .login-check input { width: auto; margin: 2px 0 0; }
.account-badge { font-size: 12px; padding: 3px 10px; border-radius: 999px; background: light-dark(#efe7f5, #3a3043); color: light-dark(#4b3260, #e6d4f3); }
.account-badge.warn { background: light-dark(#fdf0e1, #4a3420); color: light-dark(#7a4a12, #f6d3a6); }
.login [hidden] { display: none !important; }
