:root {
  --violet: #5a189a;
  --violet2: #7b2cbf;
  --bg: #f6f3ff;
  --card: #ffffff;
  --border-soft: #e4ddff;
  --text-main: #1f1635;
  --text-muted: #7b7399;
  --danger: #ff4b5c;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: 'Poppins', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: radial-gradient(circle at top, #7b2cbf 0, #2a1266 40%, #140626 100%);
  color: var(--text-main);
}

body.no-scroll {
  overflow: hidden;
}

/* ------- TOPBAR ------- */

.vta-topbar {
  height: 64px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(90deg, #5a189a, #7b2cbf);
  color: #fff;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  position: relative;
  z-index: 10;
}

.vta-topbar .brand {
  font-weight: 700;
  letter-spacing: 0.03em;
  font-size: 18px;
}

.vta-topbar .actions {
  display: flex;
  gap: 12px;
}

.chip {
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 13px;
  border: 1px solid rgba(255,255,255,0.35);
  background: rgba(255,255,255,0.12);
  color: #fff;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  backdrop-filter: blur(10px);
  transition: all .18s ease-out;
}

.chip:hover {
  background: rgba(255,255,255,0.20);
  transform: translateY(-1px);
}

.chip.danger {
  border-color: rgba(255,75,92,0.7);
  background: rgba(255,75,92,0.18);
}

/* ------- EDITOR LAYOUT ------- */

.editor-stage {
  height: calc(100vh - 64px);
  padding: 16px 16px 24px;
  display: flex;
  align-items: stretch;
  justify-content: center;
}

.canvas-host {
  flex: 1;
  background: var(--card);
  border-radius: 18px;
  box-shadow: 0 20px 48px rgba(0,0,0,0.30);
  position: relative;
  overflow: visible;   /* ✅ CORRECTO */
  display: flex;
  align-items: center;
  justify-content: center;
}


/* Importante: NO tocar transform del canvas de Fabric, solo tama単o */
.canvas-host canvas {
  display: block;
  max-width: 100%;
  max-height: 100%;
  background: #ffffff;
}

/* ------- FLOATING TOOLBAR ------- */

.floating-toolbar {
  position: fixed;
  left: 50%;
  top: 84px;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.95);
  box-shadow: 0 12px 30px rgba(15,5,40,0.35);
  z-index: 20;
}

.floating-toolbar.glass {
  backdrop-filter: blur(10px);
}

.btn {
  border-radius: 999px;
  padding: 6px 14px;
  border: 1px solid var(--border-soft);
  background: #fff;
  font-size: 13px;
  color: var(--text-main);
  cursor: pointer;
  min-width: 64px;
  transition: all .16s ease-out;
}

.btn:hover {
  background: #f5f0ff;
  transform: translateY(-1px);
}

.btn.solid {
  background: var(--violet);
  color: #fff;
  border-color: transparent;
}

.btn.solid:hover {
  background: var(--violet2);
}

.btn.ghost {
  background: transparent;
  border-color: var(--border-soft);
}

.sep {
  width: 1px;
  height: 24px;
  background: #e0d7ff;
}

/* ------- DOCK PANELS ------- */

.dock {
  position: fixed;
  background: var(--card);
  border-radius: 18px;
  box-shadow: 0 14px 36px rgba(10,4,30,0.45);
  overflow: hidden;
  font-size: 13px;
  color: var(--text-main);
  z-index: 15;
}

.dock-head {
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(90deg,#5a189a,#7b2cbf);
  color: #fff;
  cursor: move;
  font-weight: 600;
}

.dock-actions {
  display: flex;
  gap: 4px;
}

.dock-actions .mini {
  border-radius: 999px;
  border: none;
  background: rgba(255,255,255,0.18);
  color: #fff;
  width: 18px;
  height: 18px;
  font-size: 11px;
  cursor: pointer;
}

.dock-body {
  padding: 10px;
  max-height: 420px;
  overflow: auto;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 8px;
}

.pill {
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  padding: 8px 10px;
  font-size: 12px;
  background: #faf7ff;
  text-align: center;
  cursor: pointer;
  transition: all .16s ease-out;
  white-space: nowrap;
}

.pill:hover {
  background: #f0e7ff;
}

.pill.purple {
  background: var(--violet);
  border-color: transparent;
  color: #fff;
}

/* Layers */

#panel-layers .dock-body {
  max-height: 220px;
}

#layerList .pill {
  text-align: left;
}

/* ------- PROPERTY GROUPS ------- */

.group {
  border-radius: 14px;
  border: 1px solid var(--border-soft);
  padding: 10px;
  margin-bottom: 10px;
  background: #faf7ff;
}

.group-title {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--violet);
}

.row {
  display: flex;
  gap: 10px;
  margin-bottom: 8px;
  align-items: center;
}

.row.two > * {
  flex: 1;
}

.row.three > * {
  flex: 1;
}

label {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

input[type="number"],
select {
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  padding: 4px 10px;
  font-size: 12px;
  font-family: inherit;
}

input[type="color"] {
  width: 32px;
  height: 24px;
  padding: 0;
  border-radius: 6px;
  border: 1px solid var(--border-soft);
}

input[type="range"] {
  width: 100%;
}

/* ------- CTX MENU ------- */

.ctx {
  position: fixed;
  list-style: none;
  margin: 0;
  padding: 6px 0;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(0,0,0,0.38);
  font-size: 13px;
  z-index: 25;
}

.ctx.hidden {
  display: none;
}

.ctx li {
  padding: 6px 14px;
  cursor: pointer;
  white-space: nowrap;
}

.ctx li:hover {
  background: #f5f0ff;
}

.ctx li.sep {
  border-top: 1px solid #eee5ff;
  margin: 4px 0;
  padding: 0;
}

.ctx li.danger {
  color: var(--danger);
}

/* ------- LOGIN (ya lo estabas usando) ------- */

.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top, #7b2cbf 0, #2a1266 45%, #0a0216 100%);
  color: #fff;
}

.login-shell {
  width: 100%;
  max-width: 720px;
  padding: 24px;
}

.login-card {
  background: rgba(15,5,40,0.96);
  border-radius: 24px;
  box-shadow: 0 20px 48px rgba(0,0,0,0.7);
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  overflow: hidden;
}

.login-hero {
  padding: 32px;
  background: radial-gradient(circle at top left,#b794f6 0,#5a189a 40%,#1c0733 100%);
  color: #fff;
}

.login-hero h1 {
  margin: 0 0 8px;
}

.login-hero p {
  margin: 0;
  font-size: 13px;
  opacity: 0.9;
}

.login-form {
  padding: 32px 28px;
  background: rgba(8,2,22,0.92);
}

.login-form h2 {
  margin-top: 0;
  margin-bottom: 18px;
}

.login-form label {
  font-size: 12px;
  color: #ddd3ff;
}

.login-form input[type="email"],
.login-form input[type="password"] {
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(2,0,8,0.85);
  color: #fff;
  padding: 8px 12px;
  font-size: 13px;
}

.login-form button[type="submit"] {
  width: 100%;
  margin-top: 14px;
  border-radius: 999px;
  border: none;
  padding: 9px 12px;
  background: #ffb703;
  color: #220a35;
  font-weight: 600;
  cursor: pointer;
}

.login-error {
  background: rgba(255,75,92,0.15);
  color: #ffb3bc;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 12px;
  margin-bottom: 10px;
}

.login-hint {
  margin-top: 12px;
  font-size: 11px;
  color: #aaa1ff;
}

.login-form .forgot {
  margin-top: 10px;
  font-size: 12px;
}

.login-form .forgot a {
  color: #c3b8ff;
  text-decoration: none;
}
.login-form .forgot a:hover {
  text-decoration: underline;
}

/* Responsivo */

@media (max-width: 900px) {
  .login-card {
    grid-template-columns: 1fr;
  }
  .login-hero {
    text-align: center;
  }
}
/* FIX: no tapar el canvas principal */
.upper-canvas {
    pointer-events: none !important;  /* deja pasar clics al sistema */
    background: transparent !important; /* evita cubrir el texto */
}

.lower-canvas {
    z-index: 1 !important;
}

.canvas-container {
    z-index: 2 !important;
}
/* ======================================================
   FIX DEFINITIVO PARA CANVAS, CAPAS Y EVENTOS
   ====================================================== */

/* Forzar que el canvas nunca sobresalga */
.canvas-host {
    position: relative !important;
    overflow: hidden !important;
}

/* El contenedor interno de Fabric */
.canvas-container {
    position: relative !important;
    margin: 0 auto !important;
    overflow: visible !important;
    z-index: 1 !important;
}

/* lower-canvas = dibujo */
.lower-canvas {
    position: absolute !important;
    left: 0; top: 0;
    z-index: 2 !important;
}

/* upper-canvas = selección y eventos */
.upper-canvas {
    position: absolute !important;
    left: 0; top: 0;
    z-index: 3 !important;
    background: transparent !important;
    pointer-events: auto !important;
}

/* Overlay interno de Fabric (evita desbordes) */
.fabric-overlay-container,
.fabric-canvas-container,
canvas {
    max-width: 100% !important;
    max-height: 100% !important;
}

/* Desactivar interacción FUERA del canvas */
body *:not(.canvas-container):not(.upper-canvas):not(.lower-canvas) {
    pointer-events: auto !important;
}

/* Asegura que los paneles estén por encima del canvas */
.dock,
.floating-toolbar,
#panel-templates,
#panel-props,
#panel-layers {
    z-index: 5000 !important;
}
/* ----- CANVAS LEVELS FIX ----- */
.canvas-container,
.lower-canvas,
.upper-canvas {
  position: absolute !important;
  z-index: 5 !important;  /* canvas debajo de panels */
  pointer-events: auto !important;
}

/* Panels ABOVE canvas */
.dock {
  z-index: 20 !important;
}

.floating-toolbar {
  z-index: 25 !important;
}

#panel-templates,
#panel-props,
#panel-layers {
  z-index: 22 !important;
}
/* === FIX DEFINITIVO: Canvas nunca debe tapar los paneles === */
#canvasHost.canvas-host {
    pointer-events: none !important;
}

#canvasHost canvas {
    pointer-events: auto !important;
}

/* Dock panels pueden recibir clic normal */
.dock, .dock * {
    pointer-events: auto !important;
}
/* ===========================
   ARREGLO DEFINITIVO: FABRIC
   =========================== */

/* Forzar a upper-canvas y lower-canvas a ajustarse al canvas real */
canvas.upper-canvas,
canvas.lower-canvas {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    pointer-events: auto !important;
}

/* El contenedor solo sirve como marco */
#canvasHost {
    position: relative !important;
    overflow: hidden !important;
    pointer-events: none !important;
}

/* Solo los canvas reciben clics */
#canvasHost canvas {
    pointer-events: auto !important;
    z-index: 10 !important;
}

/* Los paneles siempre arriba */
.dock {
    z-index: 999999 !important;
    pointer-events: auto !important;
}

/* ======================================
   VTA TOAST NOTIFICATIONS (Glass)
====================================== */

#vta-toast {
  position: fixed;
  right: 30px;
  bottom: 30px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.vta-toast-msg {
  padding: 14px 22px;
  border-radius: 16px;
  font-size: 14px;
  color: #ffffff;
  background: rgba(90, 24, 154, 0.88); /* Purple glass */
  backdrop-filter: blur(12px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.45);
  border: 1px solid rgba(255,255,255,0.18);
  animation: vtaFadeIn .35s ease-out;
  opacity: 0;
}

.vta-toast-msg.show {
  opacity: 1;
  transition: opacity .35s ease-in;
}

@keyframes vtaFadeIn {
  from { transform: translateY(10px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
/* ======================================
   VTA TOAST NOTIFICATIONS (Glass UI)
====================================== */

#vta-toast {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.vta-toast-msg {
  padding: 14px 22px;
  border-radius: 18px;
  font-size: 14px;
  color: #fff;
  background: rgba(90, 24, 154, 0.90);
  border: 1px solid rgba(255,255,255,0.15);
  backdrop-filter: blur(10px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.4);
  transform: translateY(10px);
  opacity: 0;
  transition: all .35s ease;
}

.vta-toast-msg.show {
  opacity: 1;
  transform: translateY(0);
}
/* VTA Professional Modal */
.vta-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(6px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.vta-modal.hidden {
  display: none !important;
}

.vta-modal-content {
  background: #1d0b35;
  border-radius: 18px;
  padding: 24px;
  color: white;
  width: 380px;
  box-shadow: 0 18px 48px rgba(0,0,0,0.45);
  border: 1px solid rgba(255,255,255,0.1);
}

.vta-modal-content h3 {
  margin-top: 0;
  margin-bottom: 12px;
  color: #fff;
}

.vta-modal-content input {
  width: 100%;
  padding: 10px 14px;
  font-size: 15px;
  border-radius: 12px;
  border: 1px

/* ============================================
   VTA DESIGN STUDIO – PROFESSIONAL MODAL
   ============================================ */

.vta-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(6px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.vta-modal.hidden {
  display: none !important;
}

.vta-modal-content {
  background: #1d0b35; /* Morado oscuro premium */
  border-radius: 18px;
  padding: 26px;
  color: white;
  width: 380px;
  max-width: 90%;
  box-shadow: 0 18px 48px rgba(0,0,0,0.45);
  border: 1px solid rgba(255,255,255,0.1);
  animation: modalPop .25s ease-out;
}

@keyframes modalPop {
  from { transform: scale(.85); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.vta-modal-content h3 {
  margin-top: 0;
  margin-bottom: 18px;
  font-size: 20px;
  font-weight: 600;
  color: #fff;
}

.vta-modal-content input {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.08);
  color: #fff;
  outline: none;
}

.vta-modal-content input:focus {
  border-color: #b58bff;
  background: rgba(255,255,255,0.15);
}

.vta-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 22px;
}

.vta-modal-actions .btn {
  padding: 8px 22px;
  font-size: 14px;
  border-radius: 999px;
  cursor: pointer;
  border: none;
}

.vta-modal-actions .btn.solid {
  background: #7b2cbf;
  color: #fff;
}

.vta-modal-actions .btn.solid:hover {
  background: #9c4dff;
}

.vta-modal-actions .btn.ghost {
  background: rgba(255,255,255,0.15);
  color: #fff;
}

.vta-modal-actions .btn.ghost:hover {
  background: rgba(255,255,255,0.22);
}
/* =====================================================
   VTA MODAL (Universal Beautiful Modal)
   ===================================================== */

.vta-modal {
  position: fixed;
  inset: 0;
  background: rgba(20, 8, 40, 0.55);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 4000;
}

.vta-modal.hidden {
  display: none;
}

.vta-modal-content {
  background: #1a0f33;
  padding: 26px 28px;
  width: 380px;
  border-radius: 22px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
  color: #fff;
  animation: fadeIn .25s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(.85); }
  to { opacity: 1; transform: scale(1); }
}

.vta-modal-content h3 {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 600;
}

.vta-modal-actions {
  margin-top: 20px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

#vtaModalInput {
  width: 100%;
  border-radius: 10px;
  padding: 8px 10px;
  border: 1px solid #b393ff;
  background: rgba(255,255,255,0.1);
  color: #fff;
  margin-top: 10px;
}


@keyframes floatLogo {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}


/* Animación suave flotante */
@keyframes floaty {
    0%   { transform: translateY(0px); }
    50%  { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}
/* ==== HERO LOGIN LOGO SIZE FIX ==== */
.hero-3d-logo {
    width: 220px !important;
    height: auto !important;
    display: block;
    margin: 40px auto 0;
    border-radius: 22px;
    filter: drop-shadow(0 12px 45px rgba(0,0,0,0.45));
    animation: floaty 4s ease-in-out infinite;
}

@keyframes floaty {
    0%   { transform: translateY(0px); }
    50%  { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

