/* ==========================================================================
   SocialAnime Translations — design system in the style of socialanime.it:
   light grey canvas (#f1f1f1), white rounded cards with a soft shadow,
   Open Sans, grey letter-spaced navigation, SocialAnime blue (#3591cc).
   Light is the default; dark only when the visitor picks it.
   ========================================================================== */

:root {
  --f: 'Open Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-label: 'Open Sans', ui-sans-serif, system-ui, sans-serif;
  --f-code: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --f-mono: var(--f-label);
  --f-jp: 'Noto Sans JP', 'Hiragino Sans', 'Yu Gothic', sans-serif;
  --wrap: 1250px;
  --gut: clamp(14px, 3vw, 32px);
  --hdr-h: 60px;
  --rad: 10px;
  --rad-s: 6px;
  --r: 6px;
  --cut: 0px;
  --cut-s: 0px;
  --ease: cubic-bezier(.2, .7, .1, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --t: .2s var(--ease);

  color-scheme: light;
  --bg: #f1f1f1;
  --bg-2: #f1f1f1;
  --s1: #ffffff;
  --s2: #f5f5f5;
  --s3: #ebebeb;
  --line: rgba(0, 0, 0, .07);
  --line-2: rgba(0, 0, 0, .1);
  --line-3: rgba(0, 0, 0, .2);
  --ink: #202020;
  --ink-2: #555555;
  --ink-3: #808080;
  --ink-4: #b3b3b3;
  --dot: transparent;
  --card-sh: 0 1px 3px rgba(0, 0, 0, .12), 0 1px 2px rgba(0, 0, 0, .24);
  --shadow: 0 10px 30px rgba(0, 0, 0, .18), 0 2px 6px rgba(0, 0, 0, .08);
  --glass: #ffffff;
  --acc: #3591cc;
  --acc-ink: #ffffff;
  --acc-t: #2b80b8;
  --acc-2: #e8743b;
  --ok: #2e9d5b;
  --bad: #d93838;
  --warn: #d98a12;
  --tex: none;
  --head: #404040;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #18191a; --bg-2: #18191a; --s1: #242526; --s2: #2f3031; --s3: #3a3b3c;
  --line: rgba(255, 255, 255, .07); --line-2: rgba(255, 255, 255, .12); --line-3: rgba(255, 255, 255, .22);
  --ink: #e4e6eb; --ink-2: #b9bbbf; --ink-3: #8a8d91; --ink-4: #5d6064;
  --card-sh: 0 1px 3px rgba(0, 0, 0, .5); --shadow: 0 10px 30px rgba(0, 0, 0, .6); --glass: #242526;
  --acc: #3591cc; --acc-ink: #ffffff; --acc-t: #5fb0e6; --acc-2: #f0874f;
  --ok: #4cc27f; --bad: #f06464; --warn: #f0a63a; --head: #e4e6eb;
}

/* ---- base ----------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--hdr-h) + 20px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 15px/1.55 var(--f); -webkit-font-smoothing: antialiased; min-height: 100vh; overflow-x: clip; }
::selection { background: var(--acc); color: #fff; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: 600; line-height: 1.25; color: var(--head); }
p { margin: 0 0 .8em; }
p:last-child { margin-bottom: 0; }
ul, ol { margin: 0; }
code, kbd, pre { font-family: var(--f-code); }
code { font-size: .86em; padding: 1px 6px; background: var(--s2); border: 1px solid var(--line); border-radius: 4px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
.sr-only, .visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.fa, .fas, .far, .fab { line-height: 1; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--ink-4); border: 3px solid var(--bg); border-radius: 8px; }

/* form controls (every page, also the ones the scripts build) */
input[type="text"], input[type="password"], input[type="email"], input[type="number"], input[type="search"],
input[type="date"], input[type="url"], input:not([type]), textarea, select {
  width: 100%; min-height: 40px; padding: 8px 12px;
  background: var(--s1); color: var(--ink); border: 1px solid var(--line-2); border-radius: var(--rad-s);
  font-size: 14px; line-height: 1.4; outline: none; transition: border-color var(--t), box-shadow var(--t);
}
textarea { min-height: 96px; resize: vertical; }
select {
  appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%23808080' stroke-width='1.6'%3E%3Cpath d='M3 4.5l3 3 3-3'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 12px;
}
select option { background: var(--s1); color: var(--ink); }
input::placeholder, textarea::placeholder { color: var(--ink-3); }
input:hover, textarea:hover, select:hover { border-color: var(--line-3); }
input:focus, textarea:focus, select:focus { border-color: var(--acc); box-shadow: 0 0 0 3px color-mix(in srgb, var(--acc) 18%, transparent); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--acc); width: 16px; height: 16px; cursor: pointer; }
input[type="range"] { accent-color: var(--acc); width: 100%; }
input[type="file"] { font-size: 13px; color: var(--ink-2); max-width: 100%; }
input[type="file"]::file-selector-button { margin-right: 12px; padding: 7px 14px; border: 0; border-radius: var(--rad-s); background: var(--s3); color: var(--ink); font: 600 13px var(--f); cursor: pointer; }
label { font-size: 13px; }

/* ---- type ----------------------------------------------------------------- */
.sx-wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gut); }
.sx-mono { font-family: var(--f-code); }
.sx-muted { color: var(--ink-3); }
/* small letter-spaced label, like "TRAILER e VIDEO PROMOZIONALI" on socialanime.it */
.sx-kicker { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; font: 600 12px/1.2 var(--f-label); text-transform: uppercase; letter-spacing: 1.5px; color: var(--ink-3); }
.sx-kicker b { color: var(--acc); font-weight: 600; }
/* the blue "Novità" tag */
.sx-live { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 20px; font: 600 11px/1.6 var(--f); letter-spacing: .3px; text-transform: none; color: #fff; background: var(--acc); }
.sx-live i { display: none; }
.sx-h1 { font-size: clamp(30px, 4vw, 48px); font-weight: 600; line-height: 1.12; color: var(--head); text-wrap: balance; }
.sx-h1.is-xl { font-size: clamp(34px, 5vw, 56px); }
.sx-h2 { font-size: clamp(22px, 2.4vw, 28px); font-weight: 400; line-height: 1.2; color: var(--head); text-wrap: balance; }
.sx-h3 { font-size: 17px; font-weight: 600; }
.sx-lead { color: var(--ink-2); font-size: clamp(15px, 1.2vw, 17px); max-width: 62ch; margin-top: 14px; }
.sx-hl { color: var(--acc); }
.sx-jp { font-family: var(--f-jp); }

/* ---- buttons ---------------------------------------------------------------- */
.sx-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 18px;
  font: 600 14px/1 var(--f); white-space: nowrap; color: #fff; background: var(--acc); border: 0; border-radius: var(--rad-s);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .18); transition: background var(--t), box-shadow var(--t), transform .12s; cursor: pointer;
}
.sx-btn:hover { background: color-mix(in srgb, var(--acc) 88%, #000); box-shadow: 0 2px 6px rgba(0, 0, 0, .2); }
.sx-btn:active { transform: translateY(1px); }
.sx-btn[disabled], .sx-btn.is-off { opacity: .5; pointer-events: none; }
.sx-btn .fas, .sx-btn .far, .sx-btn .fab { font-size: 14px; }
.sx-btn.is-acc { background: var(--acc); color: #fff; }
/* white pill with shadow, like "Post e attività" */
.sx-btn.is-ghost, .sx-btn:not(.is-acc):not(.is-bad) { background: var(--s1); color: var(--ink-2); box-shadow: var(--card-sh); }
.sx-btn.is-ghost:hover, .sx-btn:not(.is-acc):not(.is-bad):hover { background: var(--s2); color: var(--ink); }
.sx-btn.is-bad { background: var(--s1); color: var(--bad); box-shadow: var(--card-sh); }
.sx-btn.is-bad:hover { background: color-mix(in srgb, var(--bad) 8%, var(--s1)); }
.sx-btn.is-lg { height: 46px; padding: 0 24px; font-size: 15px; }
.sx-btn.is-sm { height: 34px; padding: 0 13px; font-size: 13px; }
.sx-btn.is-icon { width: 40px; padding: 0; }
.sx-iconbtn { position: relative; display: inline-grid; place-items: center; width: 38px; height: 38px; color: var(--ink-3); border-radius: 50%; font-size: 18px; transition: background var(--t), color var(--t); }
.sx-iconbtn:hover { background: var(--s2); color: var(--ink); }

/* ---- chips, tags ------------------------------------------------------------ */
.sx-tag { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 20px; font: 600 11.5px/1 var(--f); color: var(--ink-2); background: var(--s3); }
.sx-tag.is-acc { color: var(--acc-t); background: color-mix(in srgb, var(--acc) 12%, var(--s1)); }
.sx-tag.is-ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, var(--s1)); }
.sx-tag.is-warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, var(--s1)); }

/* ---- cards (the white module of socialanime.it) ------------------------------ */
.sx-panel { position: relative; background: var(--s1); border-radius: var(--rad); box-shadow: var(--card-sh); }
.sx-panel-h { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.sx-panel-b { padding: 16px; }
.sx-lit { transition: box-shadow var(--t), transform var(--t); }
.sx-lit:hover { box-shadow: 0 4px 14px rgba(0, 0, 0, .14), 0 1px 3px rgba(0, 0, 0, .1); }
.sx-plus { display: none; }
.sx-phead { padding: 28px 0 18px; }

/* stat readout */
.sx-read { padding: 4px 0; }
.sx-read b { display: block; font: 600 clamp(24px, 2.4vw, 30px)/1.1 var(--f); color: var(--head); font-variant-numeric: tabular-nums; }
.sx-read small { display: block; margin-top: 4px; font: 400 13px/1.3 var(--f); color: var(--ink-3); }

/* ---- header (public pages): white bar like socialanime.it ------------------- */
.sx-hdr { position: sticky; top: 0; z-index: 60; height: var(--hdr-h); background: var(--glass); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.sx-hdr-in { height: 100%; display: flex; align-items: center; gap: 18px; }
.sx-brand { display: flex; align-items: center; gap: 10px; flex: none; color: var(--ink); }
.sx-brand-m { width: 35px; height: 35px; flex: none; border-radius: 7px; display: block; object-fit: cover; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); }
.sx-brand-t { display: flex; flex-direction: column; line-height: 1.05; }
.sx-brand-t b { font-size: 15px; font-weight: 700; color: var(--head); white-space: nowrap; }
.sx-brand-t small { font-size: 11.5px; color: var(--ink-3); letter-spacing: .5px; white-space: nowrap; }
.sx-nav { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.sx-nav a { display: inline-flex; align-items: center; height: 36px; padding: 0 9px; font-size: 14px; color: var(--ink-3); border-radius: var(--rad-s); transition: color var(--t); }
.sx-nav a:hover { color: var(--ink); }
.sx-nav a.is-on { color: var(--acc); }
.sx-hdr-tools { display: flex; align-items: center; gap: 8px; }
.sx-nav + .sx-hdr-tools { margin-left: 6px; }
.sx-hdr-in > .sx-brand + .sx-hdr-tools { margin-left: auto; }
.sx-burger { display: none; }
.sx-sheet { display: none; }
@media (max-width: 880px) {
  .sx-hdr { background: var(--acc); }
  .sx-hdr .sx-brand-t b, .sx-hdr .sx-brand-t small, .sx-hdr .sx-iconbtn { color: #fff; }
  .sx-hdr .sx-iconbtn:hover { background: rgba(255, 255, 255, .15); }
  .sx-nav, .sx-hdr-tools .sx-hide-m { display: none; }
  .sx-hdr-tools { margin-left: auto; }
  .sx-burger { display: inline-grid; }
  .sx-sheet { position: fixed; z-index: 59; left: 0; right: 0; top: var(--hdr-h); display: block; padding: 8px var(--gut) 18px; background: var(--s1); box-shadow: var(--shadow); transform: translateY(-8px); opacity: 0; pointer-events: none; transition: transform var(--t), opacity var(--t); }
  .sx-sheet.is-open { transform: none; opacity: 1; pointer-events: auto; }
  .sx-sheet a:not(.sx-btn) { display: flex; align-items: center; gap: 12px; padding: 13px 4px; border-bottom: 1px solid var(--line); color: var(--ink-2); font-size: 14px; letter-spacing: 1px; }
  .sx-sheet a:not(.sx-btn) i { color: var(--ink-3); width: 18px; }
  .sx-sheet .sx-row { margin-top: 14px; }
  .sx-sheet .sx-row .sx-btn { flex: 1; }
}
.sx-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* ---- footer: a white card with columns, then a row of small links ---------- */
.sx-foot { margin-top: clamp(40px, 6vw, 64px); padding-bottom: 20px; }
.sx-foot > .sx-wrap { max-width: var(--wrap); }
.sx-foot-top { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 28px; padding: 22px 20px; background: var(--s1); border-radius: var(--rad); box-shadow: var(--card-sh); }
.sx-foot-about p { color: var(--ink-3); font-size: 13px; margin-top: 12px; max-width: 40ch; }
.sx-foot-soc { display: flex; gap: 6px; margin-top: 14px; }
.sx-foot-soc a { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--s2); color: var(--ink-3); transition: color var(--t), background var(--t); }
.sx-foot-soc a:hover { color: #fff; background: var(--acc); }
.sx-foot h4 { font-size: 14px; font-weight: 600; color: var(--ink); margin-bottom: 12px; }
.sx-foot ul { list-style: none; padding: 0; display: grid; gap: 9px; }
.sx-foot ul a { font-size: 13px; color: var(--ink-3); }
.sx-foot ul a:hover { color: var(--acc); }
.sx-foot-bar { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 14px 20px 0; font-size: 11.5px; color: var(--ink-3); }
.sx-foot-bar a:hover { color: var(--acc); }
.sx-foot-bar .sx-theme { margin-left: auto; }
@media (max-width: 860px) { .sx-foot-top { grid-template-columns: 1fr 1fr; } .sx-foot-about { grid-column: 1 / -1; } }

.sx-theme { display: inline-flex; padding: 3px; gap: 2px; border-radius: 20px; background: var(--s1); box-shadow: var(--card-sh); }
.sx-theme button { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 11px; border-radius: 20px; font: 600 11.5px/1 var(--f); color: var(--ink-3); }
.sx-theme button:hover { color: var(--ink); }
.sx-theme button[aria-pressed="true"] { background: var(--acc); color: #fff; }

/* ---- reveal (fadeIn, like the animate.css on socialanime.it) ---------------- */
@media (prefers-reduced-motion: no-preference) {
  .sx-rv { opacity: 0; transition: opacity .5s ease-out; transition-delay: var(--d, 0s); }
  .sx-rv.is-in { opacity: 1; transform: none; }
}

/* ---- toasts ---------------------------------------------------------------- */
.sx-toasts { position: fixed; right: 18px; bottom: 18px; z-index: 3000; display: grid; gap: 8px; }
.sx-toast { display: flex; align-items: center; gap: 10px; min-width: 240px; max-width: 380px; padding: 12px 16px; background: var(--s1); border-radius: var(--rad); box-shadow: var(--shadow); font-size: 14px; border-left: 4px solid var(--acc); animation: sx-toast .3s var(--ease-out); }
.sx-toast.is-ok { border-left-color: var(--ok); }
.sx-toast.is-bad { border-left-color: var(--bad); }
.sx-toast i { color: var(--acc); }
.sx-toast.is-ok i { color: var(--ok); }
.sx-toast.is-bad i { color: var(--bad); }
@keyframes sx-toast { from { opacity: 0; transform: translateY(8px); } }

.spinner-border, .sx-spin { display: inline-block; width: 26px; height: 26px; border: 3px solid var(--s3); border-top-color: var(--acc); border-radius: 50%; animation: sx-rot .7s linear infinite; vertical-align: middle; }
.spinner-border-sm { width: 16px; height: 16px; border-width: 2px; }
@keyframes sx-rot { to { transform: rotate(360deg); } }

/* ---- Bootstrap behaviour the scripts still rely on ---------------------- */
.collapse:not(.show) { display: none; }
.collapsing { height: 0; overflow: hidden; transition: height .28s var(--ease); }
.dropdown-menu { display: none; }
.dropdown-menu.show { display: block; }
.d-flex { display: flex; }
.align-items-center { align-items: center; }
.text-center { text-align: center; }
.ml-2 { margin-left: 8px; }
.mt-3 { margin-top: 14px; }
.text-success { color: var(--ok) !important; }
.text-warning { color: var(--warn) !important; }
.text-primary { color: var(--acc) !important; }

/* ---- SweetAlert2: the site dialog ------------------------------------------- */
.swal2-container { z-index: 4000 !important; }
.swal2-container.swal2-backdrop-show { background: rgba(0, 0, 0, .45) !important; }
div.swal2-popup { background: var(--s1) !important; color: var(--ink) !important; border-radius: 12px !important; box-shadow: var(--shadow) !important; font-family: var(--f) !important; }
.swal2-title { color: var(--head) !important; font: 600 21px/1.3 var(--f) !important; }
.swal2-html-container { color: var(--ink-2) !important; font-size: 15px !important; }
.swal2-styled { border-radius: var(--rad-s) !important; font: 600 14px var(--f) !important; padding: 10px 22px !important; box-shadow: none !important; }
.swal2-styled.swal2-confirm { background: var(--acc) !important; color: #fff !important; }
.swal2-styled.swal2-cancel, .swal2-styled.swal2-deny { background: var(--s3) !important; color: var(--ink) !important; }
.swal2-input, .swal2-textarea, .swal2-select, .swal2-file { background: var(--s1) !important; color: var(--ink) !important; border: 1px solid var(--line-2) !important; border-radius: var(--rad-s) !important; box-shadow: none !important; font-size: 14px !important; }
.swal2-timer-progress-bar { background: var(--acc) !important; }

.sx-skip { position: fixed; left: 12px; top: -60px; z-index: 200; background: var(--acc); color: #fff; padding: 10px 14px; font-weight: 600; border-radius: var(--rad-s); }
.sx-skip:focus { top: 12px; }

/* chart series (validated with the dataviz palette checks) */
:root { --ch-1: #0a8fd6; --ch-2: #b86e00; --ch-3: #6d5cf0; --ch-4: #d93a74; }
:root[data-theme="dark"] { --ch-1: #2f9fe0; --ch-2: #d68c22; --ch-3: #8b7bff; --ch-4: #ee5f8e; }
