/* ==========================================================================
   TSB Privacy & Cookie Consent — Stili banner (accessibile, responsive)
   ========================================================================== */

.tsb-consent-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 999999;
  background: #0d1322;
  color: #e2e8f0;
  border-top: 1px solid #26375d;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.45);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  max-height: 92vh;
  overflow-y: auto;
}

.tsb-consent-banner.tsb-visible {
  transform: translateY(0);
}

.tsb-consent-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
}

.tsb-consent-main {
  flex: 1 1 420px;
  min-width: 260px;
}

.tsb-consent-title {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 700;
  color: #f8fafc;
}

.tsb-consent-message {
  margin: 0 0 6px;
  color: #cbd5e1;
  font-size: 13.5px;
}

.tsb-consent-links {
  margin: 0;
  font-size: 12.5px;
}

.tsb-consent-links a {
  color: #f59e0b;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.tsb-consent-links a:hover,
.tsb-consent-links a:focus {
  color: #fbbf24;
}

.tsb-consent-links span {
  color: #475569;
  margin: 0 6px;
}

/* --- Azioni --- */
.tsb-consent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  flex: 0 0 auto;
}

.tsb-btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  min-height: 44px;
}

.tsb-btn:focus-visible {
  outline: 3px solid #f59e0b;
  outline-offset: 2px;
}

.tsb-btn-primary {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #0d1322;
}

.tsb-btn-primary:hover {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
}

.tsb-btn-secondary {
  background: #1a2642;
  color: #e2e8f0;
  border-color: #26375d;
}

.tsb-btn-secondary:hover {
  background: #26375d;
}

.tsb-btn-ghost {
  background: transparent;
  color: #94a3b8;
  border-color: #26375d;
}

.tsb-btn-ghost:hover {
  color: #e2e8f0;
  border-color: #475569;
}

/* --- Pannello preferenze --- */
.tsb-consent-prefs {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 20px;
  border-top: 1px solid #1a2642;
}

.tsb-pref-row {
  padding: 12px 0;
  border-bottom: 1px solid #1a2642;
}

.tsb-pref-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-weight: 600;
  color: #f1f5f9;
}

.tsb-pref-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #f59e0b;
  cursor: pointer;
}

.tsb-pref-label input[disabled] {
  cursor: not-allowed;
  opacity: 0.6;
}

.tsb-pref-desc {
  margin: 4px 0 0 28px;
  font-size: 12.5px;
  color: #94a3b8;
}

.tsb-pref-save {
  padding-top: 16px;
  text-align: right;
}

/* --- Link revoca nel footer --- */
.tsb-consent-revoke {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 99998;
  background: #0d1322;
  color: #cbd5e1;
  border: 1px solid #26375d;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.tsb-consent-revoke:hover,
.tsb-consent-revoke:focus-visible {
  background: #1a2642;
  color: #f8fafc;
  outline: 2px solid #f59e0b;
  outline-offset: 2px;
}

/* --- Mobile --- */
@media (max-width: 640px) {
  .tsb-consent-inner {
    padding: 16px;
    gap: 12px;
  }
  .tsb-consent-actions {
    width: 100%;
    flex-direction: column-reverse;
  }
  .tsb-consent-actions .tsb-btn {
    width: 100%;
  }
  .tsb-consent-revoke {
    bottom: 8px;
    left: 8px;
    font-size: 11px;
    padding: 7px 10px;
  }
}

/* --- Rispetto preferenze movimento --- */
@media (prefers-reduced-motion: reduce) {
  .tsb-consent-banner {
    transition: none;
  }
}

/* --- Documenti privacy --- */
.tsb-privacy-doc,
.tsb-cookie-doc {
  max-width: 780px;
}

.tsb-privacy-doc h2,
.tsb-cookie-doc h2 {
  margin-top: 1.8em;
  font-size: 1.2em;
}

.tsb-privacy-doc h3,
.tsb-cookie-doc h3 {
  margin-top: 1.3em;
  font-size: 1.05em;
}

.tsb-privacy-doc ul,
.tsb-cookie-doc ul {
  padding-left: 1.3em;
}

.tsb-privacy-doc li,
.tsb-cookie-doc li {
  margin-bottom: 0.4em;
}

/* --- Email offuscata (anti-spam) --- */
.tsb-email-obf a,
.tsb-email-link {
  color: #f59e0b;
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-word;
}

.tsb-email-obf a:hover,
.tsb-email-link:hover {
  color: #fbbf24;
}

.tsb-email-obf[data-tsb-ready="0"] > span[aria-hidden="true"] {
  color: #94a3b8;
  font-style: italic;
}
