/* ============================================
   SUPPORT.CSS — Centro assistenza pubblico
   Estende la shell marketing senza cambiarla.
   ============================================ */

.support-page {
  --support-max: 1080px;
}

.support-container {
  width: min(100% - 2.5rem, var(--support-max));
  margin-inline: auto;
}

.support-page .lp-nav.is-scrolled {
  background: rgba(10, 10, 10, 0.88);
}

.support-nav-links {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
}

.support-menu {
  display: none;
  position: relative;
}

.support-menu summary {
  min-height: 2.45rem;
  display: inline-flex;
  align-items: center;
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: var(--weight-bold);
  cursor: pointer;
  list-style: none;
}

.support-menu summary::-webkit-details-marker { display: none; }
.support-menu summary::after { content: '⌄'; margin-left: 0.35rem; }
.support-menu[open] summary { color: var(--text-primary); }

.support-menu nav {
  position: absolute;
  top: calc(100% + 0.65rem);
  right: 0;
  min-width: 13rem;
  padding: 0.45rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgba(20, 20, 24, 0.98);
  box-shadow: var(--shadow-lg);
}

.support-menu nav a {
  display: block;
  padding: 0.75rem 0.8rem;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: var(--weight-semibold);
}

.support-menu nav a:hover,
.support-menu nav a:focus-visible {
  background: var(--panel-strong);
  color: var(--text-primary);
}

.support-hero {
  min-height: 38rem;
  position: relative;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: calc(var(--safe-top) + 8rem) 0 5.5rem;
  text-align: center;
}

.support-hero::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  width: min(920px, 86vw);
  height: 1px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}

.support-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
}

.support-glow-one {
  width: 34rem;
  height: 34rem;
  top: -14rem;
  left: 50%;
  transform: translateX(-15%);
  background: rgba(233, 30, 99, 0.22);
}

.support-glow-two {
  width: 28rem;
  height: 28rem;
  left: 8%;
  bottom: -17rem;
  background: rgba(0, 217, 255, 0.11);
}

.support-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 760px;
}

.support-hero h1 {
  max-width: 720px;
  margin: 1.1rem auto 0;
  font-family: var(--font-display);
  font-size: clamp(2.55rem, 8vw, 5rem);
  font-weight: var(--weight-black);
  letter-spacing: -0.045em;
  line-height: 0.98;
}

.support-hero p {
  max-width: 650px;
  margin: 1.35rem auto 0;
  color: var(--text-secondary);
  font-size: clamp(1.02rem, 2.4vw, 1.2rem);
  line-height: 1.6;
}

.support-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.8rem;
  margin-top: 2rem;
}

.support-section {
  padding: 5rem 0;
}

.support-section-head {
  max-width: 650px;
  margin: 0 auto 2.4rem;
  text-align: center;
}

.support-section-head h2,
.support-contact-copy h2,
.support-safety h2 {
  margin: 0.9rem 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 5vw, 3rem);
  font-weight: var(--weight-black);
  letter-spacing: -0.03em;
  line-height: 1.08;
}

.support-topic-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.support-topic {
  min-height: 15.5rem;
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.02));
  transition: transform var(--transition-base), border-color var(--transition-base), background var(--transition-base);
}

.support-topic:hover {
  transform: translateY(-3px);
  border-color: rgba(233, 30, 99, 0.38);
  background: linear-gradient(145deg, rgba(233, 30, 99, 0.09), rgba(255, 255, 255, 0.025));
}

.support-topic:focus-visible,
.support-inline-link:focus-visible,
.support-resource-list a:focus-visible,
.support-page .lp-nav a:focus-visible,
.support-page .lp-footer a:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 3px;
}

.support-topic-kicker,
.support-safety-label {
  color: #FF6FA5;
  font-size: 0.75rem;
  font-weight: var(--weight-bold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.support-topic h3 {
  margin: 0.75rem 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 3vw, 1.65rem);
  font-weight: var(--weight-black);
  letter-spacing: -0.02em;
}

.support-topic p {
  max-width: 26rem;
  margin: 0.65rem 0 1.25rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.support-topic-link {
  margin-top: auto;
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: var(--weight-bold);
}

.support-topic-link span,
.support-inline-link span {
  display: inline-block;
  margin-left: 0.2rem;
  color: var(--brand-primary);
  transition: transform var(--transition-fast);
}

.support-topic:hover .support-topic-link span,
.support-inline-link:hover span {
  transform: translateX(0.2rem);
}

.support-contact-section {
  border-block: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.018);
}

.support-contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(20rem, 0.85fr);
  align-items: center;
  gap: clamp(2rem, 7vw, 6rem);
}

.support-contact-copy p {
  max-width: 36rem;
  margin: 1rem 0 0;
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.65;
}

.support-contact-copy p a,
.support-safety p a {
  color: #FF8AB5;
  text-decoration: underline;
  text-decoration-color: rgba(255, 138, 181, 0.4);
  text-underline-offset: 0.2rem;
}

.support-inline-link {
  display: inline-flex;
  margin-top: 1.3rem;
  color: var(--text-primary);
  font-weight: var(--weight-bold);
}

.support-checklist {
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--panel);
  box-shadow: var(--shadow-card);
}

.support-checklist h3 {
  margin: 0 0 1rem;
  font-size: 1rem;
}

.support-checklist ul {
  display: grid;
  gap: 0.85rem;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: support-steps;
}

.support-checklist li {
  position: relative;
  min-height: 2rem;
  padding-left: 2.6rem;
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.5;
  counter-increment: support-steps;
}

.support-checklist li::before {
  content: counter(support-steps);
  position: absolute;
  top: 0;
  left: 0;
  width: 1.8rem;
  height: 1.8rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(233, 30, 99, 0.15);
  color: #FF6FA5;
  font-size: 0.75rem;
  font-weight: var(--weight-black);
}

.support-safety {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2.5rem;
  padding: clamp(1.5rem, 5vw, 3rem);
  border: 1px solid rgba(233, 30, 99, 0.3);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(440px 220px at 100% 0%, rgba(156, 39, 176, 0.2), transparent 72%),
    linear-gradient(145deg, rgba(233, 30, 99, 0.1), rgba(255, 255, 255, 0.025));
}

.support-safety > div { max-width: 700px; }

.support-safety p {
  margin: 1rem 0 0;
  color: var(--text-secondary);
  line-height: 1.65;
}

.support-safety .lp-btn { flex: 0 0 auto; }

.support-chat-section {
  border-top: 1px solid var(--border);
  background:
    radial-gradient(520px 260px at 50% 10%, rgba(233, 30, 99, 0.08), transparent 74%),
    rgba(255, 255, 255, 0.012);
}

.support-chat-section .support-section-head p {
  margin: 0.8rem auto 0;
  color: var(--text-secondary);
  font-size: 1.02rem;
  line-height: 1.6;
}

.support-chat {
  max-width: 820px;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xl);
  background: rgba(14, 14, 18, 0.92);
  box-shadow: var(--shadow-lg);
}

.support-chat-header {
  min-height: 4.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.15rem;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.035);
}

.support-chat-header > div {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}

.support-chat-header strong {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: var(--weight-black);
}

.support-chat-header > div > span {
  color: var(--text-muted);
  font-size: 0.76rem;
}

.support-chat-status {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: var(--weight-bold);
}

.support-chat-status::before {
  content: '';
  width: 0.52rem;
  height: 0.52rem;
  border-radius: 50%;
  background: var(--warning);
  box-shadow: 0 0 0 0.22rem rgba(255, 179, 0, 0.12);
}

.support-chat-status[data-mode="live"]::before {
  background: var(--success);
  box-shadow: 0 0 0 0.22rem rgba(0, 230, 118, 0.12);
}

.support-chat-status[data-mode="offline"]::before {
  background: var(--text-muted);
  box-shadow: none;
}

.support-chat-loading {
  min-height: 19rem;
  display: grid;
  place-items: center;
  padding: 2rem;
  color: var(--text-muted);
  text-align: center;
}

.support-chat-signed-out {
  min-height: 21rem;
  padding: 3rem 1.5rem;
  text-align: center;
}

.support-chat-lock {
  display: inline-flex;
  padding: 0.36rem 0.75rem;
  border: 1px solid rgba(0, 230, 118, 0.25);
  border-radius: var(--radius-pill);
  background: rgba(0, 230, 118, 0.1);
  color: var(--success);
  font-size: 0.72rem;
  font-weight: var(--weight-bold);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.support-chat-signed-out h3 {
  margin: 1rem 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 4vw, 1.8rem);
  font-weight: var(--weight-black);
}

.support-chat-signed-out p {
  max-width: 34rem;
  margin: 0.65rem auto 1.4rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.support-chat-email {
  display: block;
  width: max-content;
  max-width: 100%;
  margin: 1rem auto 0;
  color: var(--text-secondary);
  font-size: 0.82rem;
  text-decoration: underline;
  text-underline-offset: 0.2rem;
}

.support-chat-messages {
  height: clamp(22rem, 55vh, 34rem);
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1.25rem;
  scroll-behavior: smooth;
}

.support-chat-message {
  width: min(82%, 35rem);
  align-self: flex-start;
}

.support-chat-message.is-mine { align-self: flex-end; }

.support-chat-message-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0.55rem 0.32rem;
  color: var(--text-muted);
  font-size: 0.7rem;
}

.support-chat-message.is-mine .support-chat-message-meta {
  flex-direction: row-reverse;
}

.support-chat-message-meta span { font-weight: var(--weight-bold); }

.support-chat-message-bubble {
  margin: 0;
  padding: 0.8rem 1rem;
  border: 1px solid var(--border);
  border-radius: 0.45rem var(--radius-lg) var(--radius-lg) var(--radius-lg);
  background: var(--panel-strong);
  color: var(--text-primary);
  line-height: 1.5;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.support-chat-message.is-mine .support-chat-message-bubble {
  border-color: rgba(233, 30, 99, 0.28);
  border-radius: var(--radius-lg) 0.45rem var(--radius-lg) var(--radius-lg);
  background: linear-gradient(135deg, rgba(233, 30, 99, 0.28), rgba(156, 39, 176, 0.22));
}

.support-chat-empty {
  margin: auto;
  color: var(--text-muted);
  text-align: center;
}

.support-chat-error {
  margin: 0;
  padding: 0.7rem 1.15rem;
  border-top: 1px solid rgba(255, 23, 68, 0.22);
  background: rgba(255, 23, 68, 0.08);
  color: #FF8299;
  font-size: 0.82rem;
  line-height: 1.45;
}

.support-chat-form {
  display: flex;
  align-items: flex-end;
  gap: 0.7rem;
  padding: 0.85rem;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.025);
}

.support-chat-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.support-chat-form textarea {
  flex: 1;
  min-width: 0;
  min-height: 2.9rem;
  max-height: 8.25rem;
  resize: none;
  padding: 0.78rem 1rem;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  outline: 0;
  background: rgba(255, 255, 255, 0.055);
  color: var(--text-primary);
  line-height: 1.35;
}

.support-chat-form textarea::placeholder { color: var(--text-muted); }

.support-chat-form textarea:focus {
  border-color: rgba(233, 30, 99, 0.62);
  box-shadow: 0 0 0 3px rgba(233, 30, 99, 0.12);
}

.support-chat-send {
  min-height: 2.9rem;
  padding: 0.72rem 1.15rem;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--brand-gradient);
  color: #fff;
  font-weight: var(--weight-bold);
  box-shadow: var(--shadow-brand);
}

.support-chat-send:disabled,
.support-chat-form textarea:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.support-chat-note {
  margin: 0;
  padding: 0 1rem 0.9rem;
  color: var(--text-muted);
  font-size: 0.72rem;
  line-height: 1.45;
  text-align: center;
}

.support-chat-handoff {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 0.85rem 0.85rem 0.55rem;
  padding: 0.85rem 1rem;
  border: 1px solid color-mix(in srgb, var(--accent) 32%, var(--border));
  border-radius: 14px;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  color: var(--text-primary);
  text-decoration: none;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.support-chat-handoff:hover {
  border-color: color-mix(in srgb, var(--accent) 58%, var(--border));
  background: color-mix(in srgb, var(--accent) 13%, transparent);
  transform: translateY(-1px);
}

.support-chat-handoff:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.support-chat-handoff span {
  flex: 0 0 auto;
  color: var(--accent);
  font-weight: var(--weight-bold);
}

.support-chat-handoff small {
  color: var(--text-secondary);
  font-size: 0.78rem;
  line-height: 1.45;
  text-align: right;
}

.support-links-section { padding-top: 1rem; }

.support-resource-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  max-width: 820px;
  margin: 0 auto;
}

.support-resource-list a {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.025);
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.support-resource-list a::after {
  content: '→';
  align-self: flex-end;
  margin-top: -1.5rem;
  color: var(--brand-primary);
}

.support-resource-list a:hover {
  border-color: rgba(233, 30, 99, 0.36);
  background: rgba(233, 30, 99, 0.07);
}

.support-resource-list span {
  padding-right: 1.5rem;
  font-weight: var(--weight-bold);
}

.support-resource-list small {
  padding-right: 1.5rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.4;
}

@media (max-width: 840px) {
  .support-nav-links { display: none; }
  .support-menu { display: block; }
  .support-contact-grid { grid-template-columns: 1fr; }
  .support-safety { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 640px) {
  .support-container { width: min(100% - 2rem, var(--support-max)); }

  .support-page .lp-nav-inner {
    padding-inline: 1rem;
  }

  .support-page .lp-nav-actions { gap: 0.55rem; }
  .support-page .lp-nav-logo img { height: 1.35rem; }
  .support-page .lp-nav-cta { padding: 0.55rem 0.8rem; font-size: 0.82rem; }
  .support-page .lp-lang a { min-width: 1.8rem; padding-inline: 0.38rem; }

  .support-hero {
    min-height: 34rem;
    padding: calc(var(--safe-top) + 7.5rem) 0 4rem;
  }

  .support-hero h1 { font-size: clamp(2.45rem, 14vw, 3.5rem); }
  .support-actions { align-items: stretch; flex-direction: column; }
  .support-actions .lp-btn { width: 100%; justify-content: center; }
  .support-section { padding: 3.75rem 0; }
  .support-topic-grid,
  .support-resource-list { grid-template-columns: 1fr; }
  .support-topic { min-height: 13.5rem; }
  .support-chat-message { width: 90%; }
  .support-chat-messages { height: 26rem; padding: 1rem; }
  .support-chat-form { gap: 0.5rem; padding: 0.7rem; }
  .support-chat-send { padding-inline: 0.95rem; }
  .support-chat-handoff { align-items: flex-start; flex-direction: column; gap: 0.25rem; }
  .support-chat-handoff small { text-align: left; }
  .support-links-section { padding-top: 0.5rem; }
}

@media (max-width: 400px) {
  .support-page .lp-lang { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .support-topic,
  .support-topic-link span,
  .support-inline-link span { transition: none; }

  .support-topic:hover { transform: none; }
  .support-chat-messages { scroll-behavior: auto; }
}
