/* =========================================================
   DEFAULT THEME — DARK (BASE ASSOLUTA)
   ========================================================= */

html,
body {
  background-color: #0b0b0c;
  color: #e5e7eb;
}

/* wrapper comuni (difesa anti-bianco) */
body,
.page,
.app,
.layout,
.main {
  background-color: #0b0b0c;
}

/* =========================================================
   FOOTER — DARK DEFAULT
   ========================================================= */

.site-footer {
  margin: 24px 0 12px;
  padding: 12px 0;
  text-align: center;
  color: #e7e7e7;
  background: transparent;
}

.site-footer__inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
}

.site-footer__links {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 6px;
}

.site-footer__links a {
  color: #e7e7e7;
  text-decoration: underline;
}

.site-footer__links a:hover { opacity: .85; }

.site-footer__legal {
  color: #9aa0a6;
  font-size: .9rem;
}

/* =========================================================
   LIGHT MODE (OPT-IN)
   attivo SOLO se html.light è presente
   ========================================================= */

html.light,
html.light body {
  background-color: #ffffff;
  color: #111111;
}

/* footer in light */
html.light .site-footer {
  color: #111;
}

html.light .site-footer__links a {
  color: #111;
}

html.light .site-footer__legal {
  color: #6b7280;
}

/* =========================================================
   SIDEBAR LEGAL LINKS
   ========================================================= */

.col-left .legal-links {
  margin-top: 10px;
  padding: 10px 6px 6px;
  text-align: center;
  font-size: .9rem;
  color: #9aa0a6;
}

.col-left .legal-links .legal-link {
  color: #2563eb; /* blu allineato */
  text-decoration: underline;
}

.col-left .legal-links .legal-link:hover { opacity: .85; }

/* light override */
html.light .col-left .legal-links {
  color: #6b7280;
}

html.light .col-left .legal-links .legal-link {
  color: #2563eb;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 768px){
  .col-left .legal-links { display: none !important; }

  .chat .feed-list { padding-bottom: 84px; }
  .chat .chat-feed.card { padding-bottom: 16px; }
}

/* desktop spacing */
@media (min-width: 769px){
  .col-left .legal-links {
    margin-top: 55px;
  }
}

/* =========================================================
   CHAT / VIDEO / STUDIO / BILLING
   ========================================================= */

.chat .site-footer {
  display: none !important;
}

@media (min-width: 1024px){
  .studio .site-footer,
  .billing .site-footer {
    grid-column: 1 / -1 !important;
    order: 999 !important;
    flex-basis: 100% !important;
    align-self: stretch !important;
    width: 100%;
  }

  .studio .site-footer__inner,
  .billing .site-footer__inner {
    max-width: 1100px;
    margin: 0 auto;
  }

  .video .site-footer {
    display: none !important;
  }
}

@media (max-width: 768px){
  .billing .site-footer {
    order: 9999 !important;
    grid-column: 1 / -1 !important;
    width: 100%;
    margin-top: 12px;
  }

  .billing .col-center {
    padding-bottom: 84px;
  }
}

/* =========================================================
   LEGAL PAGES (DARK DEFAULT)
   ========================================================= */

.legal-page {
  overflow-x: hidden;
}

.legal-page .legal-doc {
  max-width: 860px;
  margin: 24px auto;
  padding: 0 16px;
  color: inherit;
}

/* immagini e tabelle */
.legal-page img,
.legal-page table {
  max-width: 100%;
  height: auto;
}

/* =========================================================
   EXIT BUTTON (LEGAL)
   ========================================================= */

.legal-exit {
  position: fixed;
  top: 12px;
  right: 12px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #111;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
  z-index: 1000;
}

html.light .legal-exit {
  background: #111;
  color: #fff;
}

.legal-exit:hover { opacity: .9; }

.legal-exit:focus {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

@media (max-width: 600px){
  .legal-exit {
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
  }
}
