:root {
  --bg: #0b0f1a;
  --surface: #ffffff;
  --surface-alt: #f6f7fb;
  --text: #161513;
  --text-soft: #5f5a52;
  --border: #e3ddd2;
  --primary: #161513;
  --primary-dark: #000000;
  --accent: #f5c518;
  --accent-dark: #e0b400;
  --warn: #d2691e;
  --success: #1aa56e;
  --shadow-sm: 0 1px 2px rgba(14,19,38,.06), 0 2px 8px rgba(14,19,38,.04);
  --shadow-md: 0 6px 20px rgba(14,19,38,.08);
  --shadow-lg: 0 24px 60px rgba(14,19,38,.18);
  --radius: 12px;
  --radius-lg: 18px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--surface);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
img { max-width: 100%; }
.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: #161513;
  border-bottom: 3px solid var(--accent);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px;
}
.logo { display: inline-flex; align-items: center; gap: 10px; color: #fff; }
.logo-mark {
  display: inline-grid; place-items: center;
  width: 32px; height: 32px; border-radius: 6px;
  background: var(--accent);
  color: #161513; font-weight: 900;
}
.logo-text { font-weight: 800; letter-spacing: -0.01em; }
.logo-ai {
  color: var(--accent); font-weight: 800;
}
nav a { color: #d6d2c8; margin-left: 22px; font-size: 14px; font-weight: 600; }
nav a:hover { color: #fff; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 18px; border-radius: 10px;
  font-weight: 600; font-size: 15px; cursor: pointer;
  border: 1px solid transparent; transition: transform .04s, box-shadow .2s, background .2s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #161513 !important; border-color: #161513; font-weight: 700; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--accent-dark); }
.btn-ghost { background: transparent; color: var(--text) !important; border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-alt); }
.btn-sm { padding: 8px 14px; font-size: 14px; }
.btn-lg { padding: 16px 26px; font-size: 17px; }
.btn-block { display: flex; width: 100%; }

/* Hero */
.hero {
  padding: 72px 0 56px;
  background:
    radial-gradient(800px 400px at 90% -20%, rgba(245,197,24,.22), transparent 60%),
    radial-gradient(700px 400px at -10% 10%, rgba(22,21,19,.05), transparent 60%);
}
.cantiere-tape {
  height: 10px;
  background: repeating-linear-gradient(45deg, var(--accent), var(--accent) 18px, #161513 18px, #161513 36px);
}
.hero-grid {
  display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center;
}
.badge {
  display: inline-block; padding: 6px 12px; border-radius: 4px;
  background: #161513; color: var(--accent);
  font-size: 13px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase;
}
.hero h1 {
  font-size: 54px; line-height: 1.05; letter-spacing: -0.02em;
  margin: 18px 0 14px; font-weight: 900;
}
.accent { background: var(--accent); color: #161513; padding: 0 .12em; border-radius: 3px; }
.lead { font-size: 18px; color: var(--text-soft); max-width: 520px; }
.hero-cta { display: flex; gap: 12px; margin-top: 28px; }
.hero-trust { display: flex; gap: 28px; margin-top: 36px; }
.trust-item strong { display: block; font-size: 22px; font-weight: 800; }
.trust-item span { color: var(--text-soft); font-size: 13px; }

/* Mockup */
.mock-window {
  background: white; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  overflow: hidden;
}
.mock-bar {
  background: #f1f3f9; padding: 10px 14px;
  display: flex; gap: 6px; border-bottom: 1px solid var(--border);
}
.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot.red { background: #ff5f57; }
.dot.yellow { background: #febc2e; }
.dot.green { background: #28c840; }
.mock-body { padding: 22px; }
.mock-row-input {
  background: var(--surface-alt); padding: 14px 16px;
  border-radius: 10px; color: var(--text-soft); font-size: 14px;
  display: flex; gap: 10px; align-items: flex-start;
}
.mock-mic { font-size: 18px; }
.mock-arrow { text-align: center; color: var(--text-soft); margin: 10px 0; }
.mock-quote {
  border: 1px solid var(--border); border-radius: 12px; padding: 18px;
}
.mock-quote-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.mock-tag {
  background: rgba(26,165,110,.12); color: var(--success);
  padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
}
.mock-list { list-style: none; padding: 0; margin: 0 0 14px; }
.mock-list li {
  display: flex; justify-content: space-between;
  padding: 8px 0; border-bottom: 1px dashed var(--border);
  font-size: 14px;
}
.mock-list li:last-child { border-bottom: none; }
.mock-total {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--surface-alt); padding: 12px 14px; border-radius: 10px;
}
.mock-total strong { font-size: 20px; }

/* Sections */
.section { padding: 80px 0; }
.section-alt { background: var(--surface-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-title { font-size: 36px; letter-spacing: -0.02em; margin: 0 0 8px; text-align: center; }
.section-sub { color: var(--text-soft); text-align: center; margin: 0 auto 48px; max-width: 600px; }

/* Steps */
.steps {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
}
.step {
  background: white; padding: 28px; border-radius: var(--radius);
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.step-num {
  width: 36px; height: 36px; border-radius: 8px;
  background: #161513;
  color: var(--accent); display: grid; place-items: center;
  font-weight: 900; margin-bottom: 14px;
}
.step h3 { margin: 0 0 6px; font-size: 18px; }
.step p { color: var(--text-soft); margin: 0; font-size: 15px; }

/* Demo */
.demo-box {
  display: grid; grid-template-columns: 1fr 1.2fr; gap: 24px;
  background: white; padding: 28px; border-radius: var(--radius-lg);
  border: 1px solid var(--border); box-shadow: var(--shadow-md);
}
.demo-controls label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--text-soft); margin: 14px 0 6px;
}
.demo-controls label:first-child { margin-top: 0; }
.demo-controls input,
.demo-controls select,
.demo-controls textarea {
  width: 100%; padding: 11px 12px;
  border: 1px solid var(--border); border-radius: 10px;
  font-family: var(--font); font-size: 14px;
  background: white; color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.demo-controls input:focus,
.demo-controls select:focus,
.demo-controls textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(22,21,19,.18);
}
.demo-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.demo-controls button { margin-top: 20px; }
.demo-note {
  font-size: 12px; color: var(--text-soft); margin-top: 12px; line-height: 1.5;
}

.demo-output {
  background: var(--surface-alt); border-radius: 12px; padding: 22px;
  min-height: 420px; display: flex; flex-direction: column;
}
.placeholder { margin: auto; text-align: center; color: var(--text-soft); }
.placeholder-icon { font-size: 48px; display: block; margin-bottom: 8px; opacity: .5; }

.quote {
  background: white; border-radius: 10px; padding: 22px;
  border: 1px solid var(--border);
}
.quote-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 16px; padding-bottom: 14px; border-bottom: 2px solid var(--text);
}
.quote-head h3 { margin: 0; font-size: 22px; }
.quote-meta { font-size: 12px; color: var(--text-soft); text-align: right; }
.quote-section-title {
  font-size: 12px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-soft); font-weight: 700; margin: 16px 0 8px;
}
.quote-items { list-style: none; padding: 0; margin: 0; }
.quote-items li {
  display: grid; grid-template-columns: 1fr auto auto auto;
  gap: 14px; padding: 10px 0; font-size: 14px;
  border-bottom: 1px dashed var(--border);
}
.quote-items .it-name { font-weight: 500; }
.quote-items .it-qty { color: var(--text-soft); }
.quote-items .it-unit { color: var(--text-soft); }
.quote-items .it-total { font-weight: 600; text-align: right; min-width: 90px; }
.quote-totals {
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border);
  display: grid; gap: 6px;
}
.quote-row { display: flex; justify-content: space-between; font-size: 14px; }
.quote-row.grand { font-size: 20px; font-weight: 800; margin-top: 8px;
  padding-top: 10px; border-top: 1px solid var(--border); }
.quote-terms {
  margin-top: 18px; font-size: 12px; color: var(--text-soft);
  background: var(--surface-alt); padding: 12px; border-radius: 8px;
}
.quote-actions { display: flex; gap: 10px; margin-top: 16px; }

/* Pricing */
.pricing {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
}
.plan {
  background: white; padding: 32px 26px; border-radius: var(--radius-lg);
  border: 1px solid var(--border); position: relative;
  display: flex; flex-direction: column;
}
.plan h3 { margin: 0 0 8px; font-size: 18px; color: var(--text-soft); }
.price { font-size: 40px; font-weight: 800; letter-spacing: -0.02em; }
.price span { font-size: 16px; font-weight: 500; color: var(--text-soft); margin-left: 4px; }
.plan ul { list-style: none; padding: 0; margin: 20px 0 28px; flex: 1; }
.plan li {
  padding: 8px 0; padding-left: 24px; position: relative;
  font-size: 15px; color: var(--text);
}
.plan li::before {
  content: "✓"; color: var(--success); font-weight: 800;
  position: absolute; left: 0;
}
.plan-featured {
  border: 2px solid var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}
.plan-badge {
  position: absolute; top: -12px; right: 20px;
  background: var(--primary); color: white;
  padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700;
}

/* CTA */
.cta { padding: 80px 0; text-align: center; background: #161513; color: white; }
.cta h2 { font-size: 36px; margin: 0 0 24px; letter-spacing: -0.02em; }

/* Footer */
.footer { padding: 32px 0; background: #161513; color: #b3aa9c; }
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.footer p { margin: 0; font-size: 13px; }
.footer-meta { opacity: .7; }

/* Disclaimer */
.disclaimer {
  background: #fff8ec;
  border: 1px solid #f5d792;
  color: #6b4a09;
  padding: 14px 18px;
  border-radius: 12px;
  margin: 0 0 24px;
  display: flex; gap: 12px; align-items: flex-start;
  font-size: 14px; line-height: 1.55;
}
.disclaimer-icon { font-size: 18px; flex-shrink: 0; }
.disclaimer strong { color: #4a3406; }

.demo-buttons { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.demo-buttons .btn { flex: 1; min-width: 130px; }

/* Cliente section */
.cliente-section {
  margin-top: 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-alt);
  padding: 0;
}
.cliente-section summary {
  cursor: pointer;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  list-style: none;
  display: flex; align-items: center;
  user-select: none;
}
.cliente-section summary::-webkit-details-marker { display: none; }
.cliente-section summary::after {
  content: "▾";
  margin-left: auto;
  color: var(--text-soft);
  transition: transform .15s;
}
.cliente-section[open] summary::after { transform: rotate(180deg); }
.cliente-hint { font-weight: 400; color: var(--text-soft); margin-left: 6px; font-size: 12px; }
.cliente-fields {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 0 14px 14px;
}
.cliente-fields > div { display: flex; flex-direction: column; }
.cliente-fields label {
  font-size: 12px; font-weight: 600;
  color: var(--text-soft); margin-bottom: 4px;
}
.cliente-fields input {
  padding: 9px 10px;
  border: 1px solid var(--border); border-radius: 8px;
  font-family: var(--font); font-size: 13px;
  background: white; color: var(--text);
}
.cliente-fields input:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(22,21,19,.14);
}

/* Brand modal specific */
.brand-form { display: flex; flex-direction: column; gap: 16px; }
.brand-logo-row {
  display: flex; gap: 16px; align-items: center;
  padding: 12px; border-radius: 10px;
  background: var(--surface-alt); border: 1px dashed var(--border);
}
.brand-logo-preview {
  width: 80px; height: 80px; border-radius: 10px;
  background: white; border: 1px solid var(--border);
  display: grid; place-items: center;
  overflow: hidden; flex-shrink: 0;
}
.brand-logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.brand-logo-placeholder { font-size: 11px; color: var(--text-soft); text-align: center; padding: 4px; }
.brand-logo-controls { display: flex; gap: 8px; flex-wrap: wrap; }
.brand-logo-controls label { cursor: pointer; }
.brand-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.brand-grid label {
  display: block; font-size: 12px; font-weight: 600;
  color: var(--text-soft); margin-bottom: 4px;
}
.brand-grid input,
.brand-grid select,
.brand-grid textarea {
  width: 100%; padding: 9px 10px;
  border: 1px solid var(--border); border-radius: 8px;
  font-family: var(--font); font-size: 13px;
  background: white; color: var(--text);
}
.brand-grid textarea {
  resize: vertical; min-height: 48px; margin-top: 6px;
}
.brand-grid input:focus,
.brand-grid select:focus,
.brand-grid textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(22,21,19,.14);
}
.brand-profession-hint {
  font-size: 12px; color: var(--text-soft);
  margin: 6px 0 0; line-height: 1.4;
}
.brand-full { grid-column: 1 / -1; }
.brand-checkbox {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px; border-radius: 10px;
  background: var(--surface-alt); border: 1px solid var(--border);
  font-size: 13px; color: var(--text); cursor: pointer;
}
.brand-checkbox input { margin-top: 2px; }

/* Description header with example button */
.description-header {
  display: flex; align-items: center; justify-content: space-between;
  margin: 14px 0 6px;
}
.description-header label {
  margin: 0 !important;
}
.description-actions { display: flex; gap: 4px; align-items: center; }
.btn-text.recording {
  color: #c62828; font-weight: 700;
}
.btn-text.recording::before {
  content: "● ";
  animation: voicepulse 1s ease-in-out infinite;
}
@keyframes voicepulse { 0%,100% { opacity: 1; } 50% { opacity: .25; } }

/* Animazioni leggere */
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes quoteIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.hero-content { animation: fadeUp .6s ease-out both; }
.hero-mock { animation: fadeUp .6s ease-out .15s both; }
.quote { animation: quoteIn .35s ease-out; }

.anim-ready .reveal {
  opacity: 0; transform: translateY(18px);
  transition: opacity .6s ease, transform .6s ease;
}
.anim-ready .reveal.visible { opacity: 1; transform: none; }
.anim-ready .step.reveal:nth-child(2) { transition-delay: .1s; }
.anim-ready .step.reveal:nth-child(3) { transition-delay: .2s; }
.anim-ready .plan.reveal:nth-child(2) { transition-delay: .08s; }
.anim-ready .plan.reveal:nth-child(3) { transition-delay: .16s; }

@media (prefers-reduced-motion: reduce) {
  .hero-content, .hero-mock, .quote { animation: none; }
  .anim-ready .reveal { opacity: 1; transform: none; transition: none; }
}
.btn-text {
  background: transparent; border: none; cursor: pointer;
  color: var(--primary); font-family: var(--font);
  font-size: 13px; font-weight: 600;
  padding: 4px 8px; border-radius: 6px;
  transition: background .15s;
}
.btn-text:hover { background: rgba(245,197,24,.16); }
.btn-text-danger { color: #c62828; }
.btn-text-danger:hover { background: rgba(198,40,40,.08); }

/* Sconto input */
.quote-discount-input {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 10px 14px;
  background: rgba(255, 138, 61, 0.06);
  border: 1px solid rgba(255, 138, 61, 0.20);
  border-radius: 10px;
  margin: 14px 0 12px;
}
.quote-discount-input label {
  font-size: 13px; font-weight: 600; color: var(--text); margin: 0;
}
.discount-wrap {
  display: flex; align-items: center; gap: 4px;
  background: white;
  border: 1px solid var(--border); border-radius: 8px;
  padding: 0 10px;
}
.discount-wrap input {
  border: none; outline: none; background: transparent;
  width: 60px; padding: 6px 0; text-align: right;
  font-family: var(--font); font-size: 14px; font-weight: 600;
}
.discount-suffix { color: var(--text-soft); font-size: 13px; }
.quote-row.discount-row { color: var(--warn); }
.quote-row.discount-row span { font-weight: 500; }

/* History */
.history-item {
  display: grid; grid-template-columns: 1fr auto auto;
  gap: 14px; align-items: center;
  padding: 12px 4px;
  border-bottom: 1px dashed var(--border);
}
.history-item:last-child { border-bottom: none; }
.history-item-main { min-width: 0; }
.history-item-line1 {
  display: flex; align-items: center; gap: 10px;
  font-size: 14px; margin-bottom: 4px;
  flex-wrap: wrap;
}
.history-item-line1 strong { color: var(--text); }
.history-item-cat {
  font-size: 12px; color: var(--text-soft);
  background: var(--surface-alt); padding: 2px 8px; border-radius: 4px;
}
.history-item-line2 {
  font-size: 12px; color: var(--text-soft);
}
.history-item-total {
  font-size: 16px; font-weight: 700; color: var(--text);
  white-space: nowrap;
}
.history-item-actions {
  display: flex; gap: 4px;
}
.history-item-actions .btn-text {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  font-size: 16px; padding: 0;
}
.history-empty {
  text-align: center; padding: 40px 20px; color: var(--text-soft);
}
.history-empty-icon {
  font-size: 48px; display: block; margin-bottom: 12px; opacity: .6;
}

/* Suppliers comparison */
.modal-panel-wide { max-width: 900px; }

.suppliers-managebar {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 16px;
}
.suppliers-chips {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px;
}
.suppliers-empty-hint { font-size: 13px; color: var(--text-soft); font-style: italic; }
.supplier-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: white; border: 1px solid var(--border);
  border-radius: 999px; padding: 5px 6px 5px 12px;
  font-size: 13px; font-weight: 500; color: var(--text);
}
.supplier-chip-remove {
  background: transparent; border: none; cursor: pointer;
  width: 18px; height: 18px; border-radius: 50%;
  color: var(--text-soft); font-size: 16px; line-height: 1; padding: 0;
  display: grid; place-items: center;
}
.supplier-chip-remove:hover { background: #ffe5e5; color: #c62828; }
.supplier-add { display: flex; gap: 8px; flex-wrap: wrap; }
.supplier-add input {
  flex: 1; min-width: 180px; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: 8px;
  font-family: var(--font); font-size: 13px;
}
.supplier-add input:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(22,21,19,.14);
}

.suppliers-placeholder {
  text-align: center; padding: 36px 20px; color: var(--text-soft);
}

.suppliers-table-wrap { overflow-x: auto; }
.suppliers-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
  min-width: 480px;
}
.suppliers-table th {
  text-align: left; padding: 8px 6px;
  font-size: 11px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--text-soft); font-weight: 700;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
.suppliers-table th.sup-col { text-align: right; }
.suppliers-table td {
  padding: 6px; border-bottom: 1px dashed var(--border);
  vertical-align: middle;
}
.suppliers-table input {
  width: 100%; padding: 7px 8px;
  border: 1px solid transparent; border-radius: 6px;
  font-family: var(--font); font-size: 13px; background: transparent;
}
.suppliers-table input:hover { border-color: var(--border); }
.suppliers-table input:focus {
  outline: none; border-color: var(--primary); background: white;
  box-shadow: 0 0 0 2px rgba(22,21,19,.14);
}
.sup-mat-name { min-width: 160px; }
.sup-mat-unit { width: 60px; }
.sup-mat-unit input { text-align: center; }
.sup-price-cell { min-width: 90px; }
.sup-price-wrap {
  display: flex; align-items: center; gap: 2px;
  border-radius: 6px; padding-right: 4px;
}
.sup-price-wrap input { text-align: right; }
.sup-best-badge {
  color: var(--success); font-size: 12px; opacity: 0;
  flex-shrink: 0;
}
.sup-price-cell.best .sup-price-wrap {
  background: rgba(26,165,110,.10);
  border: 1px solid rgba(26,165,110,.35);
}
.sup-price-cell.best .sup-best-badge { opacity: 1; }
.sup-price-cell.best input { color: var(--success); font-weight: 700; }
.sup-saving {
  text-align: right; font-size: 13px; font-weight: 600;
  color: var(--success); white-space: nowrap;
}

.suppliers-summary {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 13px;
}
.summary-line {
  display: flex; gap: 16px; justify-content: space-between;
  color: var(--text-soft);
}
.summary-line strong { color: var(--text); }
.summary-saving strong { color: var(--success); font-size: 15px; }

/* Auth / login */
.nav-user { color:#fff; font-size:14px; font-weight:600; margin-left:22px; }
.nav-user .nu-name { color: var(--accent); }
#nav-auth { display:inline-flex; align-items:center; gap:12px; margin-left:22px; }
.modal-panel-auth { max-width: 420px; }
.auth-head { display:flex; align-items:center; justify-content:space-between; padding:18px 22px 0; }
.auth-logo { display:inline-flex; align-items:center; gap:9px; font-weight:800; font-size:18px; color:var(--text); }
.auth-logo .logo-mark { width:30px; height:30px; }
.auth-tabs { display:flex; gap:6px; padding:14px 22px 0; border-bottom:1px solid var(--border); }
.auth-tab { flex:1; background:transparent; border:none; cursor:pointer; padding:12px 8px; font-family:var(--font); font-size:15px; font-weight:600; color:var(--text-soft); border-bottom:3px solid transparent; margin-bottom:-1px; }
.auth-tab:hover { color:var(--text); }
.auth-tab.active { color:var(--text); border-bottom-color:var(--accent); }
.auth-body { padding:20px 22px 22px; }
.auth-body label { display:block; font-size:13px; font-weight:600; color:var(--text-soft); margin:12px 0 5px; }
.auth-body label:first-child { margin-top:0; }
.auth-body input { width:100%; padding:11px 12px; border:1px solid var(--border); border-radius:10px; font-family:var(--font); font-size:14px; background:#fff; color:var(--text); }
.auth-body input:focus { outline:none; border-color:var(--primary); box-shadow:0 0 0 3px rgba(22,21,19,.14); }
.auth-body #auth-submit { margin-top:18px; }
.auth-error { color:#c62828; font-size:13px; margin:10px 0 0; min-height:1px; }
.auth-switch { text-align:center; font-size:13px; color:var(--text-soft); margin-top:14px; }
.auth-switch a { color:var(--text); font-weight:600; cursor:pointer; text-decoration:underline; }
.auth-note { text-align:center; font-size:12px; color:var(--text-soft); margin-top:14px; line-height:1.5; }

/* Toast */
.toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(120%);
  background: var(--text);
  color: white;
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 200; opacity: 0;
  transition: transform .25s ease-out, opacity .25s ease-out;
  pointer-events: none;
  max-width: 90%;
}
.toast.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
.toast.success { background: var(--success); }
.toast.error { background: #c62828; }

/* Button loading */
.btn-loading {
  pointer-events: none; opacity: 0.8;
  position: relative; color: transparent !important;
}
.btn-loading::after {
  content: "";
  position: absolute; top: 50%; left: 50%;
  width: 16px; height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.btn-ghost.btn-loading::after {
  border-color: rgba(14,19,38,.15);
  border-top-color: var(--text);
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Brand block in generated quote */
.quote-brand {
  display: flex; gap: 14px; align-items: flex-start;
  padding-bottom: 14px; margin-bottom: 14px;
  border-bottom: 2px solid var(--text);
}
.quote-brand-logo {
  width: 64px; height: 64px; border-radius: 8px;
  overflow: hidden; flex-shrink: 0;
  background: var(--surface-alt);
  display: grid; place-items: center;
}
.quote-brand-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.quote-brand-info { flex: 1; min-width: 0; }
.quote-brand-info h4 { margin: 0 0 4px; font-size: 16px; }
.quote-brand-info p { margin: 0; font-size: 12px; color: var(--text-soft); line-height: 1.5; }
.quote-cliente {
  background: var(--surface-alt);
  padding: 10px 12px; border-radius: 8px;
  margin-bottom: 14px; font-size: 13px;
}
.quote-cliente strong { color: var(--text-soft); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; display: block; margin-bottom: 2px; }

/* Editable quote items */
.quote-items.editable li {
  grid-template-columns: 1fr 70px 90px 100px 28px;
  gap: 8px; align-items: center; padding: 6px 0;
}
.quote-items.editable input {
  width: 100%; padding: 6px 8px;
  border: 1px solid transparent; border-radius: 6px;
  font-size: 13px; font-family: var(--font); background: transparent;
  transition: border-color .15s, background .15s;
}
.quote-items.editable .combobox-input { padding-right: 22px; }
.quote-items.editable input:hover { border-color: var(--border); }
.quote-items.editable input:focus {
  outline: none; border-color: var(--primary);
  background: white; box-shadow: 0 0 0 2px rgba(22,21,19,.14);
}
.quote-items.editable .it-total {
  font-weight: 600; text-align: right; font-size: 13px;
  padding-right: 4px;
}
.quote-items.editable .it-qty input { text-align: right; }
.quote-items.editable .it-unit input { text-align: right; }
/* Combobox (selectable dropdown on line item name) */
.combobox { position: relative; display: flex; align-items: center; }
.combobox-input { flex: 1; min-width: 0; }
.combobox-toggle {
  position: absolute; right: 2px; top: 50%; transform: translateY(-50%);
  background: transparent; border: none; cursor: pointer;
  color: var(--text-soft); font-size: 11px; line-height: 1;
  padding: 4px 5px; border-radius: 4px;
}
.combobox-toggle:hover { background: var(--surface-alt); color: var(--text); }
.combobox.open .combobox-toggle { transform: translateY(-50%) rotate(180deg); }
.combobox-list {
  position: absolute; top: calc(100% + 2px); left: 0;
  z-index: 40; margin: 0; padding: 4px;
  min-width: 280px; max-width: 360px; max-height: 260px; overflow-y: auto;
  list-style: none; background: white;
  border: 1px solid var(--border); border-radius: 10px;
  box-shadow: var(--shadow-lg);
}
.combobox-option {
  padding: 8px 10px; border-radius: 6px; cursor: pointer;
  display: flex; flex-direction: column; gap: 2px;
}
.combobox-option:hover { background: rgba(245,197,24,.16); }
.co-name { font-size: 13px; font-weight: 500; color: var(--text); }
.co-meta { font-size: 11px; color: var(--text-soft); }
.combobox-empty { padding: 8px 10px; font-size: 12px; color: var(--text-soft); font-style: italic; }

.row-remove {
  background: transparent; border: none; color: var(--text-soft);
  width: 24px; height: 24px; border-radius: 6px; cursor: pointer;
  font-size: 18px; line-height: 1; padding: 0;
  transition: background .15s, color .15s;
}
.row-remove:hover { background: #ffe5e5; color: #c62828; }

.add-row {
  margin-top: 10px; width: 100%;
  background: transparent; border: 1px dashed var(--border);
  color: var(--text-soft); padding: 10px;
  border-radius: 8px; cursor: pointer;
  font-family: var(--font); font-size: 13px; font-weight: 500;
  transition: border-color .15s, color .15s, background .15s;
}
.add-row:hover { border-color: var(--primary); color: var(--primary); background: rgba(245,197,24,.10); }

.quote-disclaimer {
  margin-top: 14px; font-size: 11px; color: #92723d;
  background: #fff8ec; padding: 8px 10px; border-radius: 6px;
  border-left: 3px solid #f5b942;
}

.quote-payment {
  margin-top: 12px;
  padding: 12px 14px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.quote-payment label {
  display: block; margin-bottom: 6px;
  font-size: 13px; color: var(--text);
}
.quote-payment textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border); border-radius: 8px;
  font-family: var(--font); font-size: 13px;
  resize: vertical; background: white; color: var(--text);
  min-height: 50px;
}
.quote-payment textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(22,21,19,.14);
}

/* Market analysis */
.market-analysis-section {
  margin-top: 14px;
  padding: 14px;
  border: 2px solid var(--primary);
  border-radius: 12px;
  background: rgba(245,197,24,.07);
}
.market-analysis-section h4 {
  margin: 0 0 12px; font-size: 15px; color: var(--primary);
}
.market-demo-banner {
  background: #fff8ec; border: 1px solid #f5d792; color: #6b4a09;
  padding: 8px 10px; border-radius: 8px; font-size: 12px;
  line-height: 1.5; margin-bottom: 12px;
}
.market-source {
  font-size: 12px; color: var(--text-soft); margin-bottom: 10px;
}
.market-source-note { font-size: 11px; opacity: .85; }
.market-empty {
  font-size: 13px; color: var(--text-soft); font-style: italic;
}
.market-table-wrap { overflow-x: auto; }
.market-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
  min-width: 420px;
}
.market-table th {
  text-align: left; padding: 7px 6px;
  font-size: 11px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--text-soft); font-weight: 700;
  border-bottom: 2px solid var(--border);
}
.market-table th.ma-num, .market-table td.ma-num { text-align: right; white-space: nowrap; }
.market-table td {
  padding: 8px 6px; border-bottom: 1px dashed var(--border);
}
.market-table .ma-name { font-weight: 500; }
.market-table .ma-unit { color: var(--text-soft); font-size: 11px; font-weight: 400; }
.ma-delta { font-weight: 600; white-space: nowrap; font-size: 12px; }
.ma-delta.under { color: var(--warn); }
.ma-delta.over { color: #c62828; }
.ma-delta.inline { color: var(--success); }

.market-verdict {
  margin-top: 12px; padding: 10px 12px; border-radius: 8px;
  font-size: 13px; line-height: 1.5;
}
.market-verdict.under { background: rgba(255,138,61,.10); border: 1px solid rgba(255,138,61,.30); }
.market-verdict.over { background: #ffe5e5; border: 1px solid #ffcccc; }
.market-verdict.inline { background: rgba(26,165,110,.10); border: 1px solid rgba(26,165,110,.30); }
.market-note {
  margin: 10px 0 0; font-size: 11px; color: var(--text-soft); line-height: 1.5;
}

.editable-hint {
  background: rgba(245,197,24,.16); color: var(--primary);
  padding: 8px 12px; border-radius: 8px; font-size: 12px;
  margin-bottom: 12px; display: flex; align-items: center; gap: 8px;
}

/* Modal */
.modal {
  position: fixed; inset: 0; z-index: 100;
  display: none; align-items: center; justify-content: center;
  padding: 20px;
}
.modal.open { display: flex; }
.modal-overlay {
  position: absolute; inset: 0;
  background: rgba(14,19,38,.55);
  backdrop-filter: blur(4px);
}
.modal-panel {
  position: relative;
  background: white; border-radius: var(--radius-lg);
  width: 100%; max-width: 720px; max-height: 88vh;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: modalIn .2s ease-out;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 16px; padding: 22px 24px 16px; border-bottom: 1px solid var(--border);
}
.modal-header h3 { margin: 0 0 4px; font-size: 20px; }
.modal-sub { margin: 0; font-size: 13px; color: var(--text-soft); line-height: 1.5; }
.modal-close {
  background: transparent; border: none; cursor: pointer;
  font-size: 28px; line-height: 1; color: var(--text-soft);
  width: 32px; height: 32px; border-radius: 8px;
  padding: 0; transition: background .15s, color .15s;
}
.modal-close:hover { background: var(--surface-alt); color: var(--text); }
.modal-body {
  padding: 16px 24px; overflow-y: auto; flex: 1;
}
.modal-footer {
  padding: 16px 24px; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  background: var(--surface-alt); border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  flex-wrap: wrap; gap: 10px;
}
.modal-footer-actions { display: flex; gap: 10px; }

/* Listino editor */
.listino-tabs {
  display: flex; gap: 4px; flex-wrap: wrap;
  margin-bottom: 16px; border-bottom: 1px solid var(--border);
  padding-bottom: 4px;
}
.listino-tab {
  background: transparent; border: none; cursor: pointer;
  padding: 8px 14px; border-radius: 8px 8px 0 0;
  font-family: var(--font); font-size: 13px; font-weight: 500;
  color: var(--text-soft); border-bottom: 2px solid transparent;
  margin-bottom: -1px; transition: color .15s, border-color .15s;
}
.listino-tab:hover { color: var(--text); }
.listino-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

.listino-item {
  display: grid; grid-template-columns: 1fr 90px 140px 32px;
  gap: 10px; align-items: center;
  padding: 10px 0; border-bottom: 1px dashed var(--border);
}
.listino-item:last-child { border-bottom: none; }
.listino-item-name { font-size: 14px; }
.listino-item-unit { font-size: 12px; color: var(--text-soft); text-align: center; }

.listino-item-labor {
  background: var(--surface-alt);
  margin: 0 -10px 10px;
  padding: 12px 10px;
  border-radius: 8px;
  border-bottom: none;
}
.listino-item-hidden { opacity: 0.45; }
.listino-item-custom {
  background: rgba(245,197,24,.10);
  border: 1px solid rgba(245,197,24,.20);
  border-radius: 8px;
  padding: 10px;
  margin: 6px -4px;
  border-bottom: 1px solid rgba(245,197,24,.20);
}
.listino-item-custom input[type="text"] {
  border: 1px solid var(--border); border-radius: 6px;
  padding: 7px 9px; font-size: 13px; font-family: var(--font);
  width: 100%; background: white; color: var(--text);
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.listino-item-custom input[type="text"]:focus {
  border-color: var(--primary); box-shadow: 0 0 0 2px rgba(22,21,19,.14);
}

.listino-action {
  background: transparent; border: 1px solid var(--border);
  border-radius: 6px; cursor: pointer; padding: 0;
  width: 30px; height: 30px;
  font-size: 14px; line-height: 1; color: var(--text-soft);
  display: grid; place-items: center;
  transition: background .15s, color .15s, border-color .15s;
}
.listino-action:hover { background: var(--surface-alt); }
.listino-action.hide:hover { background: #ffe5e5; color: #c62828; border-color: #ffcccc; }
.listino-action.delete:hover { background: #ffe5e5; color: #c62828; border-color: #ffcccc; }
.listino-action.restore { color: var(--success); border-color: #b5e3c8; }
.listino-action.restore:hover { background: #e8f7ef; }

.listino-section-divider {
  margin: 22px 0 10px;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-soft); font-weight: 700;
  padding-top: 16px; border-top: 1px solid var(--border);
}
.listino-empty {
  color: var(--text-soft); font-size: 13px; font-style: italic;
  margin: 8px 0; padding: 8px 4px;
}
.listino-price-wrap {
  display: flex; align-items: center; gap: 4px;
  border: 1px solid var(--border); border-radius: 8px;
  background: white; padding: 0 8px;
}
.listino-price-wrap input {
  border: none; outline: none; background: transparent;
  width: 100%; padding: 8px 0; text-align: right;
  font-family: var(--font); font-size: 14px;
}
.listino-price-wrap input.overridden { color: var(--primary); font-weight: 600; }
.listino-price-wrap .currency { color: var(--text-soft); font-size: 13px; }
.listino-price-default {
  display: block; font-size: 11px; color: var(--text-soft);
  text-align: right; margin-top: 2px;
}

/* Responsive */
@media (max-width: 920px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 36px; }
  .steps { grid-template-columns: 1fr; }
  .demo-box { grid-template-columns: 1fr; }
  .pricing { grid-template-columns: 1fr; }
  .plan-featured { transform: none; }
  nav a:not(.btn) { display: none; }
  .demo-buttons { flex-direction: column; }
  .quote-items.editable li { grid-template-columns: 1fr 60px 80px 80px 24px; }
  .listino-item { grid-template-columns: 1fr 110px 30px; gap: 8px; }
  .listino-item-unit { display: none; }
  .listino-item-custom { grid-template-columns: 1fr 70px 110px 30px; }
  .cliente-fields { grid-template-columns: 1fr; }
  .brand-grid { grid-template-columns: 1fr; }
  .quote-brand { flex-direction: column; align-items: stretch; }
  .quote-discount-input { flex-direction: column; align-items: stretch; }
  .history-item { grid-template-columns: 1fr auto; gap: 8px; }
  .history-item-actions { grid-column: 1 / -1; justify-content: flex-end; }
}
