/* Cookie banner Tarocchi.click — nero, testo bianco, pulsanti blu */
#tc-cc {
  --tc-bg: #000;
  --tc-panel: #0a0a0a;
  --tc-line: #2a2a2a;
  --tc-text: #fff;
  --tc-muted: #d1d5db;
  --tc-blue: #1d4ed8;
  --tc-blue-hover: #1e40af;
  --tc-link: #93c5fd;
  --tc-focus: #60a5fa;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--tc-text);
}
#tc-cc [hidden] { display: none !important; }
#tc-cc *, #tc-cc *::before, #tc-cc *::after { box-sizing: border-box; }
#tc-cc a { color: var(--tc-link); text-decoration: underline; text-underline-offset: 2px; }
#tc-cc a:hover { color: #fff; }
#tc-cc button { font: inherit; }
#tc-cc :focus-visible { outline: 3px solid var(--tc-focus); outline-offset: 2px; }

.tc-title { margin: 0 0 6px; font-size: 1.1rem; font-weight: 700; color: var(--tc-text); }

/* ---------- Banner ---------- */
.tc-banner {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 2147483000;
  background: var(--tc-bg); color: var(--tc-text);
  border-top: 1px solid var(--tc-line);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, .55);
  padding: 20px 56px calc(20px + env(safe-area-inset-bottom)) 24px;
  animation: tc-up .3s ease-out;
}
.tc-banner-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; gap: 28px;
}
.tc-banner-text { flex: 1 1 auto; }
.tc-banner-text p { margin: 0; font-size: .95rem; color: var(--tc-muted); }
.tc-banner-text .tc-title { color: var(--tc-text); font-size: 1.1rem; margin-bottom: 6px; }
.tc-actions { flex: 0 0 auto; display: flex; gap: 10px; }

.tc-btn {
  appearance: none; cursor: pointer;
  background: var(--tc-blue); color: #fff;
  border: 2px solid var(--tc-blue); border-radius: 8px;
  padding: 11px 18px; min-height: 46px;
  font-size: .95rem; font-weight: 700; line-height: 1.2;
  white-space: nowrap; text-align: center;
  transition: background-color .15s ease, border-color .15s ease;
}
.tc-btn:hover { background: var(--tc-blue-hover); border-color: var(--tc-blue-hover); }

.tc-x {
  position: absolute; top: 10px; right: 10px;
  width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
  background: transparent; color: #fff; border: 0; border-radius: 8px; cursor: pointer;
}
.tc-x:hover { background: #1f1f1f; }
.tc-x-static { position: static; flex: 0 0 auto; }

/* ---------- Pulsante di richiamo (in basso a destra) ---------- */
.tc-reopen {
  position: fixed; z-index: 2147482000;
  right: 16px; bottom: calc(16px + env(safe-area-inset-bottom));
  width: 50px; height: 50px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--tc-bg); color: #fff;
  border: 2px solid var(--tc-blue);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .5);
  cursor: pointer; transition: background-color .15s ease, transform .15s ease;
}
.tc-reopen:hover { background: var(--tc-blue); transform: scale(1.06); }

/* ---------- Pannello preferenze ---------- */
.tc-modal {
  position: fixed; inset: 0; z-index: 2147483001;
  display: flex; align-items: center; justify-content: center; padding: 12px;
}
.tc-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .7); }
.tc-panel {
  position: relative; width: min(680px, 100%); max-height: min(90vh, 820px);
  display: flex; flex-direction: column;
  background: var(--tc-panel); color: var(--tc-text);
  border: 1px solid var(--tc-line); border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .7);
  animation: tc-fade .2s ease-out;
}
.tc-panel:focus { outline: none; }
.tc-panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 16px 12px 22px; border-bottom: 1px solid var(--tc-line);
}
.tc-panel-head .tc-title { margin: 0; font-size: 1.2rem; }
.tc-panel-body { padding: 16px 22px; overflow-y: auto; overscroll-behavior: contain; }
.tc-panel-body > p { margin: 0 0 14px; color: var(--tc-muted); font-size: .95rem; }
.tc-panel-foot {
  display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap;
  padding: 14px 22px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--tc-line);
}

.tc-cat { border: 1px solid var(--tc-line); border-radius: 10px; padding: 14px 16px; margin-bottom: 12px; background: #000; }
.tc-cat-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tc-cat-title { margin: 0; font-weight: 700; font-size: 1rem; }
.tc-cat-desc { margin: 6px 0 8px; color: var(--tc-muted); font-size: .9rem; }
.tc-always { font-size: .85rem; font-weight: 700; color: var(--tc-link); white-space: nowrap; }

.tc-details summary { cursor: pointer; color: var(--tc-link); font-size: .88rem; font-weight: 600; }
.tc-details summary:hover { color: #fff; }
.tc-services { margin: 10px 0 0; padding-left: 18px; font-size: .85rem; color: var(--tc-muted); }
.tc-services > li { margin-bottom: 10px; }
.tc-services ul { margin: 4px 0; padding-left: 16px; }
.tc-services code, .tc-consent-id code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .82rem; background: #1a1a1a; color: #fff; padding: 1px 5px; border-radius: 4px;
}
.tc-consent-id { font-size: .85rem; color: var(--tc-muted); word-break: break-all; }

/* Interruttore */
.tc-switch { position: relative; display: inline-block; width: 48px; height: 28px; flex: 0 0 auto; }
.tc-switch input {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0;
  opacity: 0; cursor: pointer; z-index: 1;
}
.tc-slider {
  position: absolute; inset: 0; border-radius: 28px; background: #4b5563;
  transition: background-color .15s ease;
}
.tc-slider::before {
  content: ""; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px;
  border-radius: 50%; background: #fff; transition: transform .15s ease;
}
.tc-switch input:checked + .tc-slider { background: var(--tc-blue); }
.tc-switch input:checked + .tc-slider::before { transform: translateX(20px); }
.tc-switch input:focus-visible + .tc-slider { outline: 3px solid var(--tc-focus); outline-offset: 2px; }

html.tc-lock, html.tc-lock body { overflow: hidden; }

@keyframes tc-up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes tc-fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .tc-banner-inner { flex-direction: column; align-items: stretch; gap: 14px; }
  .tc-actions { width: 100%; }
  .tc-actions .tc-btn { flex: 1 1 0; }
}
@media (max-width: 600px) {
  .tc-banner { padding: 16px 16px calc(14px + env(safe-area-inset-bottom)); }
  .tc-banner-text { padding-right: 34px; }
  .tc-banner-text p { font-size: .84rem; line-height: 1.45; }
  .tc-banner-text .tc-title { font-size: 1rem; }
  .tc-x { top: 6px; right: 6px; }
  .tc-actions { gap: 8px; }
  .tc-btn { padding: 10px 6px; font-size: .86rem; min-height: 44px; }
  .tc-panel { max-height: 94vh; }
  .tc-panel-body { padding: 14px 16px; }
  .tc-panel-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
  .tc-panel-foot { gap: 8px; }
  .tc-panel-foot .tc-btn { flex: 1 1 calc(50% - 4px); padding: 10px 6px; min-height: 44px; }
  .tc-panel-foot [data-tc="save"] { order: -1; flex-basis: 100%; }
  .tc-reopen { right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); width: 46px; height: 46px; }
}
@media (max-width: 340px) {
  .tc-actions { flex-wrap: wrap; }
  .tc-actions .tc-btn { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .tc-banner, .tc-panel { animation: none; }
  .tc-btn, .tc-reopen, .tc-slider, .tc-slider::before { transition: none; }
}
