/* Aspetto dell’interfaccia. La firma email è definita in js/signature.js. */
:root {
  --ink:#202725;
  --muted:#77817c;
  --paper:#f4f5f1;
  --line:#e3e7e1;
  --accent:#00b3ad;
  --radius:18px;
  font-family:N27,Arial,sans-serif;
  color:var(--ink);
  background:var(--paper);
  font-synthesis:none;
  color-scheme:light
}

* {
  box-sizing:border-box
}

body {
  margin:0
}

button,input,select,textarea {
  font:inherit
}

button,select,summary {
  cursor:pointer
}

button {
  color:inherit
}

button:disabled {
  cursor:not-allowed;
  opacity:.42
}

button,select,input,a,summary,textarea {
  outline-offset:4px
}

button:focus-visible,select:focus-visible,input:focus-visible,a:focus-visible,summary:focus-visible {
  outline:2px solid #008e88
}

svg {
  width:22px;
  height:22px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.6;
  stroke-linecap:round;
  stroke-linejoin:round
}

button {
  transition:background .15s,color .15s,box-shadow .15s
}

button:not(:disabled):active {
  transform:translateY(1px)
}

[hidden] {
  display:none!important
}

main {
  max-width:1536px;
  margin:auto;
  padding:43px 4.1% 0
}

.page-intro {
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom:34px
}

.eyebrow {
  font-size:10px;
  letter-spacing:1.7px;
  font-weight:500;
  color:#79867c;
  margin:0 0 12px
}

.page-intro h1 {
  font-size:clamp(30px,3.2vw,44px);
  font-weight:500;
  letter-spacing:-1.8px;
  line-height:1.15;
  margin:0 0 12px
}

.intro-copy {
  font-size:15px;
  max-width:900px;
  line-height:1.65;
  color:#77817c;
  margin:0
}

.workspace {
  display:grid;
  grid-template-columns:350px minmax(0,1fr);
  gap:26px;
  align-items:start
}

.panel {
  background:#fff;
  border:1px solid var(--line);
  border-radius:var(--radius)
}

.form-panel {
  padding:26px
}

.panel-heading {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:25px
}

h2 {
  font-size:19px;
  letter-spacing:-.5px;
  font-weight:500;
  margin:0
}

.step-badge {
  font-size:11px;
  color:#8b978d;
  border:1px solid var(--line);
  padding:5px 7px;
  border-radius:6px
}

.field {
  display:flex;
  flex-direction:column;
  gap:8px;
  min-width:0
}

.field label {
  font-size:12px;
  font-weight:500
}

.field label .optional {
  color:#8b948e;
  font-weight:400
}

.field input,select {
  border:1px solid #dfe5de;
  background:#fff;
  min-height:43px;
  border-radius:9px;
  padding:11px 12px;
  font-size:13px;
  width:100%;
  color:var(--ink);
  transition:border-color .15s,box-shadow .15s
}

.field input::placeholder {
  color:#a1aaa3
}

.field input:hover,select:hover {
  border-color:#a9b6ab
}

.field input:focus,select:focus {
  border-color:#009c96;
  box-shadow:0 0 0 3px #00b3ad0d;
  outline:none
}

.field input[aria-invalid=true] {
  border-color:#c74636
}

.field-error {
  font-size:11px;
  color:#b63d2b;
  line-height:1.4
}

.select-wrap {
  position:relative
}

.select-wrap select {
  padding-left:34px;
  padding-right:28px;
  font-size:14px;
  font-weight:500;
  appearance:none;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23667169' stroke-width='1.8'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat:no-repeat;
  background-position:right 10px center
}

.company-dot {
  position:absolute;
  left:14px;
  top:19px;
  width:7px;
  height:7px;
  background:var(--company-color,#58595b);
  border-radius:50%;
  pointer-events:none
}

.field-help {
  font-size:11px;
  line-height:1.5;
  color:#8b958e;
  margin:12px 0 0
}

.company-help {
  font-size:10px;
  margin-top:9px
}

.field-grid {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:17px 12px
}

.field-grid .field {
  grid-column:1/-1
}

.field-grid .field.half {
  grid-column:auto
}

fieldset {
  border:0;
  margin:24px 0 0;
  padding:22px 0 0;
  border-top:1px solid #edf0eb;
  min-width:0
}

legend {
  float:left;
  font-size:10px;
  letter-spacing:1.1px;
  color:#7f8d81;
  text-transform:uppercase;
  margin-bottom:20px;
  width:100%;
  font-weight:500
}

.required-note {
  color:#919a93;
  font-size:10px;
  margin:20px 0 0
}

.form-footer {
  display:flex;
  justify-content:space-between;
  border-top:1px solid #edf0eb;
  margin-top:20px;
  padding-top:16px;
  gap:8px
}

.text-button {
  background:none;
  border:0;
  padding:5px 0;
  font-size:12px;
  font-weight:500;
  color:#008e88
}

.text-button:hover {
  text-decoration:underline
}

.text-button.muted {
  color:#87938a
}

.result-column {
  display:flex;
  flex-direction:column;
  gap:20px;
  min-width:0
}

.preview-panel {
  overflow:hidden
}

.preview-heading {
  padding:28px 28px 24px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:15px
}

.preview-heading h2 {
  font-size:23px
}

.preview-toolbar {
  border-top:1px solid #eef0ec;
  border-bottom:1px solid #eef0ec;
  background:#fafbf8;
  padding:12px 24px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px
}

.segmented {
  background:#edf0e9;
  display:flex;
  border-radius:8px;
  padding:3px;
  gap:2px
}

.segmented button {
  border:0;
  border-radius:6px;
  padding:7px 12px;
  font-size:11px;
  background:none;
  color:#829083
}

.segmented button[aria-pressed=true] {
  background:white;
  color:#34493b;
  box-shadow:0 1px 3px #15221814
}

.company-label {
  font-size:11px;
  color:#758278
}

.preview-stage {
  padding:42px 20px 40px;
  min-height:254px;
  background:#fff;
  overflow-x:auto;
  display:flex;
  align-items:center
}

.preview-stage a {
  pointer-events:none
}

.preview-stage #preview-scale {
  transform-origin:top left;
  flex-shrink:0
}

#signature-preview {
  display:flow-root;
  width:max-content
}

#png-preview {
  display:block;
  max-width:none
}

.preview-caption {
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:13px 25px;
  border-top:1px solid #eff1ed;
  font-size:10px;
  color:#929a94;
  gap:16px
}

.font-label {
  font-size:10px;
  color:#7d8980;
  border:1px solid #e8ece6;
  padding:4px 7px;
  border-radius:4px
}

.export-panel {
  padding:26px 28px
}

.export-panel .panel-heading {
  margin-bottom:14px
}

.export-panel .eyebrow {
  font-size:9px;
  margin-bottom:8px
}

.export-panel h2 {
  font-size:23px
}

.export-copy {
  font-size:13px;
  color:#7f8981;
  line-height:1.65;
  max-width:590px;
  margin:0 0 20px
}

.button {
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  border-radius:9px;
  padding:13px 16px;
  min-height:46px;
  font-size:12px;
  font-weight:500;
  border:1px solid transparent
}

.primary {
  background:var(--ink);
  color:#fff;
  width:100%;
  font-size:14px
}

.primary:not(:disabled):hover {
  background:#365046
}

.primary svg {
  width:18px;
  height:18px
}

.button-arrow {
  margin-left:auto;
  font-size:21px;
  line-height:1
}

.primary>svg {
  margin-right:auto
}

.download-grid {
  display:grid;
  grid-template-columns:1.2fr 1fr 1fr;
  gap:9px;
  margin-top:10px
}

.secondary {
  background:white;
  border-color:#dfe6dc;
  font-size:11px;
  padding:12px 8px;
  gap:7px;
  white-space:nowrap
}

.secondary:not(:disabled):hover {
  background:#f6f8f3;
  border-color:#afbfaf
}

.secondary svg {
  width:16px;
  height:16px
}

.small-icon {
  font-size:14px
}

.export-hint {
  font-size:10px;
  color:#8c968e;
  margin:13px 0 0
}

.font-note {
  display:flex;
  gap:14px;
  background:#f7f8f4;
  border-radius:10px;
  padding:16px;
  margin-top:22px
}

.font-note>span {
  font-size:22px;
  color:#7e8c7d;
  align-self:flex-start
}

.font-note p {
  font-size:11px;
  color:#889183;
  line-height:1.65;
  margin:0
}

.font-note strong {
  font-weight:500;
  color:#5f705f;
  display:block
}

.code-panel {
  padding:0 25px
}

.code-panel summary {
  display:flex;
  justify-content:space-between;
  align-items:center;
  list-style:none;
  font-size:12px;
  color:#79877c;
  padding:20px 0
}

.code-panel summary::-webkit-details-marker {
  display:none
}

.code-panel summary>span {
  font-size:18px;
  color:#96a393
}

.code-panel[open] summary>span {
  transform:rotate(45deg)
}

pre {
  max-height:240px;
  overflow:auto;
  padding:16px;
  background:#f5f7f2;
  border-radius:8px;
  margin:0 0 20px;
  font-size:10px;
  line-height:1.7;
  color:#526c5b;
  white-space:pre-wrap;
  overflow-wrap:anywhere
}

.page-footer {
  margin-top:36px;
  padding:22px 0 30px;
  border-top:1px solid var(--line);
  display:flex;
  justify-content:space-between;
  font-size:10px;
  color:#96a092;
  gap:16px
}

.footer-divider {
  padding:0 9px;
  color:#c7cfc2
}

dialog {
  border:1px solid var(--line);
  border-radius:20px;
  padding:36px;
  max-width:min(520px,calc(100vw - 32px));
  color:var(--ink);
  box-shadow:0 25px 90px #1c2f2433
}

dialog::backdrop {
  background:#15251c60;
  backdrop-filter:blur(3px)
}

dialog h2 {
  font-size:27px;
  margin:0 0 14px
}

dialog p {
  font-size:14px;
  line-height:1.7;
  color:#6f7d72
}

dialog .eyebrow {
  font-size:10px;
  color:#7a8b7d
}

.dialog-close {
  position:absolute;
  right:18px;
  top:14px;
  border:0;
  background:none;
  font-size:25px;
  color:#8e998e;
  padding:0 6px
}

.dialog-icon {
  font-size:32px;
  background:#edf4ea;
  color:#667d68;
  display:inline-block;
  border-radius:12px;
  padding:12px;
  margin-bottom:22px
}

.dialog-detail {
  font-size:11px;
  color:#8f9b90
}

.dialog-actions {
  display:flex;
  flex-direction:column;
  gap:14px;
  margin-top:25px
}

.toast {
  position:fixed;
  bottom:25px;
  left:50%;
  transform:translateX(-50%);
  padding:16px 23px;
  background:#223d30;
  color:white;
  border-radius:12px;
  box-shadow:0 6px 30px #172d3425;
  max-width:calc(100vw - 40px);
  font-size:13px;
  line-height:1.5;
  z-index:10
}

.toast.error {
  background:#953b2e
}

.manual-rich {
  border:1px solid var(--line);
  border-radius:8px;
  overflow:auto;
  padding:20px;
  margin:18px 0;
  max-width:100%;
  max-height:300px
}

#copy-dialog {
  max-width:min(1050px,calc(100vw - 32px))
}

#manual-code {
  width:100%;
  height:220px;
  padding:14px;
  font-family:monospace;
  font-size:11px;
  border:1px solid var(--line);
  border-radius:8px;
  margin:10px 0 20px
}

.noscript {
  position:fixed;
  bottom:0;
  background:#ffe7d4;
  padding:20px;
  width:100%;
  text-align:center
}

.field-grid {
  clear:both
}

@media(min-width:1500px) {
  .workspace {
    grid-template-columns:380px minmax(0,1fr)
  }

  .form-panel {
    padding:28px
  }

  .preview-stage {
    min-height:280px
  }

}

@media(max-width:1050px) {
  .workspace {
    grid-template-columns:310px minmax(0,1fr);
    gap:18px
  }

  .form-panel {
    padding:22px
  }

  .preview-heading {
    padding:25px 22px
  }

  .preview-heading h2 {
    font-size:20px
  }

  .export-panel {
    padding:24px 22px
  }

  .download-grid {
    grid-template-columns:1fr 1fr
  }

  .download-grid button:first-child {
    grid-column:1/-1
  }

  .company-label {
    display:none
  }

  .preview-stage {
    padding:35px 12px;
    min-height:220px
  }

}

@media(max-width:760px) {
.workspace {
    grid-template-columns:1fr;
    gap:20px
  }

  main {
    padding:30px 20px 0
  }

  .page-intro {
    margin-bottom:26px
  }

  .page-intro h1 {
    font-size:34px;
    letter-spacing:-1.2px
  }

  .intro-copy {
    font-size:13px
  }

.eyebrow {
    font-size:9px
  }

  .form-panel {
    padding:25px
  }

  .field-grid {
    gap:18px 14px
  }

  .field input {
    font-size:16px
  }

  .select-wrap select {
    font-size:16px
  }

  .result-column {
    gap:18px
  }

  .preview-heading h2 {
    font-size:21px
  }

  .preview-stage {
    min-height:190px
  }

  .download-grid {
    grid-template-columns:1.2fr 1fr 1fr
  }

  .download-grid button:first-child {
    grid-column:auto
  }

  .secondary {
    font-size:10px
  }

  .page-footer {
    font-size:9px;
    flex-wrap:wrap;
    margin-top:28px
  }

  .preview-caption {
    padding:12px 20px
  }

  .preview-toolbar {
    padding:12px 20px
  }

  dialog {
    padding:30px 25px
  }

  .company-label {
    display:block
  }

}

@media(max-width:420px) {
.download-grid {
    grid-template-columns:1fr 1fr
  }

  .download-grid button:first-child {
    grid-column:1/-1
  }

  .company-label {
    display:none
  }

  .preview-heading h2 {
    font-size:19px
  }

  .page-intro h1 {
    font-size:30px
  }

  .preview-heading {
    padding:24px 20px
  }

.form-panel {
    padding:22px
  }

}

@media(prefers-reduced-motion:reduce) {
  * {
    transition:none!important;
    scroll-behavior:auto!important
  }

}

