/* ============================================================
   POSTE CLONE — shared styles (agentic-ai.html + poste/*.html)
   Mimics an Italian postal-service portal. Own identity; links the
   design system only for the persistent back-to-homepage button.
   ============================================================ */

:root {
  --yellow:    #ffcc00;
  --yellow-dk: #f2b705;
  --navy:      #0a1a5c;
  --navy-2:    #12277a;
  --ink:       #1f2430;
  --muted:     #5b6472;
  --line:      #e4e7ee;
  --bg-soft:   #f4f6fb;
  --white:     #ffffff;
  --radius:    14px;
  --shadow:    0 6px 26px rgba(16, 26, 64, 0.08);
  --sans:      "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  --hdr-h:     66px;
}

* , *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--white); color: var(--ink);
  font-family: var(--sans); font-size: 16px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; color: var(--navy); }
.container { max-width: 1200px; margin: 0 auto; padding: 0 clamp(1rem, 3vw, 2rem); }

/* ── Top utility bar ── */
.util {
  background: var(--navy); color: #dfe4f5; font-size: 0.78rem;
}
.util .container { display: flex; justify-content: flex-end; gap: 1.4rem; height: 34px; align-items: center; }
.util a { display: inline-flex; align-items: center; gap: 0.35rem; opacity: 0.9; }
.util a:hover { opacity: 1; text-decoration: underline; }
@media (max-width: 720px) { .util .container { justify-content: center; gap: 1rem; } }

/* ── SPA views ── */
.view { display: none; }
.view.is-active { display: block; }

/* ── Header ── (offset below the studio top bar) */
.phdr { position: sticky; top: var(--is-topbar-h, 0px); z-index: 700; background: var(--white); box-shadow: 0 1px 0 var(--line); }
.phdr__row { display: flex; align-items: center; gap: 1.4rem; height: var(--hdr-h); }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; margin-right: 0.6rem; }
.brand__mark {
  width: 38px; height: 38px; border-radius: 9px; background: var(--yellow);
  display: grid; place-items: center; color: var(--navy); font-weight: 800; font-size: 1.15rem;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,0.06);
}
.brand__name { font-weight: 800; letter-spacing: 0.01em; color: var(--navy); font-size: 1.3rem; }
.phdr__nav { display: flex; gap: 1.5rem; margin-left: 0.5rem; flex: 1; }
.phdr__nav a {
  font-size: 0.92rem; font-weight: 600; color: var(--ink); padding: 0.4rem 0;
  border-bottom: 2px solid transparent; white-space: nowrap;
}
.phdr__nav a:hover { color: var(--navy); }
.phdr__nav a.is-active { color: var(--navy); border-bottom-color: var(--yellow); }
.phdr__actions { display: flex; align-items: center; gap: 0.8rem; margin-left: auto; }
.icon-btn { background: none; border: 0; padding: 0.4rem; color: var(--navy); display: inline-grid; place-items: center; }
.icon-btn svg { width: 22px; height: 22px; }
.btn-login {
  background: var(--yellow); color: var(--navy); border: 0; border-radius: 100px;
  padding: 0.55rem 1.2rem; font-weight: 700; font-size: 0.85rem;
  display: inline-flex; align-items: center; gap: 0.45rem; transition: background 0.15s;
}
.btn-login:hover { background: var(--yellow-dk); }
.phdr__burger { display: none; }
@media (max-width: 900px) {
  .phdr__nav { display: none; }
  .phdr__burger { display: inline-grid; }
}

/* ── Buttons ── */
.btn { display: inline-flex; align-items: center; gap: 0.5rem; border-radius: 100px;
  padding: 0.8rem 1.5rem; font-weight: 700; font-size: 0.9rem; border: 1px solid transparent; transition: 0.15s; }
.btn--primary { background: var(--navy); color: #fff; }
.btn--primary:hover { background: var(--navy-2); }
.btn--yellow { background: var(--yellow); color: var(--navy); }
.btn--yellow:hover { background: var(--yellow-dk); }
.btn--ghost { background: #fff; color: var(--navy); border-color: var(--navy); }
.btn--ghost:hover { background: var(--bg-soft); }

/* ── Hero ── */
.hero { background: linear-gradient(120deg, var(--navy) 0%, var(--navy-2) 100%); color: #fff; }
.hero .container { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 2rem; align-items: center;
  padding-top: clamp(2.4rem, 6vw, 4.5rem); padding-bottom: clamp(2.4rem, 6vw, 4.5rem); }
@media (max-width: 820px) { .hero .container { grid-template-columns: 1fr; } }
.hero .eyebrow { color: var(--yellow); font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; font-size: 0.72rem; }
.hero h1 { color: #fff; font-size: clamp(1.9rem, 4vw, 3rem); margin: 0.8rem 0; }
.hero p { color: #c8d0ee; font-size: 1.05rem; max-width: 42ch; margin-bottom: 1.6rem; }
.hero__card { background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.18);
  border-radius: var(--radius); padding: 1.6rem; backdrop-filter: blur(6px); }
.hero__card h3 { color: #fff; margin-bottom: 0.4rem; }
.hero__card p { color: #c8d0ee; font-size: 0.9rem; margin-bottom: 1rem; }

/* Track widget (hero) */
.track { display: flex; gap: 0.5rem; }
.track input { flex: 1; border: 0; border-radius: 100px; padding: 0.8rem 1.1rem; font-size: 0.95rem; }
.track button { border: 0; border-radius: 100px; background: var(--yellow); color: var(--navy); font-weight: 700; padding: 0 1.2rem; }

/* ── Section scaffolding ── */
.section { padding: clamp(2.2rem, 5vw, 3.6rem) 0; scroll-margin-top: calc(var(--hdr-h) + 12px); }
.section--soft { background: var(--bg-soft); }
.section__head { max-width: 60ch; margin-bottom: 1.8rem; }
.section__head .eyebrow { color: var(--yellow-dk); font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; font-size: 0.72rem; }
.section__head h2 { font-size: clamp(1.4rem, 3vw, 2rem); margin: 0.5rem 0; }
.section__head p { color: var(--muted); }
/* When the assistant highlights a section */
.hl-flash { animation: hlFlash 2.2s ease; }
@keyframes hlFlash {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,204,0,0); }
  15%      { box-shadow: 0 0 0 4px rgba(255,204,0,0.9); }
  60%      { box-shadow: 0 0 0 4px rgba(255,204,0,0.5); }
}

/* ── Quick actions ── */
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
@media (max-width: 820px) { .quick { grid-template-columns: repeat(2, 1fr); } }
.quick a {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem;
  display: flex; flex-direction: column; gap: 0.6rem; box-shadow: var(--shadow); transition: transform 0.2s, border-color 0.2s;
}
.quick a:hover { transform: translateY(-3px); border-color: var(--yellow); }
.quick .ic { width: 44px; height: 44px; border-radius: 11px; background: var(--yellow); color: var(--navy); display: grid; place-items: center; }
.quick .ic svg { width: 24px; height: 24px; }
.quick .t { font-weight: 700; color: var(--navy); }
.quick .d { font-size: 0.85rem; color: var(--muted); }

/* ── Card grid (services / sections) ── */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
@media (max-width: 900px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .cards { grid-template-columns: 1fr; } }
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column; box-shadow: var(--shadow); transition: transform 0.2s;
}
.card:hover { transform: translateY(-3px); }
.card__media { height: 140px; background: linear-gradient(135deg, #eef1fb, #dfe4f6); position: relative; }
.card__media.y { background: linear-gradient(135deg, #fff0b8, #ffd84d); }
.card__body { padding: 1.2rem 1.3rem 1.4rem; display: flex; flex-direction: column; gap: 0.5rem; flex: 1; }
.card__body h3 { font-size: 1.1rem; }
.card__body p { color: var(--muted); font-size: 0.9rem; flex: 1; }
.card__body .link { color: var(--navy); font-weight: 700; font-size: 0.88rem; display: inline-flex; gap: 0.4rem; align-items: center; }

/* ── Footer ── */
.pfoot { background: var(--navy); color: #c8d0ee; margin-top: 2.5rem; }
.pfoot__cols { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 2rem; padding: 3rem 0 2rem; }
@media (max-width: 820px) { .pfoot__cols { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .pfoot__cols { grid-template-columns: 1fr; } }
.pfoot h4 { color: #fff; font-size: 0.9rem; margin-bottom: 1rem; }
.pfoot ul { list-style: none; margin: 0; padding: 0; }
.pfoot li { margin-bottom: 0.6rem; font-size: 0.88rem; }
.pfoot a:hover { color: #fff; text-decoration: underline; }
.pfoot__bar { border-top: 1px solid rgba(255,255,255,0.12); padding: 1.2rem 0; font-size: 0.8rem; display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; }

/* ── Subpage lead / breadcrumb ── */
.lead { background: var(--bg-soft); }
.lead .container { padding: 2.2rem 0 1.4rem; }
.lead h1 { font-size: clamp(1.6rem, 3.4vw, 2.4rem); }
.lead p { color: var(--muted); max-width: 56ch; margin-top: 0.5rem; }
.crumb { font-size: 0.8rem; color: var(--muted); margin-bottom: 0.6rem; }
.crumb a:hover { text-decoration: underline; }

/* Simple form controls reused across subpages */
.field-row { display: flex; gap: 0.6rem; flex-wrap: wrap; max-width: 520px; }
.field-row input, .field-row select {
  flex: 1; min-width: 180px; border: 1px solid var(--line); border-radius: 100px; padding: 0.85rem 1.2rem; font-family: inherit; font-size: 0.95rem;
}
.note { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.3rem; box-shadow: var(--shadow); }

/* ── Assistant dock (voice navigation) ── */
.assistant {
  position: fixed; right: 20px; bottom: 20px; z-index: 800;
  display: flex; flex-direction: column; align-items: flex-end; gap: 0.7rem;
}
.assistant__panel {
  width: min(340px, calc(100vw - 40px)); background: #fff; border: 1px solid var(--line);
  border-radius: 16px; box-shadow: 0 12px 40px rgba(10,26,92,0.22); overflow: hidden;
  transform: translateY(12px) scale(0.98); opacity: 0; pointer-events: none; transition: 0.22s ease;
}
.assistant.open .assistant__panel { transform: none; opacity: 1; pointer-events: auto; }
.assistant__head { background: var(--navy); color: #fff; padding: 0.9rem 1.1rem; display: flex; align-items: center; gap: 0.6rem; }
.assistant__head .dot { width: 9px; height: 9px; border-radius: 50%; background: #7b86b8; }
.assistant__head.live .dot { background: #37d67a; box-shadow: 0 0 8px #37d67a; }
.assistant__head .t { font-weight: 700; font-size: 0.92rem; }
.assistant__head .st { margin-left: auto; font-size: 0.72rem; opacity: 0.8; }
.assistant__log { max-height: 240px; overflow-y: auto; padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: 0.7rem; }
.assistant__log:empty::after { content: "Premi il microfono e chiedi, es. \201CTraccia una spedizione\201D o \201CTrova un ufficio postale\201D."; color: var(--muted); font-size: 0.85rem; }
.msg { font-size: 0.88rem; padding: 0.5rem 0.75rem; border-radius: 12px; max-width: 85%; }
.msg--user { align-self: flex-end; background: var(--navy); color: #fff; border-bottom-right-radius: 4px; }
.msg--ai { align-self: flex-start; background: var(--bg-soft); color: var(--ink); border-bottom-left-radius: 4px; }
.assistant__foot { padding: 0.8rem 1.1rem; border-top: 1px solid var(--line); font-size: 0.78rem; color: var(--muted); }
.assistant__fab {
  width: 60px; height: 60px; border-radius: 50%; border: 0; background: var(--yellow); color: var(--navy);
  box-shadow: 0 8px 24px rgba(10,26,92,0.28); display: grid; place-items: center; position: relative;
}
.assistant__fab svg { width: 26px; height: 26px; }
.assistant__fab.live { background: var(--navy); color: #fff; }
.assistant__fab.live::after {
  content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid var(--yellow);
  animation: pulse 1.6s ease-out infinite;
}
@keyframes pulse { 0% { transform: scale(1); opacity: 0.9; } 100% { transform: scale(1.35); opacity: 0; } }
