/* ============================================================
   Telemarketing 2.0 · PRIME ACADEMY
   Stile del nuovo sito Prime Immobiliare (nero, oro, Montserrat + Inter),
   con il "telefono" come elemento centrale.
   ============================================================ */
:root {
  --line-dark: rgba(255,255,255,.12);
  --white-60: rgba(255,255,255,.6);
  --white-80: rgba(255,255,255,.82);
  --red: #c4432f;
  --red-deep: #9e2f1f;
}

.hero-kicker {
  display: block; font-family: var(--font-titoli); font-size: .78rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--gold); margin-bottom: 10px;
}
.hero .sub { max-width: 58ch; }
.btn-xl {
  padding: 20px 38px; font-size: 1.05rem; letter-spacing: .02em; text-transform: uppercase;
  border-radius: 6px; box-shadow: 0 12px 32px rgba(0,0,0,.55);
}
.btn-xl.btn-gold:hover { transform: translateY(-3px); box-shadow: 0 16px 34px rgba(0,0,0,.6), 0 0 0 1px rgba(211,175,0,.2); }
.btn-xl:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn-xl:not(:disabled) { animation: glowring 1.8s ease 3; }

.hero-hints {
  list-style: none; padding: 0; margin: 28px 0 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px;
  background: var(--line-dark); border: 1px solid var(--line-dark); border-radius: 14px; overflow: hidden;
}
.hero-hints li { background: rgba(15,16,20,.6); padding: 14px 16px; font-size: .88rem; color: var(--white-60); min-width: 0; }
.hero-hints strong { display: block; color: #fff; font-size: .92rem; margin-bottom: 2px; }
@media (max-width: 760px) { .hero-hints { grid-template-columns: 1fr; } }

.hero-warn {
  margin-top: 16px; padding: 11px 14px; border-radius: var(--radius-sm);
  background: rgba(211,175,0,.14); border: 1px solid rgba(211,175,0,.4); color: var(--gold-tint); font-size: .9rem;
}

/* ---------- login ---------- */
.login-box { margin-top: 26px; max-width: 460px; }
.login-box label { display: block; font-weight: 700; font-size: .88rem; margin-bottom: 8px; color: var(--white-80); }
.login-row { display: flex; gap: 10px; flex-wrap: wrap; }
.login-row input {
  flex: 1 1 220px; min-width: 0; padding: 14px 16px; font: inherit; font-size: 1rem;
  border: 1px solid rgba(255,255,255,.22); border-radius: 12px; background: rgba(255,255,255,.10); color: #fff;
}
.login-row input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 4px rgba(211,175,0,.3); }
.login-err { margin-top: 10px; color: #ffb4a6; font-weight: 600; }

/* ---------- telefono ---------- */
.phone {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 18px; align-items: stretch;
}
@media (max-width: 820px) { .phone { grid-template-columns: 1fr; } }

.phone-card {
  background: #fff; color: var(--ink); border-radius: var(--radius); padding: 20px 22px;
  border-left: 6px solid var(--gold); box-shadow: var(--shadow-m); min-width: 0;
}
.phone-list-label {
  font-size: .7rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
}
.phone-name { font-family: var(--font-titoli); font-size: 1.5rem; font-weight: 700; letter-spacing: -.02em; margin-top: 6px; }
.phone-addr { color: var(--ink-2); margin-top: 2px; }
.phone-meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.pill-dark { background: var(--ink); color: #fff; }
.phone-n { font-size: .82rem; color: var(--muted); font-weight: 600; }

.phone-state {
  display: flex; align-items: center; gap: 18px; min-width: 0;
  background: rgba(15,16,20,.6); border: 1px solid var(--line-dark); border-radius: var(--radius); padding: 20px 22px;
}
.state-label { font-family: var(--font-titoli); font-size: 1.25rem; font-weight: 700; letter-spacing: -.01em; }
.state-timer { font-variant-numeric: tabular-nums; color: var(--white-60); font-size: .95rem; margin-top: 2px; }

/* indicatore: tre cerchi che "respirano" diversamente per stato */
.pulse { position: relative; width: 62px; height: 62px; flex: none; }
.pulse span {
  position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--gold); opacity: 0;
}
.pulse span:nth-child(1) { inset: 22px; background: var(--gold); opacity: 1; border: 0; }
[data-stato="squillo"] .pulse span:nth-child(2),
[data-stato="squillo"] .pulse span:nth-child(3) { animation: ring 1.6s ease-out infinite; }
[data-stato="squillo"] .pulse span:nth-child(3) { animation-delay: .5s; }
[data-stato="parla"] .pulse span:nth-child(1) { animation: talk .5s ease-in-out infinite alternate; }
[data-stato="parla"] .pulse span:nth-child(2) { opacity: .5; inset: 12px; }
[data-stato="ascolto"] .pulse span:nth-child(1) { background: #fff; }
[data-stato="ascolto"] .pulse span:nth-child(2) { opacity: .35; inset: 14px; border-color: #fff; animation: listen 1.4s ease-in-out infinite; }
[data-stato="pensa"] .pulse span:nth-child(1) { background: var(--white-60); animation: think 1s ease-in-out infinite; }
[data-stato="chiusa"] .pulse span:nth-child(1) { background: var(--red); }
@keyframes ring { from { transform: scale(.4); opacity: .9; } to { transform: scale(1); opacity: 0; } }
@keyframes talk { from { transform: scale(.8); } to { transform: scale(1.25); } }
@keyframes listen { 0%,100% { transform: scale(1); } 50% { transform: scale(1.12); } }
@keyframes think { 0%,100% { opacity: .35; } 50% { opacity: 1; } }

.subtitle {
  grid-column: 1 / -1; min-height: 1.6em; font-size: .95rem; color: var(--white-60);
  overflow-wrap: anywhere;
}
.subtitle { color: var(--white-80); font-style: italic; }
.subtitle::before { content: "Residente: "; font-style: normal; color: var(--gold); font-weight: 700; }

.phone-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.btn-hang { background: var(--red); border-color: var(--red); color: #fff; }
.btn-hang:hover { background: var(--red-deep); box-shadow: 0 8px 20px rgba(158,47,31,.35); }
.toggle { margin-left: auto; display: inline-flex; gap: 8px; align-items: center; color: var(--white-60); font-size: .88rem; cursor: pointer; }
.toggle input { accent-color: var(--gold); width: 16px; height: 16px; }

.between {
  margin-top: 18px; padding: 16px 18px; border-radius: var(--radius);
  background: rgba(211,175,0,.10); border: 1px solid rgba(211,175,0,.35);
  display: flex; gap: 14px; align-items: center; flex-wrap: wrap; justify-content: space-between;
}
.between p { font-weight: 700; }
.between-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- elenco telefonate della sessione ---------- */
.calls { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.call {
  position: relative; overflow: hidden; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 15px 17px 15px 21px; min-width: 0;
}
.call::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--st-mai); }
.call.ok::before { background: var(--green); }
.call.mid::before { background: var(--gold); }
.call.low::before { background: var(--st-vecchia); }
.call .t { font-weight: 700; }
.call .m { font-size: .82rem; color: var(--muted); margin-top: 2px; }
.call .r { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line-2); font-size: .86rem; color: var(--ink-2); }
.score { font-weight: 800; font-variant-numeric: tabular-nums; padding: 2px 9px; border-radius: 999px; background: var(--line-2); color: var(--ink); }
.call.ok .score { background: var(--green-tint); color: var(--green-ink); }
.call.mid .score { background: var(--gold-tint); color: var(--gold-ink); }
.call.low .score { background: #fbe6db; color: #8a3a12; }
.spinner { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--gold-deep); animation: spin .8s linear infinite; vertical-align: -1px; margin-right: 6px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- report ---------- */
table.grid-report td, table.grid-report th { text-align: center; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.grid-report td:first-child, table.grid-report th:first-child { text-align: left; white-space: normal; min-width: 210px; font-weight: 700; }
table.grid-report td.avg, table.grid-report th.avg { background: var(--gold-tint); color: var(--gold-ink); font-weight: 800; }
table.grid-report tr.tot td { border-top: 2px solid var(--ink); font-weight: 800; }
.nv { color: var(--muted); font-weight: 600; }
.v-hi { color: var(--green-deep); font-weight: 700; }
.v-lo { color: #a3471b; font-weight: 700; }

.sintesi { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 16px; }
@media (max-width: 760px) { .sintesi { grid-template-columns: 1fr; } }
.oss { padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; min-width: 0; }
.oss h3 { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--gold-deep); margin-bottom: 8px; }
.oss p, .oss li { font-size: .95rem; color: var(--ink-soft); }
.oss ul, .oss ol { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.oss.consigli { border-left: 4px solid var(--gold); }
.oss.consigli li::marker { color: var(--gold-deep); font-weight: 700; }

.voti { display: flex; flex-wrap: wrap; gap: 8px; }
.voto { font-size: .86rem; padding: 5px 12px; border-radius: 999px; background: var(--line-2); color: var(--ink-2); }
.voto b { margin-left: 4px; color: var(--ink); }
.voto.v-hi { background: var(--green-tint); color: var(--green-ink); }
.voto.v-hi b { color: var(--green-ink); }
.voto.v-lo { background: #fbe6db; color: #8a3a12; }
.voto.v-lo b { color: #8a3a12; }
.voto.nv b { color: var(--muted); }

.dettagli { display: grid; gap: 12px; }
.dettagli details { border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; }
.dettagli summary { cursor: pointer; padding: 14px 16px; font-weight: 700; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.dettagli summary .m { font-weight: 500; color: var(--muted); font-size: .86rem; }
.dettagli .corpo { padding: 0 16px 16px; display: grid; gap: 14px; }
.trascr { display: grid; gap: 6px; font-size: .92rem; max-height: 420px; overflow: auto; padding: 12px; background: var(--paper); border-radius: var(--radius-sm); }
.trascr .a b { color: var(--ink); }
.trascr .r b { color: var(--gold-deep); }

button:focus-visible, a:focus-visible, input:focus-visible, summary:focus-visible { outline: 3px solid rgba(211,175,0,.6); outline-offset: 2px; }

/* ---------- telefono (smartphone) ---------- */
@media (max-width: 640px) {
  .btn-xl { width: 100%; padding: 18px 20px; }
  .hero-actions .btn { flex: 1 1 100%; }
  .phone-card, .phone-state { padding: 16px 16px; }
  .phone-name { font-size: 1.3rem; }
  .pulse { width: 52px; height: 52px; }
  .pulse span:nth-child(1) { inset: 18px; }
  .phone-actions { gap: 8px; }
  .phone-actions .btn-hang { flex: 1 1 100%; padding: 16px; font-size: 1.05rem; }
  .phone-actions #btn-termina { flex: 1 1 auto; }
  .toggle { margin-left: 0; padding: 8px 4px; }
  .between { flex-direction: column; align-items: stretch; padding: 14px; }
  .between-actions .btn { flex: 1 1 auto; }
  .login-row .btn { flex: 1 1 100%; }
  table.grid-report td:first-child, table.grid-report th:first-child { min-width: 130px; }
  table.grid th, table.grid td { padding: 11px 10px; }
  .dettagli summary { padding: 12px 14px; }
  .dettagli .corpo { padding: 0 14px 14px; }
  .trascr { max-height: 320px; }
}
