/* =============================================
   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; }
@font-face { font-family: 'Garine First';     src: url('../fonts/Garine\ First.otf') format('opentype');                 font-display: swap; }
@font-face { font-family: 'Aquire';              src: url('../fonts/Aquire.otf') format('opentype');                          font-display: swap; }
@font-face { font-family: 'Aquire Bold';         src: url('../fonts/Aquire_Bold.otf') format('opentype');                    font-display: swap; }
@font-face { font-family: 'Aquire Light';        src: url('../fonts/Aquire_Light.otf') format('opentype');                   font-display: swap; }
@font-face { font-family: 'Audiowide';           src: url('../fonts/Audiowide_Regular.ttf') format('truetype');              font-display: swap; }
@font-face { font-family: 'Azonix';              src: url('../fonts/Azonix.otf') format('opentype');                         font-display: swap; }
@font-face { font-family: 'Berkshire Swash';     src: url('../fonts/Berkshire_Swash_Regular.ttf') format('truetype');        font-display: swap; }
@font-face { font-family: 'Bubblegum Sans';      src: url('../fonts/Bubblegum_Sans_Regular.ttf') format('truetype');         font-display: swap; }
@font-face { font-family: 'Call Of Ops Duty';    src: url('../fonts/Call_Of_Ops_Duty.otf') format('opentype');               font-display: swap; }
@font-face { font-family: 'Carbon Black';        src: url('../fonts/Carbon_Black.otf') format('opentype');                   font-display: swap; }
@font-face { font-family: 'Helvetica Bold Condensed'; src: url('../fonts/Helvetica_Bold_Condensed.otf') format('opentype');  font-display: swap; }
@font-face { font-family: 'Kamehaya Bintang';    src: url('../fonts/Kamehaya_Bintang.ttf') format('truetype');               font-display: swap; }
@font-face { font-family: 'Limelight';           src: url('../fonts/Limelight_Regular.ttf') format('truetype');              font-display: swap; }
@font-face { font-family: 'Mokoto';              src: url('../fonts/Mokoto.ttf') format('truetype');                         font-display: swap; }
@font-face { font-family: 'Old London';          src: url('../fonts/Old_London.ttf') format('truetype');                     font-display: swap; }
@font-face { font-family: 'Pirata One';          src: url('../fonts/Pirata_One_Regular.ttf') format('truetype');             font-display: swap; }
@font-face { font-family: 'Righteous';           src: url('../fonts/Righteous_Regular.ttf') format('truetype');              font-display: swap; }
@font-face { font-family: 'Roboto Condensed Bold';            src: url('../fonts/RobotoCondensed-Bold.ttf') format('truetype');             font-display: swap; }
@font-face { font-family: 'Roboto Condensed Bold Italic';     src: url('../fonts/RobotoCondensed-BoldItalic.ttf') format('truetype');       font-display: swap; }
@font-face { font-family: 'Roboto Condensed Italic';          src: url('../fonts/RobotoCondensed-Italic.ttf') format('truetype');           font-display: swap; }
@font-face { font-family: 'Roboto Condensed Light';           src: url('../fonts/RobotoCondensed-Light.ttf') format('truetype');            font-display: swap; }
@font-face { font-family: 'Roboto Condensed Light Italic';    src: url('../fonts/RobotoCondensed-LightItalic.ttf') format('truetype');      font-display: swap; }
@font-face { font-family: 'Roboto Condensed Regular';         src: url('../fonts/RobotoCondensed-Regular.ttf') format('truetype');          font-display: swap; }
@font-face { font-family: 'Roboto Bold';         src: url('../fonts/Roboto_Bold.ttf') format('truetype');                    font-display: swap; }
@font-face { font-family: 'Roboto Bold Italic';  src: url('../fonts/Roboto_BoldItalic.ttf') format('truetype');              font-display: swap; }
@font-face { font-family: 'Roboto Italic';       src: url('../fonts/Roboto_Italic.ttf') format('truetype');                  font-display: swap; }
@font-face { font-family: 'Roboto Light';        src: url('../fonts/Roboto_Light.ttf') format('truetype');                   font-display: swap; }
@font-face { font-family: 'Roboto Regular';      src: url('../fonts/Roboto_Regular.ttf') format('truetype');                 font-display: swap; }
@font-face { font-family: 'DIN Schablonierschrift';         src: url('../fonts/DIN_Schablonierschrift.ttf') format('truetype');                 font-display: swap; }
@font-face { font-family: 'Stencil';                src: url('../fonts/stencil.ttf') format('truetype');                 font-display: swap; }
@font-face { font-family: 'Black Ops One Regular';          src: url('../fonts/Black_Ops_One-Regular.ttf') format('truetype');                 font-display: swap; }
@font-face { font-family: 'PF Din Stencil Hairline';        src: url('../fonts/PFD_in_Stencil-Hairline.ttf') format('truetype');              font-display: swap; }
@font-face { font-family: 'PF Din Stencil Extra Thin';      src: url('../fonts/PFD_in_Stencil-ExtraThin.ttf') format('truetype');              font-display: swap; }
@font-face { font-family: 'PF Din Stencil Thin';            src: url('../fonts/PFD_in_Stencil-Thin.ttf') format('truetype');              font-display: swap; }
@font-face { font-family: 'PF Din Stencil Light';           src: url('../fonts/PFD_in_Stencil-Light.ttf') format('truetype');              font-display: swap; }
@font-face { font-family: 'PF Din Stencil Regular';         src: url('../fonts/PFD_in_Stencil-Regular.ttf') format('truetype');              font-display: swap; }
@font-face { font-family: 'PF Din Stencil Medium';          src: url('../fonts/PFD_in_Stencil-Medium.ttf') format('truetype');              font-display: swap; }
@font-face { font-family: 'PF Din Stencil Bold';            src: url('../fonts/PFD_in_Stencil-Bold.ttf') format('truetype');              font-display: swap; }
@font-face { font-family: 'PF Din Stencil Black';           src: url('../fonts/PFD_in_Stencil-Black.ttf') format('truetype');              font-display: swap; }
/* ── Stencil fonts pack (added in v=20260513d) ─────────────────────────────── */
@font-face { font-family: 'AG Stencil';                     src: url('../fonts/ag_stencil.ttf') format('truetype');                            font-display: swap; }
@font-face { font-family: 'Akwa Stencil Bold';              src: url('../fonts/akwa_stencil_bold.otf') format('opentype');                     font-display: swap; }
@font-face { font-family: 'Amusette High Stencil';          src: url('../fonts/amusette_high_stencil.ttf') format('truetype');                 font-display: swap; }
@font-face { font-family: 'Belladona Stencil';              src: url('../fonts/belladona_stencil.ttf') format('truetype');                     font-display: swap; }
@font-face { font-family: 'Blacktroops Stencil';            src: url('../fonts/blacktroops_stencil.ttf') format('truetype');                   font-display: swap; }
@font-face { font-family: 'Blocking';                       src: url('../fonts/blocking.ttf') format('truetype');                              font-display: swap; }
@font-face { font-family: 'Brannboll Stencil';              src: url('../fonts/brannboll_stencil.ttf') format('truetype');                     font-display: swap; }
@font-face { font-family: 'Breaking Stencil News';          src: url('../fonts/breaking_stencil_news.ttf') format('truetype');                 font-display: swap; }
@font-face { font-family: 'Bunker Stencil';                 src: url('../fonts/bunker_stencil_regular.otf') format('opentype');                font-display: swap; }
@font-face { font-family: 'CF Stencil Orama Stamp';         src: url('../fonts/cf_stencil_orama_stamp_regular.ttf') format('truetype');        font-display: swap; }
@font-face { font-family: 'Cheddar Gothic Stencil';         src: url('../fonts/cheddar_gothic_stencil.otf') format('opentype');                font-display: swap; }
@font-face { font-family: 'Dollar';                         src: url('../fonts/dollar.ttf') format('truetype');                                font-display: swap; }
@font-face { font-family: 'Entulho Stencil';                src: url('../fonts/entulho_stencil_trial.ttf') format('truetype');                 font-display: swap; }
@font-face { font-family: 'Error Stencil';                  src: url('../fonts/error_stencil.ttf') format('truetype');                         font-display: swap; }
@font-face { font-family: 'Fashion Stencil';                src: url('../fonts/fashion_stencil_regular.ttf') format('truetype');               font-display: swap; }
@font-face { font-family: 'Gomarice Goma Stencil';          src: url('../fonts/gomarice_goma_stencil.ttf') format('truetype');                 font-display: swap; }
@font-face { font-family: 'Goth Stencil Premium';           src: url('../fonts/goth_stencil_premium.ttf') format('truetype');                  font-display: swap; }
@font-face { font-family: 'Kenyan Coffee Stencil';          src: url('../fonts/kenyan_coffee_stencil_sb.otf') format('opentype');              font-display: swap; }
@font-face { font-family: 'MK Stencil Sans Black';          src: url('../fonts/mk_stencil_sans_black.ttf') format('truetype');                 font-display: swap; }
@font-face { font-family: 'Modern Stencil';                 src: url('../fonts/modern_stencil.ttf') format('truetype');                        font-display: swap; }
@font-face { font-family: 'Old School United Stencil';      src: url('../fonts/old_school_united_stencil.ttf') format('truetype');             font-display: swap; }
@font-face { font-family: 'Old School United Stencil Italic'; src: url('../fonts/old_school_united_stencil_italic.ttf') format('truetype');    font-display: swap; }
@font-face { font-family: 'Olde Stencil';                   src: url('../fonts/olde_stencil.ttf') format('truetype');                          font-display: swap; }
@font-face { font-family: 'Pesta Stencil';                  src: url('../fonts/pesta_stencil_regular.otf') format('opentype');                 font-display: swap; }
@font-face { font-family: 'Rock Stencil';                   src: url('../fonts/rock_stencil_regular.ttf') format('truetype');                  font-display: swap; }
@font-face { font-family: 'Ruler Stencil Bold';             src: url('../fonts/ruler_stencil_bold.ttf') format('truetype');                    font-display: swap; }
@font-face { font-family: 'Ruler Stencil Bold Italic';      src: url('../fonts/ruler_stencil_bold_italic.ttf') format('truetype');             font-display: swap; }
@font-face { font-family: 'Ruler Stencil Heavy';            src: url('../fonts/ruler_stencil_heavy.ttf') format('truetype');                   font-display: swap; }
@font-face { font-family: 'Ruler Stencil Heavy Italic';     src: url('../fonts/ruler_stencil_heavy_italic.ttf') format('truetype');            font-display: swap; }
@font-face { font-family: 'Savaro Stencil';                 src: url('../fonts/savaro_stencil.otf') format('opentype');                        font-display: swap; }
@font-face { font-family: 'Silex Stencil Basic';            src: url('../fonts/silex_stencil_basic.otf') format('opentype');                   font-display: swap; }
@font-face { font-family: 'Spacedock Stencil';              src: url('../fonts/spacedock_stencil.ttf') format('truetype');                     font-display: swap; }
@font-face { font-family: 'Stencil 1935';                   src: url('../fonts/stencil_1935.ttf') format('truetype');                          font-display: swap; }
@font-face { font-family: 'Stencilia A';                    src: url('../fonts/stencilia_a.ttf') format('truetype');                           font-display: swap; }
@font-face { font-family: 'Stencilia Bold';                 src: url('../fonts/stencilia_bold.ttf') format('truetype');                        font-display: swap; }
@font-face { font-family: 'Stencilitis';                    src: url('../fonts/stencilitis.ttf') format('truetype');                           font-display: swap; }
@font-face { font-family: 'Stencilla';                      src: url('../fonts/stencilla.ttf') format('truetype');                             font-display: swap; }
@font-face { font-family: 'Stencilove';                     src: url('../fonts/stencilove.ttf') format('truetype');                            font-display: swap; }
@font-face { font-family: 'TT Mussels Stencil Bold';        src: url('../fonts/tt_mussels_stencil_bold.otf') format('opentype');               font-display: swap; }
@font-face { font-family: 'TT Mussels Stencil Bold Italic'; src: url('../fonts/tt_mussels_stencil_bold_italic.otf') format('opentype');        font-display: swap; }
@font-face { font-family: 'USSR Stencil';                   src: url('../fonts/ussr_stencil.ttf') format('truetype');                          font-display: swap; }
@font-face { font-family: 'Woodcutter Army Stencil';        src: url('../fonts/woodcutter_army_stencil.ttf') format('truetype');               font-display: swap; }
@font-face { font-family: 'Zoia Stencil';                   src: url('../fonts/zoia_stencil.ttf') format('truetype');                          font-display: swap; }
/* ── Font pack added in v=20260513s ── */
@font-face { font-family: 'Agrozza';                        src: url('../fonts/Agrozza.ttf') format('truetype');                                font-display: swap; }
@font-face { font-family: 'Angel Stencil';                  src: url('../fonts/Angel Stencil.ttf') format('truetype');                          font-display: swap; }
@font-face { font-family: 'Avestrage';                      src: url('../fonts/avestrage.ttf') format('truetype');                              font-display: swap; }
@font-face { font-family: 'Catherova';                      src: url('../fonts/catherova.ttf') format('truetype');                              font-display: swap; }
@font-face { font-family: 'Eklektyk Stencil';               src: url('../fonts/Eklektyk-Stencil.otf') format('opentype');                       font-display: swap; }
@font-face { font-family: 'Exodus Stencil';                 src: url('../fonts/Exodus Stencil.otf') format('opentype');                         font-display: swap; }
@font-face { font-family: 'Howkins';                        src: url('../fonts/Howkins.ttf') format('truetype');                                font-display: swap; }
@font-face { font-family: 'Modernia';                       src: url('../fonts/Modernia-Regular.otf') format('opentype');                       font-display: swap; }
@font-face { font-family: 'Monback';                        src: url('../fonts/Monback.ttf') format('truetype');                                font-display: swap; }
@font-face { font-family: 'Plaster';                        src: url('../fonts/Plaster.ttf') format('truetype');                                font-display: swap; }
@font-face { font-family: 'POGO Display';                   src: url('../fonts/POGO Display.ttf') format('truetype');                           font-display: swap; }
@font-face { font-family: 'Sistemas BT';                    src: url('../fonts/sistemas-font-bt.ttf') format('truetype');                       font-display: swap; }
@font-face { font-family: 'Vegan';                          src: url('../fonts/Vegan.ttf') format('truetype');                                  font-display: swap; }
@font-face { font-family: 'Ventus';                         src: url('../fonts/Ventus.ttf') format('truetype');                                 font-display: swap; }
@font-face { font-family: 'Ventus Italic';                  src: url('../fonts/Ventus Italic.ttf') format('truetype');                          font-display: swap; }
@font-face { font-family: 'Zefani Stencil';                 src: url('../fonts/Zefani Stencil.otf') format('opentype');                         font-display: swap; }
@font-face { font-family: 'Brag Stencil Pro';               src: url('../fonts/BragStencilPro.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-actions {
  display: flex;
  gap: 4px;
  margin-right: 10px;
}
.header-icon-btn {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  transition: background .15s, color .15s;
}
.header-icon-btn:hover {
  background: var(--accent);
  color: var(--bg-0);
}

.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-btn { 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;
}

/* ── Custom font selector (Safari-friendly font preview) ── */
.font-select-wrap {
  position: relative;
  width: 100%;
}
.font-select-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 15px;
  padding: 7px 10px;
  cursor: pointer;
  transition: border-color var(--transition);
  text-align: left;
  min-height: 36px;
}
.font-select-btn:focus,
.font-select-btn.open {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-3);
}
.font-select-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.font-select-arrow {
  width: 0; height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid #999;
  margin-left: 8px;
  flex-shrink: 0;
}
.font-select-dropdown {
  display: none;
  position: absolute;
  left: 0; right: 0;
  top: calc(100% + 2px);
  max-height: 240px;
  overflow-y: auto;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  z-index: 800;
  box-shadow: 0 6px 20px rgba(0,0,0,.5);
}
.font-select-dropdown.open { display: block; }
.font-select-option {
  padding: 10px 12px;
  cursor: pointer;
  font-size: 18px;
  line-height: 1.8;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: visible;
}
.font-select-option:hover,
.font-select-option.active {
  background: var(--accent-dim);
  color: var(--accent);
}
.font-select-search-wrap {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 6px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
}
.font-select-search {
  width: 100%;
  padding: 7px 10px;
  background: var(--bg-3);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  outline: none;
}
.font-select-search:focus { border-color: var(--accent); }
.font-select-empty {
  padding: 14px 12px;
  color: var(--text-muted, #888);
  font-size: 14px;
  text-align: center;
}
/* visibility is driven by the `hidden` HTML attribute (toggled from JS) */

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

/* ── Context menu (mobile long press) ── */
.ctx-menu {
  display: none;
  position: fixed;
  z-index: 9999;
  min-width: 160px;
  background: rgba(44, 44, 46, 0.98);
  border-radius: 13px;
  padding: 4px 0;
  box-shadow: 0 8px 30px rgba(0,0,0,.45), 0 0 0 0.5px rgba(255,255,255,.12);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  animation: ctx-pop .15s ease-out;
  touch-action: none;
}
.ctx-menu.visible { display: block; }
@keyframes ctx-pop {
  0%   { opacity: 0; transform: scale(.85); }
  100% { opacity: 1; transform: scale(1); }
}
.ctx-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 16px;
  background: none;
  border: none;
  color: #fff;
  font-size: 15px;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.ctx-menu-item:active { background: rgba(255,255,255,.12); }
.ctx-menu-item i { width: 18px; text-align: center; font-size: 14px; opacity: .8; }
.ctx-menu-item:disabled { opacity: .35; pointer-events: none; }
.ctx-menu-danger { color: #ff453a; }
.ctx-menu-divider { height: 0.5px; background: rgba(255,255,255,.15); margin: 2px 0; }

.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); }

.backlit-element-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.backlit-element-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
}
.backlit-element-row:hover { border-color: var(--border-light); }
.backlit-element-row.selected { border-color: var(--accent); background: var(--accent-dim); }
.backlit-element-row input[type="checkbox"] { accent-color: var(--accent); margin: 0; }
.backlit-element-row .label { flex: 1; font-size: 13px; color: var(--fg); }

.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;
}

/* Multi-selection alignment toolbar */
.align-btns {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.align-btn {
  flex: 1;
  min-width: 40px;
  justify-content: center;
}

/* 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-telegram {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  background: #0088cc;
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  transition: background var(--transition);
}
.btn-telegram:hover { background: #006daa; }

.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-btn {
  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-btn { display: none !important; }
}

.cky-revisit-bottom-left {
  display: none !important;
}

/* ── Upload overlay ───────────────────────── */
.upload-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.upload-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}
.upload-spinner-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  color: #fff;
  font-size: 15px;
}
.upload-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255,255,255,0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
/* =============================================
   MODELLI (Step 1)
   ============================================= */

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

.model-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;
  line-height: 1.3;
  transition: all var(--transition);
}
.model-btn:hover { border-color: var(--border-light); color: var(--text-primary); }
.model-btn.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 700;
}

/* Il su misura non è una famiglia come le altre: occupa la riga intera e si
   distingue, perché è la scelta che porta fuori dal catalogo. */
.model-btn--custom {
  grid-column: 1 / -1;
  border-style: dashed;
}

.hint-row {
  margin: 0 0 12px;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.4;
}

/* =============================================
   BARRA DEL PREZZO
   ============================================= */

#prezzo-barra {
  flex-shrink: 0;
  background: var(--bg-1);
  border-top: 1px solid var(--border);
}

#prezzo-testa {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
  font: inherit;
}

.prezzo-etichetta {
  flex: 1;
  color: var(--text-secondary);
  font-size: 12px;
}

#prezzo-valore {
  color: var(--accent);
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
#prezzo-valore.prezzo-valore--preventivo {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}

#prezzo-freccia {
  color: var(--text-muted);
  font-size: 11px;
  transition: transform var(--transition);
}
#prezzo-testa[aria-expanded="true"] #prezzo-freccia { transform: rotate(180deg); }

#prezzo-corpo {
  padding: 0 16px 12px;
  border-top: 1px solid var(--border);
}

#prezzo-dettaglio { padding-top: 10px; }

.prezzo-voce {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 5px 0;
  font-size: 12px;
  color: var(--text-secondary);
}
.prezzo-voce-label { flex: 1; }
.prezzo-voce-label em {
  display: block;
  color: var(--text-muted);
  font-size: 11px;
  font-style: normal;
  line-height: 1.35;
  margin-top: 1px;
}
.prezzo-voce-importo {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.prezzo-voce--totale {
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  color: var(--text-primary);
  font-weight: 700;
}

.prezzo-avviso {
  padding: 6px 0;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.45;
}

.prezzo-opzione {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.4;
  cursor: pointer;
}
.prezzo-opzione input { margin-top: 2px; accent-color: var(--accent); }
.prezzo-opzione em {
  color: var(--accent);
  font-style: normal;
  font-weight: 600;
  white-space: nowrap;
}

.prezzo-nota {
  margin: 6px 0 0;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.4;
}

/* Acquisto (Step 4) */

.btn-acquista {
  width: 100%;
  padding: 13px 18px;
  font-size: 15px;
  gap: 9px;
}
.btn-acquista:disabled {
  background: var(--bg-3);
  color: var(--text-muted);
  cursor: not-allowed;
}
