/*
 * Copyright (c) 2026 Leonardo Marchi. Tutti i diritti riservati.
 * Codice proprietario. Uso non autorizzato vietato.
 * Vedi NOTICE.txt per titolarita e condizioni d'uso.
 */

:root {
  --ink: #e8f0ff;
  --line: rgba(164, 192, 240, 0.34);
  --accent: #4f8cff;
  --bg: #0d1426;
  --paper: rgba(19, 28, 50, 0.88);
  --paper-2: rgba(255, 255, 255, 0.06);
  --warn: #f0dd4a;
  --provenance-id: "DAGNESE-LABEL-A6-2026-02-18-4F91C3";
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Rajdhani", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(800px 480px at 0% -10%, rgba(79, 140, 255, 0.26), transparent 62%),
    radial-gradient(700px 380px at 100% 0%, rgba(46, 212, 166, 0.18), transparent 58%),
    linear-gradient(180deg, #0a1122 0%, #0d1426 100%);
}

.app {
  min-height: 100vh;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(340px, 480px) 1fr;
  padding: 14px;
}

.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 12px 28px rgba(3, 10, 24, 0.36);
}

h1,
h2 {
  margin: 0 0 12px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-family: "Barlow Condensed", "Rajdhani", sans-serif;
}

h1 {
  font-size: 1.2rem;
}

h2 {
  font-size: 1rem;
}

.grid {
  display: grid;
  gap: 10px;
}

label {
  display: grid;
  gap: 4px;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: color-mix(in srgb, var(--ink) 86%, #ffffff 14%);
}

input,
textarea,
button {
  font: inherit;
}

input,
textarea {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  color: var(--ink);
  background: var(--paper-2);
}

textarea {
  resize: vertical;
}

.hp-group {
  border: 1px solid var(--line);
  border-radius: 10px;
  margin: 12px 0 8px;
  padding: 10px;
}

.hp-group legend {
  padding: 0 6px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
}

.hp-buttons {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 6px;
}

.hp {
  border: 2px solid var(--line);
  color: var(--ink);
  background: var(--paper-2);
  border-radius: 8px;
  padding: 6px 0;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}

.hp[aria-pressed="true"] {
  background: #f6b735;
  border-color: #f6b735;
  color: #1f2b58;
}

.checkline {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0;
}

.checkline span {
  font-size: 0.84rem;
}

.actions {
  margin-top: 14px;
}

.actions button {
  width: 100%;
  background: linear-gradient(125deg, var(--accent) 0%, #6a63ff 100%);
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 14px;
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.hp-warning-dialog {
  border: 0;
  padding: 0;
  background: transparent;
}

.hp-warning-dialog::backdrop {
  background: rgba(4, 10, 22, 0.58);
}

.hp-warning-card {
  min-width: min(92vw, 520px);
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 18px 42px rgba(3, 10, 24, 0.45);
  padding: 14px;
}

.hp-warning-head h3 {
  margin: 0 0 6px;
  color: #d73a49;
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.hp-warning-head p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.25;
  color: color-mix(in srgb, var(--ink) 90%, #fff 10%);
}

.hp-warning-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.hp-warning-actions .btn,
.hp-warning-actions .btn-alt {
  min-width: 110px;
}

.preview-panel {
  display: grid;
  grid-template-rows: auto 1fr;
}

.preview-wrap {
  overflow: auto;
  display: grid;
  place-items: start center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.print-page {
  width: 105mm;
  height: 148mm;
  display: block;
  background: #fff;
}

.label-a6 {
  position: relative;
  width: 105mm;
  height: 148mm;
  background: #fff;
  border: 0.3mm solid #202020;
  padding: 0;
  color: #111e3d;
  box-sizing: border-box;
}

body.theme-light {
  --ink: #14264a;
  --line: rgba(98, 133, 192, 0.38);
  --accent: #2e6fff;
  --bg: #f0f5ff;
  --paper: rgba(255, 255, 255, 0.9);
  --paper-2: rgba(255, 255, 255, 0.95);
}

body.theme-light {
  background:
    radial-gradient(780px 460px at 0% -10%, rgba(79, 140, 255, 0.2), transparent 62%),
    radial-gradient(700px 380px at 100% 0%, rgba(46, 212, 166, 0.12), transparent 58%),
    linear-gradient(180deg, #f2f7ff 0%, #eaf2ff 100%);
}

body.theme-light .panel {
  box-shadow: 0 10px 22px rgba(35, 69, 122, 0.12);
}

body.theme-light .preview-wrap {
  background: rgba(240, 247, 255, 0.85);
}

.l-block { position: absolute; left: 1.5mm; right: 1.5mm; }

.l-nominativo {
  top: 1.5mm;
  height: 10.5mm;
  border: 0.2mm solid #d7dde8;
  padding: 0.8mm 1.5mm;
  font-size: 6.5mm;
  line-height: 1.05;
  color: #24395f;
  overflow: hidden;
}

.l-meta {
  top: 13mm;
  height: 16.5mm;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: end;
  gap: 1.5mm;
  padding: 0 0.4mm;
}

.l-cer {
  font-size: 18mm;
  line-height: 0.95;
  font-weight: 700;
  letter-spacing: 0.3mm;
}

.l-aster {
  font-size: 10mm;
  color: #6f7f9d;
  padding-bottom: 0.8mm;
}

.l-sf {
  display: flex;
  align-items: end;
  gap: 1mm;
}

.l-sf small {
  font-size: 6mm;
  color: #617294;
  font-weight: 500;
}

.l-sf strong {
  font-size: 13mm;
  line-height: 1;
}

.l-hp {
  top: 27.4mm;
  height: 8.5mm;
  font-size: 7mm;
  font-weight: 800;
  padding: 0 0.6mm;
  overflow: hidden;
}

.l-desc {
  top: 36.2mm;
  height: 16mm;
  border: 0.2mm solid #d7dde8;
  padding: 0.8mm 1.4mm;
  font-size: 4.15mm;
  line-height: 1.05;
  font-weight: 500;
  letter-spacing: -0.01em;
  word-break: break-word;
  overflow: hidden;
}

.l-box {
  top: 53mm;
  bottom: 1.5mm;
  border: 0.2mm solid #141414;
  background: #fff;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.l-box.is-hazard {
  background: var(--warn);
}

.l-date {
  position: absolute;
  top: 1mm;
  right: 1.4mm;
  font-size: 4.4mm;
}

.l-symbol {
  display: block;
  text-align: center;
  font-family: "Arial Black", "Segoe UI Black", Arial, sans-serif;
  font-size: 108mm;
  line-height: 0.82;
  font-weight: 500;
}

.amianto-sign {
  position: absolute;
  inset: 0;
  border-radius: 0;
  overflow: hidden;
  display: grid;
  grid-template-rows: 56mm 1fr;
  box-shadow: none;
}

.amianto-top {
  background: #000;
  display: grid;
  place-items: center;
}

.amianto-top span {
  color: #fff;
  font-size: 40mm;
  font-family: "Segoe UI", Arial, sans-serif;
  font-weight: 700;
  line-height: 1;
}

.amianto-bottom {
  background: #e62025;
  color: #fff;
  text-align: center;
  padding: 4.8mm 4mm 0;
}

.amianto-bottom h3 {
  margin: 0;
  font-size: 6.6mm;
  line-height: 1.07;
  letter-spacing: 0.02em;
}

.amianto-bottom p {
  margin: 7mm 0 0;
  font-size: 5.1mm;
  line-height: 1.12;
  font-weight: 600;
}

.label-a6.mode-amianto {
  border: none;
  background: transparent;
  overflow: hidden;
}

.print-root {
  display: none;
}

@media (max-width: 1020px) {
  .app {
    grid-template-columns: 1fr;
  }
}

@media print {
  @page {
    size: A6 portrait;
    margin: 0;
  }

  html,
  body {
    width: 105mm;
    height: 148mm;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff;
  }

  .app {
    display: none !important;
  }

  .print-root {
    display: block;
    width: 105mm;
  }

  .print-page {
    width: 105mm;
    height: 148mm;
    break-after: page;
    page-break-after: always;
    display: block;
    background: #fff;
  }

  .print-page:last-child {
    break-after: auto;
    page-break-after: auto;
  }

  .label-a6 {
    margin: 0;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .l-symbol {
    font-size: 108mm;
  }
}

