:root {
  /* Palette Ross Developer — bianco / nero / arancio */
  --ink: #171717;
  --muted: #555555;
  --soft: #8a8a8a;
  --line: #e6e6e3;
  --line-strong: #cfcfca;
  --bg: #f4f4f2;
  --surface: #ffffff;
  --surface-2: #f7f7f5;
  --brand: #171717;
  --brand-2: #ea580c;
  --accent: #ea580c;
  --accent-soft: #fff2e9;
  --success: #16a34a;
  --danger: #c0392b;
  --panel: #171717;
  --panel-2: #232323;
  --shadow: 0 18px 50px rgba(23, 23, 23, 0.14);
  --shadow-soft: 0 10px 30px rgba(23, 23, 23, 0.08);
  --radius: 8px;
  --focus: 0 0 0 4px rgba(234, 88, 12, 0.18);
  --font-display: "Audiowide", "Trebuchet MS", sans-serif;
}

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

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  font-family: Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

body::before {
  content: none;
}

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

button {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

.container {
  position: relative;
  z-index: 1;
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0;
}

.app-card {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(215, 228, 227, 0.95);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: clip;
}

.header {
  padding: 24px;
  color: #ffffff;
  background: var(--brand);
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 32px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 6px 10px 6px 6px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.10);
  text-decoration: none;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.brand-link:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(234, 88, 12, 0.68);
}

.brand-link:focus-visible,
.btn:focus-visible,
.step-btn:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.logo-img {
  width: 34px;
  height: 34px;
  border-radius: 7px;
  object-fit: cover;
  background: #ffffff;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.52);
}

.logo-text {
  color: #ffffff;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.header-badge {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(234, 88, 12, 0.56);
  border-radius: var(--radius);
  color: #ffe0cc;
  background: rgba(234, 88, 12, 0.18);
  font-size: 0.85rem;
  font-weight: 700;
}

.header-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 24px;
}

.eyebrow {
  margin: 0 0 10px;
  color: #ffb488;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.header h1 {
  max-width: 780px;
  margin: 0;
  font-size: clamp(2rem, 5vw, 4.6rem);
  line-height: 0.96;
  letter-spacing: 0;
}

.header-left > p:last-child {
  max-width: 640px;
  margin: 18px 0 0;
  color: rgba(245, 250, 249, 0.78);
  font-size: 1rem;
  line-height: 1.7;
}

.header-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(88px, 1fr));
  gap: 10px;
  width: min(100%, 400px);
}

.header-stats div {
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.10);
}

.header-stats strong,
.header-stats span {
  display: block;
}

.header-stats strong {
  margin-bottom: 3px;
  color: #ffffff;
  font-size: 1.2rem;
}

.header-stats span {
  color: rgba(255, 255, 255, 0.66);
  font-size: 0.78rem;
}

.progress-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--line);
  background: rgba(249, 252, 251, 0.88);
}

.step-btn {
  min-height: 72px;
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
  text-align: left;
  padding: 14px 18px;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease;
}

.step-btn:last-child {
  border-right: 0;
}

.step-btn span {
  display: block;
  margin-bottom: 5px;
  color: var(--soft);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
}

.step-btn:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.step-btn.active {
  color: var(--brand-2);
  background: #f7f7f5;
  border-bottom-color: var(--accent);
}

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

.content {
  min-width: 0;
  padding: 30px;
}

.quote-panel {
  position: sticky;
  top: 18px;
  align-self: start;
  padding: 30px 30px 30px 0;
}

.panel-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: #ffffff;
  padding: 22px;
  box-shadow: var(--shadow-soft);
}

.panel-kicker {
  display: block;
  margin-bottom: 8px;
  color: #ffe0cc;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.panel-total {
  display: block;
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  line-height: 1;
  letter-spacing: 0;
}

.panel-divider {
  height: 1px;
  margin: 22px 0;
  background: rgba(255, 255, 255, 0.16);
}

.panel-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.panel-row span {
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.88rem;
}

.panel-row strong {
  color: #ffffff;
  text-align: right;
}

.btn-panel {
  width: 100%;
  margin-top: 18px;
  background: #ffffff;
  color: var(--panel);
}

.btn-panel:hover {
  background: var(--accent-soft);
  color: #111827;
}

.step-content {
  display: none;
}

.step-content.active {
  display: block;
  animation: enter 180ms ease-out;
}

@keyframes enter {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section-heading {
  max-width: 760px;
  margin-bottom: 24px;
}

.section-heading.compact {
  margin-bottom: 0;
}

.section-heading > span {
  display: inline-flex;
  margin-bottom: 8px;
  color: var(--brand-2);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(1.45rem, 2.4vw, 2.2rem);
  line-height: 1.12;
  letter-spacing: 0;
}

.section-heading p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.app-notice {
  margin-bottom: 18px;
  padding: 13px 14px;
  border: 1px solid rgba(234, 88, 12, 0.42);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent-soft);
  color: #9a3412;
  font-weight: 800;
  line-height: 1.45;
}

.subsection-title {
  margin: 28px 0 16px;
  color: var(--brand);
  font-size: 0.96rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.section-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.tipo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.tipo-wrapper {
  position: relative;
  min-width: 0;
}

.tipo-btn {
  width: 100%;
  min-height: 88px;
  padding: 18px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 0 rgba(16, 24, 40, 0.04);
  cursor: pointer;
  font-size: 0.96rem;
  font-weight: 850;
  line-height: 1.35;
  text-align: left;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.tipo-btn:hover {
  transform: translateY(-2px);
  border-color: var(--brand-2);
  box-shadow: var(--shadow-soft);
}

.tipo-btn.selected {
  border-color: var(--brand-2);
  background: #f7f7f5;
  color: var(--brand);
  box-shadow: 0 12px 26px rgba(23, 23, 23, 0.16);
}

.tipo-btn.selected::after {
  content: "Selezionato";
  display: inline-flex;
  margin-top: 12px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #f0f0ed;
  color: var(--brand-2);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
}

.remove-tipo {
  position: absolute;
  top: -8px;
  right: -8px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--danger);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 900;
  opacity: 0;
  transition: opacity 160ms ease, transform 160ms ease;
}

.tipo-wrapper:hover .remove-tipo,
.remove-tipo:focus-visible {
  opacity: 1;
}

.remove-tipo:hover {
  transform: scale(1.08);
}

.tipo-actions,
.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 22px;
}

.nuovo-mestiere-form,
.modelli-container,
.voce-item,
.totali-box,
.riepilogo-box,
.info-box {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(16, 24, 40, 0.04);
}

.nuovo-mestiere-form {
  padding: 18px;
  margin-bottom: 22px;
  background: #f7f7f5;
}

.form-section,
.form-grid,
.form-grid-2 {
  display: grid;
  gap: 14px;
}

.form-section {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 22px;
}

.form-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 20px;
}

.form-block {
  margin-bottom: 18px;
}

.form-group {
  min-width: 0;
}

label {
  display: block;
  margin-bottom: 7px;
  color: #344054;
  font-size: 0.86rem;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  padding: 13px 14px;
  font-size: 1rem;
  line-height: 1.4;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

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

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--brand-2);
  box-shadow: var(--focus);
  background: #fcfcfb;
}

input.is-invalid,
textarea.is-invalid {
  border-color: var(--danger);
  background: var(--accent-soft);
}

.field-error {
  margin-top: 6px;
  color: var(--danger);
  font-size: 0.78rem;
  font-weight: 700;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  min-width: 44px;
  border: 0;
  border-radius: var(--radius);
  padding: 0 18px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 850;
  line-height: 1.2;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, color 160ms ease;
}

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

.btn-primary {
  background: var(--brand);
  color: #ffffff;
  box-shadow: 0 10px 20px rgba(31, 79, 95, 0.20);
}

.btn-primary:hover {
  background: var(--brand-2);
}

.btn-secondary {
  background: #f4f4f2;
  color: var(--brand);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

.btn-secondary:hover {
  background: #e9e9e5;
}

.btn-success {
  background: var(--accent);
  color: #17202a;
  box-shadow: 0 10px 20px rgba(234, 88, 12, 0.22);
}

.btn-success:hover {
  background: #d88907;
}

.btn-wide {
  width: 100%;
}

.btn-delete {
  width: 44px;
  height: 44px;
  padding: 0;
  background: var(--accent-soft);
  color: var(--danger);
  font-size: 1rem;
  box-shadow: none;
}

.btn-delete:hover {
  background: #ffedd5;
}

.button-group {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.button-group .btn {
  flex: 1 1 0;
}

.modelli-container {
  padding: 16px;
  margin-bottom: 20px;
  background: #f7f7f5;
}

.modelli-title {
  margin-bottom: 12px;
  color: var(--brand);
  font-weight: 850;
}

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

.modello-item {
  position: relative;
}

.modello-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  padding: 14px;
  text-align: left;
}

.modello-info {
  min-width: 0;
}

.modello-desc {
  color: var(--ink);
  font-weight: 800;
}

.modello-ore {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
}

.modello-prezzo {
  flex-shrink: 0;
  color: var(--brand-2);
  font-weight: 900;
}

.voce-item {
  padding: 16px;
  margin-bottom: 14px;
  background: #fcfcfb;
}

.voce-numero {
  margin-bottom: 12px;
  color: var(--brand);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.voce-fields {
  display: grid;
  grid-template-columns: minmax(220px, 5fr) minmax(94px, 1.2fr) minmax(120px, 1.4fr) minmax(88px, 1fr) 52px;
  gap: 12px;
  align-items: end;
}

.voce-totale {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
}

.voce-totale-right,
.voce-totale strong {
  color: var(--brand-2);
  font-weight: 900;
}

.totali-box {
  padding: 18px;
  margin-top: 20px;
  background: var(--panel);
  color: #ffffff;
}

.totali-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
}

.totali-row span {
  color: rgba(255, 255, 255, 0.7);
}

.totali-row strong {
  text-align: right;
}

.totali-finale {
  margin-top: 10px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 1.45rem;
}

.riepilogo-box {
  padding: 18px;
  margin-top: 18px;
  margin-bottom: 20px;
  background: #f5faf8;
}

.riepilogo-title {
  margin-bottom: 14px;
  color: var(--brand);
  font-weight: 900;
}

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

.riepilogo-item {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.riepilogo-item p {
  margin: 0;
}

.riepilogo-item p:first-child {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.riepilogo-item p:last-child {
  color: var(--ink);
  font-weight: 850;
}

.empty-state {
  padding: 38px 20px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
  background: #fcfcfb;
}

.empty-state svg {
  display: block;
  margin: 0 auto 12px;
  color: var(--soft);
}

.info-box {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  margin-top: 16px;
  background: var(--accent-soft);
  border-color: #fed7aa;
}

.info-box > span {
  display: grid;
  place-items: center;
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: var(--accent);
  color: #111827;
  font-weight: 900;
}

.info-box-content {
  color: #713f12;
  line-height: 1.6;
  font-size: 0.9rem;
}

.info-box-title {
  margin-bottom: 4px;
  font-weight: 900;
}

.info-box p {
  margin: 0;
}

.footer-text {
  max-width: 980px;
  margin: 18px auto 0;
  color: var(--muted);
  font-size: 0.88rem;
  text-align: center;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 38px;
  padding: 5px 10px 5px 5px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  color: var(--brand);
  box-shadow: var(--shadow-soft);
  font-weight: 900;
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.footer-brand:hover {
  transform: translateY(-1px);
  border-color: rgba(234, 88, 12, 0.82);
  background: #ffffff;
}

.footer-logo {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  object-fit: cover;
  background: #ffffff;
}

.footer-tagline {
  margin: 0;
}

.footer-legal {
  margin-top: 12px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-soft);
  line-height: 1.7;
}

.footer-legal p {
  margin: 0 0 6px;
}

.footer-rights {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.footer-legal p:last-child {
  margin-bottom: 0;
}

.footer-legal strong {
  color: var(--ink);
}

.footer-legal a {
  color: var(--brand-2);
  font-weight: 800;
  text-decoration: none;
}

.footer-legal a:hover {
  text-decoration: underline;
}

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: minmax(0, 1fr) 300px;
  }

  .quote-panel {
    padding-right: 22px;
  }

  .voce-fields {
    grid-template-columns: minmax(180px, 4fr) repeat(3, minmax(86px, 1fr)) 52px;
  }
}

@media (max-width: 960px) {
  .container {
    width: min(100% - 20px, 760px);
    padding: 10px 0 20px;
  }

  .header {
    padding: 20px;
  }

  .brand-row,
  .header-content,
  .section-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .header-content {
    display: flex;
  }

  .header-stats {
    width: 100%;
  }

  .workspace {
    display: flex;
    flex-direction: column;
  }

  .quote-panel {
    order: -1;
    position: sticky;
    top: 0;
    z-index: 20;
    width: 100%;
    padding: 14px;
    background: rgba(238, 243, 248, 0.92);
    backdrop-filter: blur(14px);
  }

  .panel-card {
    display: grid;
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .content {
    padding: 22px;
  }

  .form-section,
  .form-grid,
  .form-grid-2,
  .modelli-grid,
  .riepilogo-grid {
    grid-template-columns: 1fr;
  }

  .voce-fields {
    grid-template-columns: 1fr 1fr;
  }

  .voce-fields .form-group:first-child {
    grid-column: 1 / -1;
  }

  .voce-fields .form-group:last-child {
    grid-column: 1 / -1;
  }

  .btn-delete {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .container {
    width: 100%;
    padding: 0;
  }

  .app-card,
  .header,
  .footer-legal {
    border-radius: 0;
  }

  .brand-row {
    gap: 10px;
    margin-bottom: 24px;
  }

  .brand-link {
    width: 100%;
    justify-content: center;
  }

  .header-badge {
    justify-content: center;
  }

  .header h1 {
    font-size: clamp(2rem, 11vw, 3.1rem);
  }

  .header-stats {
    grid-template-columns: 1fr;
  }

  .progress-steps {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
  }

  .step-btn {
    flex: 0 0 42%;
    min-height: 66px;
    scroll-snap-align: start;
  }

  .content {
    padding: 18px 14px 22px;
  }

  .quote-panel {
    padding: 10px;
  }

  .panel-total {
    font-size: 2rem;
  }

  .panel-row {
    padding: 8px 0;
  }

  .tipo-grid,
  .voce-fields {
    grid-template-columns: 1fr;
  }

  .button-group {
    flex-direction: column;
  }

  .voce-totale {
    flex-direction: column;
    align-items: flex-start;
  }

  input,
  textarea,
  select {
    font-size: 16px;
  }

  .footer-text {
    padding: 0 12px 16px;
  }

  .footer-brand {
    width: min(100%, 320px);
  }
}

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

/* ── DISPLAY FONT — Ross Developer (Audiowide) ──
   Usato con parsimonia: è uno strumento, non una landing.
   Solo wordmark, titolo hero e totale. Il resto resta Inter. */
.logo-text,
.header h1,
.panel-total {
  font-family: var(--font-display);
  font-weight: 400 !important;
  letter-spacing: 0;
}
.header h1 {
  font-size: clamp(1.5rem, 3.6vw, 2.7rem);
  line-height: 1.14;
}
.logo-text {
  font-size: 1.02rem;
}
