/* ============================================================
   onoriamo — sistema di brand
   Principi: calma, chiarezza, dignità. Parla al Sistema 1.
   ============================================================ */

:root {
  /* Palette "quieta" — neutri caldi + accento naturale sobrio */
  --bg:           #F6F2EA;   /* avorio caldo, sfondo */
  --surface:      #FFFFFF;
  --surface-warm: #FCF9F3;
  --ink:          #2A2925;   /* near-black caldo, mai nero pieno */
  --ink-soft:     #57534B;   /* testo secondario */
  --muted:        #8A8479;   /* testo terziario */
  --line:         #E7E0D3;   /* filetti */
  --accent:       #3F5A4E;   /* verde profondo attenuato */
  --accent-soft:  #6E8478;
  --accent-bg:    #EAF0EC;   /* tinta verde tenuissima */
  --sand:         #C2A07A;   /* accento caldo, usato con parsimonia */
  --sand-bg:      #F3EBDF;

  /* Ombre morbide e diffuse, mai dure */
  --shadow-sm: 0 1px 2px rgba(42,41,37,.04), 0 4px 14px rgba(42,41,37,.05);
  --shadow:    0 1px 2px rgba(42,41,37,.04), 0 12px 34px rgba(42,41,37,.07);

  --radius:    18px;
  --radius-sm: 11px;
  --radius-pill: 999px;

  /* Transizioni lente e morbide — nessun rimbalzo */
  --ease: cubic-bezier(.22,.61,.36,1);
  --t:    .42s var(--ease);

  --maxw: 1080px;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Tipografia ---------------------------------------------------- */
h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: 460;
  line-height: 1.12;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 .5em;
}
h1 { font-size: clamp(2.1rem, 1.4rem + 3vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.2rem); }
h3 { font-size: 1.22rem; font-weight: 500; }
p  { margin: 0 0 1.1em; color: var(--ink-soft); }
a  { color: var(--accent); text-decoration: none; }

.eyebrow {
  font-size: .82rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent-soft);
  font-weight: 600;
  margin: 0 0 1.1em;
}
.lead { font-size: 1.2rem; color: var(--ink-soft); max-width: 36ch; }
.muted { color: var(--muted); }

/* Layout -------------------------------------------------------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.section { padding: clamp(56px, 8vw, 104px) 0; }

/* Brand mark ---------------------------------------------------- */
.brand { display: inline-flex; align-items: center; gap: .55rem; }
.brand__mark { width: 26px; height: 26px; flex: none; color: var(--accent); }
.brand__name {
  font-family: var(--font-display);
  font-size: 1.36rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
}

/* Header -------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--t), background var(--t);
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 74px; gap: 1rem;
}
.site-nav { display: flex; align-items: center; gap: 1.6rem; }
.site-nav a.navlink { color: var(--ink-soft); font-size: .96rem; font-weight: 500; }
.site-nav a.navlink:hover { color: var(--ink); }

/* Pulsante "parla con una persona" — sempre presente */
.human-link {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .58rem .95rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--ink) !important;
  font-size: .92rem; font-weight: 500; white-space: nowrap;
  box-shadow: var(--shadow-sm);
  transition: transform var(--t), box-shadow var(--t), border-color var(--t);
}
.human-link:hover { transform: translateY(-1px); box-shadow: var(--shadow); border-color: var(--accent-soft); }
.human-link .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }

@media (max-width: 720px) {
  .site-nav .navlink { display: none; }
}

/* Bottoni ------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  font-family: var(--font-body); font-size: 1.02rem; font-weight: 500;
  padding: .92rem 1.6rem;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform var(--t), box-shadow var(--t), background var(--t), border-color var(--t);
}
.btn--primary { background: var(--accent); color: #fff; box-shadow: var(--shadow-sm); }
.btn--primary:hover { transform: translateY(-1px); box-shadow: var(--shadow); background: #375044; }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--accent-soft); background: var(--surface-warm); }
.btn--lg { font-size: 1.08rem; padding: 1.05rem 1.9rem; }

/* Hero ---------------------------------------------------------- */
.hero { position: relative; overflow: hidden; padding-top: clamp(48px, 7vw, 88px); }
.hero__glow {
  position: absolute; inset: -20% -10% auto -10%; height: 70%;
  background:
    radial-gradient(60% 80% at 78% 20%, rgba(194,160,122,.20), transparent 60%),
    radial-gradient(70% 90% at 18% 0%, rgba(63,90,78,.16), transparent 62%);
  filter: blur(8px); z-index: 0; pointer-events: none;
}
.hero .wrap { position: relative; z-index: 1; }
.hero__grid {
  display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(28px, 5vw, 72px);
  align-items: center;
}
.hero__cta { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.6rem; }
.hero__reassure {
  display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; margin-top: 1.5rem;
  font-size: .94rem; color: var(--muted);
}
.hero__reassure span { display: inline-flex; align-items: center; gap: .45rem; }
.hero__reassure svg { color: var(--accent-soft); }

.hero__art {
  position: relative; aspect-ratio: 1 / 1; border-radius: 28px;
  background: linear-gradient(160deg, var(--accent-bg), var(--sand-bg));
  box-shadow: var(--shadow); overflow: hidden;
  display: grid; place-items: center;
}
.hero__art svg { width: 64%; height: 64%; opacity: .9; }
@media (max-width: 860px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__art { display: none; }
}

/* Strisce / sezioni con superficie ------------------------------ */
.panel { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-sm); }

/* Come funziona ------------------------------------------------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 2.4rem; }
.step {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 30px 26px;
  transition: transform var(--t), box-shadow var(--t);
}
.step:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.step__n {
  font-family: var(--font-display); font-size: 1.05rem; color: var(--accent);
  width: 38px; height: 38px; border-radius: 50%; background: var(--accent-bg);
  display: grid; place-items: center; margin-bottom: 1.1rem;
}
.step h3 { margin-bottom: .35rem; }
.step p { margin: 0; font-size: .98rem; }
@media (max-width: 800px) { .steps { grid-template-columns: 1fr; } }

/* Valori / fiducia ---------------------------------------------- */
.values { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px 40px; margin-top: 2rem; }
.value { display: flex; gap: 1rem; align-items: flex-start; }
.value__icon {
  flex: none; width: 44px; height: 44px; border-radius: 12px;
  background: var(--accent-bg); color: var(--accent);
  display: grid; place-items: center;
}
.value h3 { margin: .1rem 0 .25rem; font-size: 1.06rem; }
.value p { margin: 0; font-size: .96rem; }
@media (max-width: 720px) { .values { grid-template-columns: 1fr; } }

/* Citazione / promessa ------------------------------------------ */
.promise {
  background: var(--accent); color: #fff;
  border-radius: 26px; padding: clamp(40px, 6vw, 72px);
  text-align: center;
}
.promise p { color: rgba(255,255,255,.92); }
.promise .display {
  color: #fff; font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.3rem);
  max-width: 22ch; margin: 0 auto; font-weight: 400;
}

/* CTA finale ---------------------------------------------------- */
.cta-final { text-align: center; }
.cta-final .hero__cta { justify-content: center; }

/* Footer -------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--line); padding: 56px 0 40px; color: var(--muted); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 28px; }
.site-footer h4 { font-size: .82rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); margin: 0 0 1rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: .6rem; }
.site-footer a { color: var(--ink-soft); font-size: .95rem; }
.site-footer a:hover { color: var(--ink); }
.footer-note { margin-top: 36px; padding-top: 22px; border-top: 1px solid var(--line); font-size: .86rem; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } }

/* ============================================================
   CHAT — intake empatico (at-need)
   ============================================================ */
.chat-page { min-height: 100vh; display: flex; flex-direction: column; }
.chat-shell { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 22px 16px 0; }
.chat-card {
  width: 100%; max-width: 720px; flex: 1;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius) var(--radius) 0 0;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; overflow: hidden;
}

/* Barra di avanzamento — calma, non assillante */
.chat-progress { height: 3px; background: var(--line); }
.chat-progress__bar { height: 100%; width: 0; background: var(--accent-soft); transition: width .8s var(--ease); }

.chat-intro { padding: 20px 26px 6px; }
.chat-intro h2 { font-size: 1.18rem; margin: 0 0 .15rem; }
.chat-intro p { font-size: .92rem; color: var(--muted); margin: 0; }

/* Stream messaggi */
.chat-stream { flex: 1; overflow-y: auto; padding: 18px 26px 8px; scroll-behavior: smooth; }
.msg { display: flex; gap: .7rem; margin-bottom: 14px; max-width: 86%; }
.msg__avatar {
  flex: none; width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent-bg); color: var(--accent);
  display: grid; place-items: center; margin-top: 2px;
}
.msg__bubble {
  background: var(--surface-warm); border: 1px solid var(--line);
  border-radius: 4px 16px 16px 16px; padding: 12px 15px;
  font-size: 1rem; line-height: 1.55; color: var(--ink);
}
.msg--user { margin-left: auto; flex-direction: row-reverse; }
.msg--user .msg__bubble {
  background: var(--accent); color: #fff; border-color: transparent;
  border-radius: 16px 4px 16px 16px;
}
.msg.enter { animation: msgIn .5s var(--ease) both; }
@keyframes msgIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Indicatore "sta scrivendo" */
.typing { display: inline-flex; gap: 5px; padding: 14px 16px; }
.typing span {
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent-soft);
  animation: blink 1.3s var(--ease) infinite; opacity: .4;
}
.typing span:nth-child(2) { animation-delay: .18s; }
.typing span:nth-child(3) { animation-delay: .36s; }
@keyframes blink { 0%,60%,100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }

/* Zona di risposta */
.chat-foot { border-top: 1px solid var(--line); background: var(--surface); padding: 14px 22px 18px; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .7rem; }
.chip {
  font-family: var(--font-body); font-size: .95rem; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line);
  padding: .55rem 1rem; border-radius: var(--radius-pill); cursor: pointer;
  transition: transform var(--t), border-color var(--t), background var(--t);
}
.chip:hover { transform: translateY(-1px); border-color: var(--accent-soft); background: var(--accent-bg); }
.chip--soft { color: var(--accent); border-style: dashed; }

.chat-input { display: flex; gap: .6rem; align-items: flex-end; }
.chat-input textarea {
  flex: 1; resize: none; font-family: var(--font-body); font-size: 1rem; color: var(--ink);
  background: var(--surface-warm); border: 1px solid var(--line); border-radius: 14px;
  padding: .8rem 1rem; line-height: 1.5; max-height: 120px; outline: none;
  transition: border-color var(--t), background var(--t);
}
.chat-input textarea:focus { border-color: var(--accent-soft); background: var(--surface); }
.send-btn {
  flex: none; width: 46px; height: 46px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--accent); color: #fff; display: grid; place-items: center;
  transition: transform var(--t), background var(--t), opacity var(--t);
}
.send-btn:hover { transform: translateY(-1px); background: #375044; }
.send-btn:disabled { opacity: .4; cursor: default; transform: none; }
.chat-hint { text-align: center; font-size: .82rem; color: var(--muted); margin: .7rem 0 0; }

/* Riepilogo finale */
.summary { background: var(--accent-bg); border: 1px solid #d8e2db; border-radius: var(--radius-sm); padding: 14px 16px; margin-top: 4px; }
.summary h4 { margin: 0 0 .5rem; font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.summary dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: .3rem .9rem; font-size: .95rem; }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; color: var(--ink); }

/* ============================================================
   PREVENTIVI — le tre proposte (il confronto come sollievo)
   ============================================================ */
.chip--primary { background: var(--accent); color: #fff; border-color: transparent; }
.chip--primary:hover { background: #375044; border-color: transparent; }

.results { padding: clamp(28px, 5vw, 56px) 0 72px; }
.results__head { max-width: 640px; margin-bottom: 2rem; }
.results__head h1 { font-size: clamp(1.8rem, 1.3rem + 2vw, 2.6rem); margin-bottom: .4rem; }
.results__head p { margin: 0; color: var(--ink-soft); }
.results__loading, .results__error { color: var(--muted); padding: 2rem 0; }

.quotes-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: start; }
@media (max-width: 920px) { .quotes-grid { grid-template-columns: 1fr; } }

.quote {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  padding: 26px 24px; transition: transform var(--t), box-shadow var(--t);
}
.quote:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

.quote__tag {
  align-self: flex-start; font-size: .76rem; letter-spacing: .1em; text-transform: uppercase;
  font-weight: 600; color: var(--accent); background: var(--accent-bg);
  padding: .35rem .7rem; border-radius: var(--radius-pill); margin-bottom: .9rem;
}
.quote__name { font-family: var(--font-display); font-size: 1.2rem; font-weight: 500; margin: 0 0 .35rem; }
.quote__meta { display: flex; flex-wrap: wrap; gap: .35rem .8rem; font-size: .9rem; color: var(--muted); margin-bottom: .9rem; }
.quote__meta .verify { display: inline-flex; align-items: center; gap: .3rem; color: var(--accent-soft); }
.quote__nota { font-size: .95rem; color: var(--ink-soft); margin: 0 0 1.1rem; }

.voci { list-style: none; margin: 0 0 1rem; padding: 0; }
.voce { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem 0; border-bottom: 1px solid var(--line); font-size: .95rem; }
.voce:last-child { border-bottom: none; }
.voce__label { color: var(--ink-soft); }
.voce__price { color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }

.quote__total { display: flex; align-items: baseline; justify-content: space-between; margin-top: .4rem; padding-top: .9rem; border-top: 2px solid var(--line); }
.quote__total .lbl { font-size: .9rem; color: var(--muted); }
.quote__total .amt { font-family: var(--font-display); font-size: 1.5rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.quote__budget { display: inline-flex; align-items: center; gap: .4rem; font-size: .86rem; color: var(--accent); margin-top: .7rem; }
.quote__excl { font-size: .8rem; color: var(--muted); margin: .8rem 0 1.2rem; line-height: 1.45; }
.quote .btn { margin-top: auto; width: 100%; }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.quote--chosen { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset, var(--shadow); }
.quote__chosen { margin-top: auto; display: flex; align-items: center; gap: .45rem; color: var(--accent); font-size: .95rem; line-height: 1.4; }

/* ===== Console imprese / ops ===== */
.ops { padding: clamp(28px, 5vw, 56px) 0 72px; }
.ops__head { max-width: 680px; margin-bottom: 1.6rem; }
.ops__head h1 { font-size: clamp(1.7rem, 1.3rem + 1.6vw, 2.3rem); margin-bottom: .3rem; }
.ops__note { background: var(--sand-bg); border: 1px solid #e7d9c4; border-radius: var(--radius-sm); padding: .7rem 1rem; font-size: .86rem; color: var(--ink-soft); margin-top: .9rem; }
.ops__list { display: flex; flex-direction: column; gap: 16px; }
.ops__card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 20px 22px; }
.ops__top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .6rem; }
.ops__badge { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 600; padding: .32rem .65rem; border-radius: var(--radius-pill); white-space: nowrap; }
.ops__badge--attesa { background: var(--sand-bg); color: #9a6b3a; }
.ops__badge--scelta { background: var(--accent-bg); color: var(--accent); }
.ops__meta { font-size: .82rem; color: var(--muted); text-align: right; }
.ops__ctx { color: var(--ink); margin: .1rem 0 .4rem; }
.ops__contatto { font-size: .92rem; color: var(--ink-soft); margin: 0 0 .8rem; }
.ops__quotes { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.ops__quote { display: flex; justify-content: space-between; gap: 1rem; padding: .5rem 0; font-size: .92rem; color: var(--ink-soft); border-bottom: 1px solid var(--line); }
.ops__quote:last-child { border-bottom: none; }
.ops__quote--chosen { color: var(--accent); font-weight: 500; }
.ops__total-row { font-weight: 500; color: var(--ink); border-top: 2px solid var(--line); }

/* ===== Portale: login + conferma ===== */
.auth-form { max-width: 380px; display: flex; flex-direction: column; gap: 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 26px 24px; }
.auth-form label { display: flex; flex-direction: column; gap: .35rem; font-size: .9rem; color: var(--ink-soft); }
.auth-form input { font-family: var(--font-body); font-size: 1rem; color: var(--ink); background: var(--surface-warm); border: 1px solid var(--line); border-radius: 12px; padding: .7rem .9rem; outline: none; transition: border-color var(--t), background var(--t); }
.auth-form input:focus { border-color: var(--accent-soft); background: var(--surface); }
.auth-error { margin: 0; color: #9a4a3a; font-size: .9rem; }

.conferma { display: flex; align-items: flex-end; gap: .8rem; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); flex-wrap: wrap; }
.conferma__label { display: flex; flex-direction: column; gap: .3rem; font-size: .85rem; color: var(--muted); }
.conferma__input { width: 130px; font-family: var(--font-body); font-size: 1rem; color: var(--ink); background: var(--surface-warm); border: 1px solid var(--line); border-radius: 10px; padding: .55rem .7rem; outline: none; font-variant-numeric: tabular-nums; }
.conferma__input:focus { border-color: var(--accent-soft); background: var(--surface); }
.conferma .btn { flex: 0 0 auto; }

/* ===== Finestra modale (login / candidatura) ===== */
.modal[hidden] { display: none; }
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; }
.modal__overlay { position: absolute; inset: 0; background: rgba(42, 41, 37, .45); backdrop-filter: blur(2px); }
.modal__dialog { position: relative; z-index: 1; width: 100%; max-width: 420px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px 26px; max-height: 92vh; overflow: auto; animation: msgIn .3s var(--ease) both; }
.modal__close { position: absolute; top: 10px; right: 14px; border: none; background: none; font-size: 1.7rem; line-height: 1; color: var(--muted); cursor: pointer; padding: .2rem .4rem; }
.modal__close:hover { color: var(--ink); }
.modal__tabs { display: flex; gap: .5rem; margin-bottom: 1.3rem; }
.modal__tab { flex: 1; padding: .6rem .5rem; border: 1px solid var(--line); background: var(--surface-warm); border-radius: var(--radius-pill); font-family: var(--font-body); font-size: .9rem; cursor: pointer; color: var(--ink-soft); transition: background var(--t), color var(--t), border-color var(--t); }
.modal__tab.is-active { background: var(--accent); color: #fff; border-color: transparent; }
.modal__panel { box-shadow: none; border: none; padding: 0; max-width: none; }
.modal__panel[hidden] { display: none; } /* batte .auth-form{display:flex} */
.auth-success { color: var(--accent); font-size: .95rem; margin: 0; line-height: 1.5; }


/* Animazione d'ingresso lieve ----------------------------------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}
