/* ==========================================================================
   BIANCO / NERO — DESIGN SYSTEM BDC (STYLE IDEAS.EMANUELEBDC.COM)
   Conforme alla Costituzione Globale Antigravity & Regole emaf205
   - Fondo caldo carta / light stone: #f7f7f5
   - Bordo netto tattile: 2.5px solid #000000
   - Bando assoluto al testo microscopico: TUTTO >= 16px
   - Contrasto elevatissimo WCAG AAA per visione monoculare
   - Nativamente silenzioso: ZERO audio sintetico di default
   - Ergonomia touch generosa mobile-first (min 48-52px)
   - Pulsanti Icone-First con Testo Minimo
   ========================================================================== */

:root {
  --bg-page: #f7f7f5;
  --ink: #000000;
  --card-bg: #ffffff;
  --border-color: #000000;
  
  --bdc-bg: #f7f7f5;
  --bdc-surface: #ffffff;
  --bdc-card-bg: #ffffff;
  --bdc-text: #000000;
  --bdc-text-muted: #27272a;     /* Antracite scuro ad alto contrasto (AAA) */
  --bdc-border: #000000;          /* Bordo nero netto */
  --bdc-border-strong: #000000;
  
  --bdc-primary: #000000;
  --bdc-primary-hover: #1f1f23;
  --bdc-accent: #2563eb;
  --bdc-accent-hover: #1d4ed8;

  /* Regola non-negoziabile emaf205: Nessun testo sotto i 16px */
  --font-base: 18px;
  --font-lead: 21px;
}

* {
  box-sizing: border-box;
}

body {
  background-color: var(--bg-page) !important;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: var(--font-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

/* ==========================================================================
   NAVBAR & HEADER IN STILE BDC
   ========================================================================== */
.navbar-bdc {
  background-color: #ffffff !important;
  border-bottom: 2.5px solid var(--border-color) !important;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08);
  padding: 14px 0;
}

.navbar-brand-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink) !important;
}

.navbar-brand-badge {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 2px solid #000000;
  background: #000000;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 20px;
  flex-shrink: 0;
}

.navbar-brand-title {
  font-size: 1.35rem;
  font-weight: 850;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.2;
}

/* ==========================================================================
   CARDS & CONTAINERS TATTIILI
   ========================================================================== */
.card-bdc {
  background: #ffffff !important;
  border: 2.5px solid var(--border-color) !important;
  border-radius: 20px !important;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.12), 0 2px 4px -2px rgba(0, 0, 0, 0.08) !important;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.card-bdc:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 12px -2px rgba(0, 0, 0, 0.16), 0 4px 6px -2px rgba(0, 0, 0, 0.1) !important;
}

/* ==========================================================================
   DROPZONE TATTICO-REATTIVA
   ========================================================================== */
.dropzone-box {
  background: #ffffff;
  border: 3px dashed #000000;
  border-radius: 24px;
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.18s ease;
  position: relative;
  min-height: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.dropzone-box:hover {
  background: #fafafa;
  border-color: #000000;
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.dropzone-box.dragover {
  background: #f4f4f0 !important;
  border-color: #000000 !important;
  border-style: solid !important;
  transform: scale(1.01);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.18) !important;
}

.dropzone-icon {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  border: 2.5px solid #000000;
  background: #f7f7f5;
  color: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 38px;
  margin-bottom: 8px;
  transition: transform 0.15s ease;
}

.dropzone-box:hover .dropzone-icon {
  transform: scale(1.06);
}

/* ==========================================================================
   TIPOGRAFIA & ACCESSIBILITÀ emaf205 (TUTTO >= 16px)
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
  color: var(--ink);
  font-weight: 850;
  letter-spacing: -0.02em;
}

p, li, label, input, select, textarea {
  font-size: var(--font-base);
  color: var(--ink);
}

.small, small {
  font-size: 16px !important;
  color: var(--bdc-text-muted) !important;
  line-height: 1.5;
}

.text-muted, .text-secondary {
  color: var(--bdc-text-muted) !important;
}

.badge {
  font-size: 16px !important;
  font-weight: 700;
  padding: 8px 14px;
}

/* ==========================================================================
   BOTTONI TATTIILI (ICONE-FIRST & TESTO MINIMO)
   ========================================================================== */
.btn {
  font-size: 18px;
  font-weight: 750;
  padding: 12px 22px;
  border-radius: 14px;
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
  cursor: pointer;
  text-decoration: none;
}

.btn-sm {
  font-size: 16px !important;
  min-height: 44px !important;
  padding: 8px 16px !important;
  border-radius: 10px !important;
}

.btn-lg {
  font-size: 19px !important;
  min-height: 58px !important;
  padding: 14px 28px !important;
}

.btn:active {
  transform: translateY(1px);
}

.btn-dark {
  background-color: #000000;
  border: 2.5px solid #000000;
  color: #ffffff;
}

.btn-dark:hover, .btn-dark:focus {
  background-color: #1f1f23;
  border-color: #1f1f23;
  color: #ffffff;
}

.btn-outline-dark {
  background-color: #ffffff;
  border: 2.5px solid #000000;
  color: #000000;
}

.btn-outline-dark:hover {
  background-color: #000000;
  color: #ffffff;
  border-color: #000000;
}

.btn-demo {
  background-color: #fff9db;
  border: 2px solid #000000;
  color: #000000;
  font-weight: 750;
  border-radius: 12px;
}

.btn-demo:hover {
  background-color: #ffe066;
  color: #000000;
}

/* Pill buttons per filtri e preset */
.preset-pill {
  font-size: 16px !important;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 999px;
  border: 2px solid var(--border-color);
  background-color: #ffffff;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.12s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
}

.preset-pill:hover {
  background-color: #f0f0f0;
  transform: translateY(-1px);
}

.preset-pill.active {
  background-color: #000000 !important;
  color: #ffffff !important;
  border-color: #000000 !important;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* ==========================================================================
   PREVIEW WORKBENCH CANVAS
   ========================================================================== */
.canvas-container {
  width: 100%;
  padding: 16px;
  background: #ffffff;
  border: 2.5px solid #000000;
  border-radius: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 380px;
  overflow: hidden;
  position: relative;
}

.canvas-scacchiera {
  background: repeating-conic-gradient(#e5e5e5 0% 25%, #ffffff 0% 50%) 0 / 24px 24px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
}

canvas#mainCanvas {
  display: block;
  max-width: 100%;
  max-height: 60vh;
  object-fit: contain;
  margin: auto;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

/* Informazioni metadati barra */
.metadata-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: center;
}

/* ==========================================================================
   MINI FEATURE CARDS (HOME)
   ========================================================================== */
.feature-card {
  background: #ffffff;
  border: 2px solid #000000;
  border-radius: 16px;
  padding: 20px;
  height: 100%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.feature-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 10px rgba(0, 0, 0, 0.1);
}

.feature-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #f7f7f5;
  border: 2px solid #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 12px;
}

/* ==========================================================================
   TOAST DI FEEDBACK RAPIDO
   ========================================================================== */
.feedback-toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: #000000;
  color: #ffffff;
  border: 2px solid #ffffff;
  border-radius: 14px;
  padding: 14px 24px;
  font-size: 17px;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 1055;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.feedback-toast.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* ==========================================================================
   ACCESSIBILITÀ & FOCUS
   ========================================================================== */
:focus-visible {
  outline: 3px solid #000000 !important;
  outline-offset: 3px !important;
}

[hidden] {
  display: none !important;
}

@media (max-width: 768px) {
  .dropzone-box {
    padding: 32px 16px;
    min-height: 300px;
  }
  .navbar-brand-title {
    font-size: 1.15rem;
  }
  .btn-lg {
    font-size: 17px !important;
    width: 100%;
  }
}
