/* ── Copo Label Preview 3D — Styles ─────────────────────────── */
:root {
  --clp-primary:   #2563eb;
  --clp-primary-h: #1d4ed8;
  --clp-surface:   #ffffff;
  --clp-border:    #e2e8f0;
  --clp-text:      #1e293b;
  --clp-muted:     #64748b;
  --clp-radius:    12px;
  --clp-shadow:    0 4px 24px rgba(0,0,0,.10);
}

/* Wrapper */
.clp-wrapper {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--clp-text);
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1rem;
  box-sizing: border-box;
}

.clp-title {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 700;
  text-align: center;
  margin: 0 0 2rem;
  color: var(--clp-text);
}

/* Layout */
.clp-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1.5rem;
  align-items: start;
}

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

/* ── Left panel ──────────────────────────────────────────────── */
.clp-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Upload area */
.clp-upload-area {
  background: var(--clp-surface);
  border: 2px dashed var(--clp-border);
  border-radius: var(--clp-radius);
  padding: 2rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.clp-upload-area.clp-drag-over {
  border-color: var(--clp-primary);
  background: #eff6ff;
}
.clp-upload-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto .75rem;
  color: var(--clp-primary);
}
.clp-upload-icon svg { width: 100%; height: 100%; }

.clp-upload-label {
  font-weight: 600;
  font-size: 1rem;
  margin: 0 0 .25rem;
}
.clp-upload-sub { color: var(--clp-muted); font-size: .85rem; margin: 0 0 .75rem; }
.clp-upload-hint { color: var(--clp-muted); font-size: .78rem; margin: .75rem 0 0; }

/* Buttons */
.clp-btn {
  display: inline-block;
  background: var(--clp-primary);
  color: #fff;
  border: none;
  padding: .55rem 1.4rem;
  border-radius: 8px;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, transform .1s;
  user-select: none;
}
.clp-btn:hover  { background: var(--clp-primary-h); color: #fff; text-decoration: none; }
.clp-btn:active { transform: scale(.97); }

.clp-btn-secondary {
  background: transparent;
  border: 2px solid var(--clp-border);
  color: var(--clp-text);
}
.clp-btn-secondary:hover { background: var(--clp-border); color: var(--clp-text); }

/* Info box */
.clp-info-box {
  background: #f8fafc;
  border: 1px solid var(--clp-border);
  border-radius: var(--clp-radius);
  padding: 1.1rem 1.3rem;
}
.clp-info-box h3 { font-size: .9rem; font-weight: 700; margin: 0 0 .6rem; }
.clp-info-box ul { margin: 0; padding-left: 1.2rem; }
.clp-info-box li { font-size: .82rem; color: var(--clp-muted); margin-bottom: .35rem; }

/* Controls */
.clp-controls {
  display: flex;
  flex-direction: column;
  gap: .6rem;
}
.clp-controls .clp-btn { width: 100%; text-align: center; }

/* ── Right panel: canvas ─────────────────────────────────────── */
.clp-canvas-wrapper { display: flex; flex-direction: column; gap: .5rem; }

.clp-canvas-container {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--clp-radius);
  overflow: hidden;
  box-shadow: var(--clp-shadow);
  background: #e8edf2;
}

#clp-canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

/* Placeholder */
.clp-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.clp-placeholder span {
  background: rgba(255,255,255,.85);
  padding: .6rem 1.2rem;
  border-radius: 8px;
  font-size: .85rem;
  color: var(--clp-muted);
  font-weight: 500;
  backdrop-filter: blur(4px);
}

/* Spinner */
.clp-spinner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(232,237,242,.75);
}
.clp-spin {
  width: 40px; height: 40px;
  border: 3px solid rgba(37,99,235,.2);
  border-top-color: var(--clp-primary);
  border-radius: 50%;
  animation: clp-rotate .7s linear infinite;
}
@keyframes clp-rotate { to { transform: rotate(360deg); } }

.clp-canvas-hint {
  text-align: center;
  font-size: .78rem;
  color: var(--clp-muted);
  margin: 0;
}
