/* =============================================
   SIGN CONFIGURATOR – STYLES
   Dark UI, mobile-first, axislab palette
   ============================================= */

/* ── Custom Fonts ─────────────────────────── */
@font-face { font-family: 'Almost Love';      src: url('../fonts/Almost Love.ttf') format('truetype');                font-display: swap; }
@font-face { font-family: 'Aqille';           src: url('../fonts/Aqille.ttf') format('truetype');                    font-display: swap; }
@font-face { font-family: 'Blossom Heart';    src: url('../fonts/Blossom Heart.ttf') format('truetype');             font-display: swap; }
@font-face { font-family: 'Chasing Miracles'; src: url('../fonts/Chasing Miracles Regular.ttf') format('truetype');  font-display: swap; }
@font-face { font-family: 'Cosby Corwin';     src: url('../fonts/Cosby Corwin.ttf') format('truetype');              font-display: swap; }
@font-face { font-family: 'Couraged';         src: url('../fonts/Couraged.ttf') format('truetype');                  font-display: swap; }
@font-face { font-family: 'Early Winter';     src: url('../fonts/Early Winter Regular.ttf') format('truetype');      font-display: swap; }
@font-face { font-family: 'Great Vibes';      src: url('../fonts/Great Vibes Regular.ttf') format('truetype');       font-display: swap; }
@font-face { font-family: 'Ladybug';          src: url('../fonts/Ladybug.ttf') format('truetype');                   font-display: swap; }
@font-face { font-family: 'Louis Ahera';      src: url('../fonts/Louis Ahera Regular.ttf') format('truetype');       font-display: swap; }
@font-face { font-family: 'Machiarge';        src: url('../fonts/Machiarge.ttf') format('truetype');                 font-display: swap; }
@font-face { font-family: 'Mousse Script';    src: url('../fonts/Mousse Script.otf') format('opentype');             font-display: swap; }
@font-face { font-family: 'Munich';           src: url('../fonts/Munich.ttf') format('truetype');                    font-display: swap; }
@font-face { font-family: 'My Butterfly';     src: url('../fonts/My Butterfly.ttf') format('truetype');              font-display: swap; }
@font-face { font-family: 'Rafandra';         src: url('../fonts/Rafandra.otf') format('opentype');                  font-display: swap; }
@font-face { font-family: 'Rafandra Italic';  src: url('../fonts/Rafandra Italic.otf') format('opentype');           font-display: swap; }
@font-face { font-family: 'Ralgani';          src: url('../fonts/Ralgani.otf') format('opentype');                   font-display: swap; }
@font-face { font-family: 'Ralgani Original'; src: url('../fonts/Ralgani Original.otf') format('opentype');          font-display: swap; }
@font-face { font-family: 'Sacramento';       src: url('../fonts/Sacramento Regular.ttf') format('truetype');        font-display: swap; }
@font-face { font-family: 'Sarah and James';  src: url('../fonts/Sarah and James.ttf') format('truetype');           font-display: swap; }
@font-face { font-family: 'Segoe Script';     src: url('../fonts/Segoe Script.ttf') format('truetype');              font-display: swap; }
@font-face { font-family: 'Segoe Script Bold'; src: url('../fonts/Segoe Script Bold.ttf') format('truetype');        font-display: swap; }
@font-face { font-family: 'Stephanie';        src: url('../fonts/Stephanie.ttf') format('truetype');                 font-display: swap; }

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-0:          #111111;
  --bg-1:          #1a1a1a;
  --bg-2:          #222222;
  --bg-3:          #2a2a2a;
  --bg-4:          #333333;
  --border:        #333333;
  --border-light:  #444444;
  --text-primary:  #e8e8f0;
  --text-secondary:#999999;
  --text-muted:    #666666;
  --accent:        #AFAF03;
  --accent-hover:  #c8c803;
  --accent-dim:    rgba(175,175,3,0.15);
  --accent-2:      #555555;
  --danger:        #cc3333;
  --success:       #22aa44;
  --radius:        8px;
  --radius-sm:     5px;
  --shadow:        0 2px 16px rgba(0,0,0,0.5);
  --transition:    0.17s ease;
  --header-h:      52px;
  --preview-h-mobile: 38vh;
}

html, body {
  height: 100%;
  background: var(--bg-0);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  overflow: hidden;
}

/* =============================================
   APP SHELL
   ============================================= */

#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

/* ── Header ──────────────────────────────────── */

#header {
  height: var(--header-h);
  background: var(--bg-1);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  flex-shrink: 0;
  z-index: 200;
}

.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}
.logo-img {
  height: 22px;
  width: auto;
}

.header-spacer { flex: 1; }

.header-title {
  font-size: 13px;
  color: var(--text-secondary);
  letter-spacing: 0.4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

@media (max-width: 767px) {
  .logo-img { height: 18px; }
  .header-title { font-size: 11px; }
}

/* ── Main layout ─────────────────────────────── */

#main {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

/* =============================================
   DESKTOP LAYOUT (≥ 768px)
   ============================================= */

@media (min-width: 768px) {
  #left-panel {
    width: 320px;
    min-width: 320px;
    background: var(--bg-1);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
  }

  #preview-area {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-0);
    position: relative;
    overflow: hidden;
  }
}

/* =============================================
   MOBILE LAYOUT (< 768px)
   ============================================= */

@media (max-width: 767px) {
  #main {
    flex-direction: column;
  }

  #preview-area {
    order: -1;  /* preview in alto su mobile */
    height: var(--preview-h-mobile);
    min-height: var(--preview-h-mobile);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-0);
    position: relative;
    border-bottom: 1px solid var(--border);
  }

  #left-panel {
    flex: 1;
    overflow: hidden;
    background: var(--bg-0);
    min-height: 0; /* allow flex shrinking */
    display: flex;
    flex-direction: column;
  }

  #wizard-footer {
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }

  .fab { display: none !important; } /* sostituito dal + flottante */
}

/* =============================================
   PREVIEW CANVAS WRAPPER
   ============================================= */

#canvas-wrapper {
  position: relative;
  box-shadow: 0 4px 40px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,255,255,0.06);
}

#canvas-wrapper canvas {
  display: block;
}

/* Hole overlay rings rendered by Fabric directly */

.preview-badge {
  position: absolute;
  bottom: 10px;
  right: 10px;
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  background: rgba(0,0,0,0.5);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  pointer-events: none;
}

/* =============================================
   WIZARD PANEL
   ============================================= */

#wizard-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* Step progress */

#step-progress {
  display: flex;
  align-items: center;
  padding: 14px 16px 10px;
  gap: 6px;
  flex-shrink: 0;
  background: var(--bg-1);
  border-bottom: 1px solid var(--border);
}

.step-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: default;
  transition: all var(--transition), transform 0.15s;
  flex-shrink: 0;
  user-select: none;
}
.step-dot.done {
  background: var(--accent);
  border-color: var(--accent);
  color: #111;
  cursor: pointer;
}
.step-dot.done:hover {
  background: var(--accent-hover);
  transform: scale(1.1);
}
.step-dot.active {
  background: transparent;
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.step-line {
  flex: 1;
  height: 2px;
  background: var(--border);
  border-radius: 1px;
  transition: background var(--transition);
}
.step-line.done { background: var(--accent); }

/* Step content */

#step-content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px;
}

.step-pane { display: none; }
.step-pane.active { display: block; }

.step-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--accent);
  margin-bottom: 16px;
}

/* Section within step */

.section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  margin-top: 18px;
}
.section-label:first-child { margin-top: 0; }

/* Wizard footer */

#wizard-footer {
  padding: 12px 16px;
  background: var(--bg-1);
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

/* =============================================
   BUTTONS
   ============================================= */

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 18px;
  background: var(--accent);
  color: #111;
  border: none;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition), transform 0.1s;
  white-space: nowrap;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:active { transform: scale(0.97); }
.btn-primary.full-width { width: 100%; }
.btn-primary:disabled { opacity: 0.35; cursor: default; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 18px;
  background: var(--bg-3);
  color: var(--text-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
  white-space: nowrap;
}
.btn-secondary:hover { background: var(--bg-4); border-color: var(--accent); }
.btn-secondary.grow { flex: 1; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 12px;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}
.btn-ghost:hover { color: var(--text-primary); border-color: var(--border-light); background: var(--bg-3); }
.btn-ghost.danger:hover { color: var(--danger); border-color: var(--danger); }

.btn-icon {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  font-size: 13px;
}
.btn-icon:hover { color: var(--text-primary); border-color: var(--border-light); }

/* =============================================
   FORM ELEMENTS
   ============================================= */

.input-group {
  margin-bottom: 10px;
}
.input-group label {
  display: block;
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 4px;
  font-weight: 500;
}

input[type="text"],
input[type="number"],
textarea,
select {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13px;
  padding: 7px 10px;
  transition: border-color var(--transition);
  font-family: inherit;
  appearance: none;
  -webkit-appearance: none;
}
input[type="text"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-3);
}

textarea { resize: vertical; min-height: 60px; }

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23999'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
}

.input-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.input-unit {
  display: flex;
  align-items: center;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color var(--transition);
}
.input-unit:focus-within { border-color: var(--accent); }
.input-unit input {
  flex: 1;
  background: transparent;
  border: none;
  padding: 7px 10px;
}
.input-unit input:focus { outline: none; background: transparent; border: none; }
.input-unit span {
  padding: 0 10px;
  color: var(--text-muted);
  font-size: 11px;
  background: var(--bg-3);
  border-left: 1px solid var(--border);
  height: 100%;
  display: flex;
  align-items: center;
}

/* Toggle switch */
.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.toggle-label { font-size: 12px; color: var(--text-secondary); flex: 1; }
.toggle {
  position: relative;
  width: 38px;
  height: 22px;
  flex-shrink: 0;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-track {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg-4);
  border-radius: 11px;
  cursor: pointer;
  transition: background var(--transition);
}
.toggle-track::after {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  top: 3px; left: 3px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: transform var(--transition), background var(--transition);
}
.toggle input:checked + .toggle-track { background: var(--accent); }
.toggle input:checked + .toggle-track::after {
  transform: translateX(16px);
  background: #111;
}

/* Style buttons (Bold/Italic) */
.style-btn {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition);
}
.style-btn:hover { border-color: var(--border-light); color: var(--text-primary); }
.style-btn.active { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }

.style-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}

/* =============================================
   FORMAT GRID (Step 1)
   ============================================= */

.format-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.format-btn {
  padding: 10px 8px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  transition: all var(--transition);
  line-height: 1.3;
}
.format-btn:hover { border-color: var(--border-light); color: var(--text-primary); }
.format-btn.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 700;
}

.corner-preset-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.custom-dims {
  padding: 10px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-top: 4px;
}
.custom-dims.hidden { display: none; }

/* =============================================
   MATERIAL GRID (Step 1)
   ============================================= */

.material-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.mat-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 6px 4px 8px;
  background: var(--bg-2);
  border: 2px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
}
.mat-btn:hover { border-color: var(--border-light); }
.mat-btn.active { border-color: var(--accent); background: var(--bg-3); }

.mat-swatch {
  width: 40px;
  height: 28px;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.1);
  overflow: hidden;
  flex-shrink: 0;
}
.mat-swatch canvas { width: 100%; height: 100%; display: block; }

.mat-label {
  font-size: 9px;
  text-align: center;
  color: var(--text-secondary);
  line-height: 1.2;
  word-break: break-word;
}
.mat-btn.active .mat-label { color: var(--accent); }

/* =============================================
   ELEMENTS STEP (Step 2)
   ============================================= */

/* Add element bar */
.add-element-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}
.add-element-bar .btn-secondary {
  white-space: normal;
  min-width: 0;
  padding: 9px 10px;
}

/* Elements list */
.elements-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.element-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
}
.element-chip:hover { border-color: var(--border-light); }
.element-chip.selected { border-color: var(--accent); background: var(--accent-dim); }

.chip-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--bg-3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--accent);
  flex-shrink: 0;
}

.chip-info {
  flex: 1;
  min-width: 0;
}
.chip-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chip-meta {
  font-size: 10px;
  color: var(--text-muted);
}

.chip-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

/* Element editor panel */
.element-editor {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 12px;
}
.element-editor.hidden { display: none; }

.editor-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Processing type toggle */
.proc-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 10px;
}
.proc-btn {
  padding: 7px 4px;
  background: var(--bg-2);
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
}
.proc-btn:hover { background: var(--bg-3); color: var(--text-secondary); }
.proc-btn.active { background: var(--accent-dim); color: var(--accent); }

/* Color swatches */
.color-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}
.color-swatch {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
}
.color-swatch:hover { transform: scale(1.15); }
.color-swatch.active { border-color: var(--accent); transform: scale(1.1); }

/* Center buttons */
.center-btns {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* Image preset gallery */
.preset-gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}
.preset-img-btn {
  aspect-ratio: 1;
  background: var(--bg-2);
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  transition: all var(--transition);
  overflow: hidden;
  padding: 4px;
}
.preset-img-btn:hover { border-color: var(--border-light); }
.preset-img-btn.active { border-color: var(--accent); background: var(--accent-dim); }
.preset-img-btn svg { width: 28px; height: 28px; }
.preset-img-label { font-size: 8px; color: var(--text-muted); text-align: center; }

/* File upload area */
.upload-area {
  border: 2px dashed var(--border-light);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition);
  margin-bottom: 10px;
}
.upload-area:hover { border-color: var(--accent); color: var(--text-secondary); }
.upload-area i { font-size: 20px; margin-bottom: 6px; display: block; }

/* =============================================
   HOLES STEP (Step 3)
   ============================================= */

.hole-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

.hole-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 8px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 11px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
}
.hole-btn i { font-size: 20px; }
.hole-btn:hover { border-color: var(--border-light); color: var(--text-primary); }
.hole-btn.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}

.diameter-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 4px;
}
.diam-btn {
  padding: 5px 12px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}
.diam-btn:hover { border-color: var(--border-light); color: var(--text-primary); }
.diam-btn.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

/* =============================================
   SUMMARY STEP (Step 4)
   ============================================= */

.summary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-bottom: 16px;
}
.summary-table td {
  padding: 7px 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.summary-table td:first-child {
  color: var(--text-muted);
  font-size: 11px;
  white-space: nowrap;
  width: 110px;
}
.summary-table td:last-child {
  color: var(--text-primary);
  font-weight: 500;
}

.order-btns {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-whatsapp {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  background: #25D366;
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition);
}
.btn-whatsapp:hover { background: #1da852; }

.btn-email {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px;
  background: var(--bg-3);
  color: var(--text-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition);
}
.btn-email:hover { background: var(--bg-4); }

/* =============================================
   BOTTOM SHEET (mobile element editor)
   ============================================= */

.sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.sheet-overlay.visible { opacity: 1; pointer-events: auto; }

.bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-1);
  border-radius: 16px 16px 0 0;
  border-top: 1px solid var(--border);
  z-index: 301;
  max-height: 80vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
}
.bottom-sheet.open { transform: translateY(0); }

.sheet-handle {
  width: 40px;
  height: 4px;
  background: var(--border-light);
  border-radius: 2px;
  margin: 12px auto 8px;
}

.sheet-content {
  padding: 0 16px 24px;
}

.sheet-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 14px;
  padding-top: 4px;
}

/* FAB button */
.fab {
  position: absolute;
  bottom: 16px;
  right: 16px;
  width: 48px;
  height: 48px;
  background: var(--accent);
  color: #111;
  border: none;
  border-radius: 50%;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(175,175,3,0.4);
  transition: background var(--transition), transform 0.15s;
  z-index: 100;
}
.fab:hover { background: var(--accent-hover); }
.fab:active { transform: scale(0.93); }

/* Footer FAB (+) for mobile — floating above footer, Step 2 only */
.footer-fab {
  position: fixed;
  bottom: 64px; /* sopra il footer */
  right: 16px;
  z-index: 201;
  width: 48px;
  height: 48px;
  background: var(--accent);
  color: #111;
  border: none;
  border-radius: 50%;
  font-size: 20px;
  display: none; /* nascosto di default, mostrato via JS solo su step 2 */
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(175,175,3,0.4);
  transition: background var(--transition), transform 0.15s;
}
.footer-fab:hover { background: var(--accent-hover); }
.footer-fab:active { transform: scale(0.93); }
@media (min-width: 768px) { .footer-fab { display: none !important; } }

/* =============================================
   CORNER RADIUS SECTION
   ============================================= */

#corner-radius-section { margin-bottom: 16px; }

.corner-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
#corner-linked-input { flex: 1; }

.corner-link-btn {
  font-size: 14px;
  color: var(--accent);
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
}
.corner-link-btn:not(.active) { color: var(--text-muted); border-color: var(--border); }
.corner-link-btn.active { border-color: var(--accent); background: var(--accent-dim); }

.corner-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  flex: 1;
}
.corner-grid .input-unit {
  display: flex;
  align-items: center;
  gap: 4px;
}
.corner-grid .input-unit label {
  font-size: 11px;
  color: var(--text-muted);
  min-width: 20px;
}
.corner-grid .input-unit input { width: 56px; }

/* =============================================
   EMPTY STATE
   ============================================= */

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 24px 0;
  font-size: 12px;
}
.empty-state i { font-size: 28px; display: block; margin-bottom: 8px; opacity: 0.5; }

/* =============================================
   SCROLLBAR
   ============================================= */

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-2); }

/* =============================================
   UTILITIES
   ============================================= */

.hidden { display: none !important; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.gap-8 { gap: 8px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-1 { flex: 1; }
.text-accent { color: var(--accent); }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.font-bold { font-weight: 700; }
.w-full { width: 100%; }

/* Mobile: hide desktop-only */
@media (max-width: 767px) {
  .desktop-only { display: none !important; }
}
@media (min-width: 768px) {
  .mobile-only { display: none !important; }
  .fab { display: none !important; }
}
