/* =====================================================================
   RecensioniCartomanti.com — foglio di stile pubblico ("Elegante chiaro")
   ===================================================================== */

@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Playfair Display";
  src: url("../fonts/playfair-display-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #faf8fd;
  --surface: #ffffff;
  --surface-2: #f5f1fb;
  --text: #1e1a2b;
  --text-2: #463f56;
  --muted: #6b6480;
  --border: #e8e2f1;
  --border-strong: #d6cce6;
  --primary: #4c1d95;
  --primary-600: #5b21b6;
  --primary-700: #3b1475;
  --primary-50: #f4f0fc;
  --primary-100: #e9e0fb;
  --gold: #e0a019;
  --gold-dark: #8f6008;
  --gold-50: #fdf6e5;
  --star-empty: #ddd5ea;
  --bar: #b7791f;
  --bar-track: #f3e8d2;
  --success: #15803d;
  --success-bg: #ecfdf3;
  --danger: #b42318;
  --danger-bg: #fef3f2;
  --warning: #b54708;
  --warning-bg: #fffaeb;
  --info: #1d4ed8;
  --info-bg: #eff6ff;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 22px;
  --shadow: 0 1px 2px rgba(31, 16, 64, .05), 0 6px 18px rgba(31, 16, 64, .06);
  --shadow-lg: 0 14px 36px rgba(31, 16, 64, .14);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Playfair Display", Georgia, "Times New Roman", serif;
  --container: 1180px;
  --header-h: 68px;
  /* cookie banner: nero, testo bianco, pulsanti blu */
  --cc-bg: #000000;
  --cc-text: #ffffff;
  --cc-muted: #d4d4d8;
  --cc-btn: #2563eb;
  --cc-btn-hover: #1d4ed8;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; height: auto; }
img { display: block; }
a { color: var(--primary-600); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--primary-700); }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .6em; color: var(--text); }
h1, h2 { font-family: var(--font-display); font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: clamp(1.85rem, 1.2rem + 2.4vw, 2.8rem); }
h2 { font-size: clamp(1.45rem, 1.1rem + 1.2vw, 1.95rem); }
h3 { font-size: 1.15rem; font-weight: 650; }
p { margin: 0 0 1em; }
ul, ol { padding-left: 1.25em; }
hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }
:focus-visible { outline: 3px solid #8b5cf6; outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--primary-100); }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.container-narrow { max-width: 760px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -60px; background: var(--primary); color: #fff; padding: 10px 16px; border-radius: 8px; z-index: 1000; }
.skip-link:focus { top: 12px; color: #fff; }
.hp-field { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0 !important; } .mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; } .mt-4 { margin-top: 2.5rem; }
.mb-0 { margin-bottom: 0 !important; } .mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; }
.flex { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.flex-between { display: flex; gap: 1rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }

/* ---------------------------------------------------------------- pulsanti */
.btn {
  --btn-bg: var(--surface); --btn-fg: var(--text); --btn-bd: var(--border-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 42px; padding: .55rem 1.1rem;
  font: 600 .95rem/1.2 var(--font); color: var(--btn-fg); background: var(--btn-bg);
  border: 1px solid var(--btn-bd); border-radius: 999px; cursor: pointer; text-decoration: none;
  transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s, transform .15s;
  white-space: nowrap;
}
.btn:hover { color: var(--btn-fg); box-shadow: var(--shadow); }
.btn:active { transform: translateY(1px); }
.btn-primary { --btn-bg: var(--primary); --btn-fg: #fff; --btn-bd: var(--primary); }
.btn-primary:hover { --btn-bg: var(--primary-600); --btn-bd: var(--primary-600); }
.btn-gold { --btn-bg: var(--gold); --btn-fg: #2b1a00; --btn-bd: var(--gold); }
.btn-gold:hover { --btn-bg: #f0b024; }
.btn-outline { --btn-bg: transparent; --btn-fg: var(--primary); --btn-bd: var(--primary-100); }
.btn-outline:hover { --btn-bg: var(--primary-50); }
.btn-ghost { --btn-bg: transparent; --btn-fg: var(--text-2); --btn-bd: transparent; }
.btn-ghost:hover { --btn-bg: var(--primary-50); box-shadow: none; }
.btn-danger { --btn-bg: var(--danger); --btn-fg: #fff; --btn-bd: var(--danger); }
.btn-sm { min-height: 36px; padding: .4rem .9rem; font-size: .875rem; }
.btn-lg { min-height: 52px; padding: .8rem 1.6rem; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-disabled { opacity: .55; pointer-events: none; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--primary-600); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* ---------------------------------------------------------------- header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 1.25rem; min-height: var(--header-h); }
.brand img { width: 232px; height: auto; }
.site-nav { display: flex; align-items: center; gap: 1rem; flex: 1; }
.nav-links { display: flex; gap: .15rem; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  display: block; padding: .5rem .75rem; border-radius: 999px;
  color: var(--text-2); font-weight: 550; font-size: .95rem; text-decoration: none;
}
.nav-links a:hover { background: var(--primary-50); color: var(--primary); }
.nav-links a[aria-current="page"] { color: var(--primary); background: var(--primary-50); }
.nav-search { position: relative; margin-left: auto; }
.nav-search input, .nav-search input[type="search"] {
  width: 210px; height: 40px; min-height: 40px; padding: 0 2.6rem 0 1rem;
  border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface-2);
  font: inherit; font-size: .9rem; color: var(--text); transition: width .2s, background .2s, border-color .2s;
}
.nav-search input:focus, .nav-search input[type="search"]:focus { outline: none; width: 250px; background: #fff; border-color: var(--primary-600); box-shadow: 0 0 0 3px var(--primary-100); }
.nav-search button { position: absolute; right: 4px; top: 4px; width: 32px; height: 32px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.nav-search button:hover { color: var(--primary); }
.nav-account { display: flex; align-items: center; gap: .4rem; }
.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--border); border-radius: 10px; width: 44px; height: 44px; color: var(--text); cursor: pointer; }
.avatar-xs { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; color: #fff; font-size: .7rem; font-weight: 700; }

@media (max-width: 1020px) {
  .nav-toggle { display: grid; place-items: center; }
  .site-nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: .75rem;
    padding: 1rem 20px 1.25rem; background: #fff; border-bottom: 1px solid var(--border); box-shadow: var(--shadow-lg);
  }
  .site-nav.is-open { display: flex; }
  .nav-links { flex-direction: column; }
  .nav-links a { padding: .7rem .9rem; font-size: 1rem; }
  .nav-search { margin-left: 0; }
  .nav-search input, .nav-search input[type="search"], .nav-search input[type="search"]:focus { width: 100%; }
  .nav-account { justify-content: flex-start; flex-wrap: wrap; }
}
@media (max-width: 420px) { .brand img { width: 190px; } }

/* ---------------------------------------------------------------- avvisi */
.flash-wrap { padding-top: 1rem; }
.alert { padding: .85rem 1.1rem; border-radius: var(--radius-sm); border: 1px solid; margin-bottom: .75rem; font-size: .95rem; }
.alert-success { background: var(--success-bg); border-color: #abefc6; color: #085d3a; }
.alert-error { background: var(--danger-bg); border-color: #fecdca; color: #912018; }
.alert-warning { background: var(--warning-bg); border-color: #fedf89; color: #93370d; }
.alert-info { background: var(--info-bg); border-color: #bfdbfe; color: #1e3a8a; }

/* ---------------------------------------------------------------- hero */
.hero {
  position: relative; overflow: hidden;
  padding: clamp(2.5rem, 5vw, 4.5rem) 0 clamp(2.25rem, 4vw, 3.5rem);
  background:
    radial-gradient(1100px 420px at 85% -10%, rgba(139, 92, 246, .16), transparent 60%),
    radial-gradient(800px 380px at -5% 110%, rgba(224, 160, 25, .12), transparent 60%),
    linear-gradient(180deg, #f7f2ff 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
}
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .55;
  background-image:
    radial-gradient(circle at 12% 30%, #c4b5fd 1.2px, transparent 1.6px),
    radial-gradient(circle at 78% 22%, #fcd34d 1.4px, transparent 1.8px),
    radial-gradient(circle at 62% 70%, #c4b5fd 1px, transparent 1.4px),
    radial-gradient(circle at 30% 80%, #fcd34d 1px, transparent 1.4px),
    radial-gradient(circle at 90% 60%, #ddd6fe 1.2px, transparent 1.6px);
  background-size: 340px 260px;
}
.hero .container { position: relative; }
.hero-eyebrow, .eyebrow {
  display: inline-flex; align-items: center; gap: .45rem;
  font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-dark);
  margin-bottom: .75rem;
}
.hero h1 { max-width: 820px; margin-bottom: .5em; }
.hero-lead { max-width: 680px; font-size: 1.12rem; color: var(--text-2); }
.hero-search { display: flex; gap: .5rem; max-width: 640px; margin: 1.6rem 0 1.25rem; padding: 6px; background: #fff; border: 1px solid var(--border-strong); border-radius: 999px; box-shadow: var(--shadow-lg); }
.hero-search input, .hero-search input[type="search"] { flex: 1; min-width: 0; min-height: 48px; border: 0; border-radius: 999px; background: transparent; padding: 0 1rem; font: inherit; font-size: 1.05rem; color: var(--text); box-shadow: none; }
.hero-search input:focus, .hero-search input[type="search"]:focus { outline: none; box-shadow: none; }
.hero-search:focus-within { border-color: var(--primary-600); box-shadow: 0 0 0 3px var(--primary-100), var(--shadow-lg); }
.hero-search .btn { min-height: 48px; }
.hero-hints { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; font-size: .9rem; color: var(--muted); }
.chip {
  display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .75rem;
  background: #fff; border: 1px solid var(--border); border-radius: 999px;
  font-size: .85rem; font-weight: 550; color: var(--text-2); text-decoration: none;
}
a.chip:hover { border-color: var(--primary-100); background: var(--primary-50); color: var(--primary); }
.hero-stats { display: flex; flex-wrap: wrap; gap: 2rem; margin-top: 2rem; }
.hero-stat strong { display: block; font-size: 1.7rem; font-weight: 700; color: var(--primary); line-height: 1.1; font-variant-numeric: tabular-nums; }
.hero-stat span { font-size: .875rem; color: var(--muted); }

/* ---------------------------------------------------------------- sezioni */
.section { padding: clamp(2rem, 4vw, 3.25rem) 0; }
.section-alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.4rem; }
.section-head h2 { margin: 0; }
.section-head p { margin: .35rem 0 0; color: var(--muted); }
.section-link { font-weight: 600; text-decoration: none; white-space: nowrap; }
.section-link::after { content: " →"; }
.page-head { padding: 2rem 0 1.25rem; }
.page-head h1 { margin-bottom: .35em; }
.page-head p { color: var(--text-2); max-width: 760px; }
.empty-state { padding: 2rem; text-align: center; background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius); color: var(--muted); }
.empty-state .btn { margin-top: .75rem; }

/* ---------------------------------------------------------------- griglie e card */
.grid { display: grid; gap: 1.1rem; }
.grid-cards { grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow); }
.card h2, .card h3 { margin-top: 0; }
.card-title { font-size: 1.05rem; font-weight: 700; margin-bottom: .75rem; font-family: var(--font); }

.cm-card {
  position: relative; display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 1.4rem 1rem 1.1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text); text-decoration: none; transition: transform .18s, box-shadow .18s, border-color .18s;
}
.cm-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--primary-100); color: var(--text); }
.cm-card .avatar { margin-bottom: .8rem; }
.cm-name { font-weight: 700; font-size: 1.05rem; line-height: 1.25; }
.cm-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: .35rem; margin: .45rem 0 .65rem; }
.cm-site { font-size: .82rem; color: var(--muted); }
.cm-rating { display: flex; align-items: center; justify-content: center; gap: .4rem; margin-top: auto; font-size: .875rem; color: var(--text-2); }
.cm-rating strong { font-variant-numeric: tabular-nums; }
.cm-rating .muted { font-size: .8rem; }
.cm-badges { position: absolute; top: .6rem; left: .6rem; right: .6rem; display: flex; justify-content: space-between; pointer-events: none; }
.code-chip { display: inline-block; padding: .12rem .6rem; background: var(--primary-50); color: var(--primary); border-radius: 999px; font-size: .78rem; font-weight: 700; letter-spacing: .02em; font-variant-numeric: tabular-nums; }

.avatar {
  --size: 72px;
  width: var(--size); height: var(--size); border-radius: 50%; flex: 0 0 var(--size);
  display: grid; place-items: center; overflow: hidden;
  color: #fff; font-weight: 700; font-size: calc(var(--size) * .38); letter-spacing: .02em;
  box-shadow: 0 0 0 3px #fff, 0 0 0 4px var(--border);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { --size: 40px; }
.avatar-md { --size: 52px; }
.avatar-lg { --size: 132px; }

.badge { display: inline-flex; align-items: center; gap: .25rem; padding: .15rem .55rem; border-radius: 999px; font-size: .72rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }
.badge-top { background: var(--gold-50); color: var(--gold-dark); border: 1px solid #f6dfa6; }
.badge-new { background: var(--success-bg); color: var(--success); border: 1px solid #abefc6; }
.badge-featured { background: var(--primary-50); color: var(--primary); border: 1px solid var(--primary-100); }
.badge-muted { background: #f2f0f5; color: var(--muted); border: 1px solid var(--border); }
.badge-warning { background: var(--warning-bg); color: var(--warning); border: 1px solid #fedf89; }

/* ---------------------------------------------------------------- stelle */
.stars { position: relative; display: inline-block; line-height: 0; vertical-align: middle; white-space: nowrap; }
.stars svg { width: var(--star, 16px); height: var(--star, 16px); display: inline-block; }
.stars-bg svg { fill: var(--star-empty); }
.stars-fg { position: absolute; inset: 0 auto 0 0; overflow: hidden; white-space: nowrap; }
.stars-fg svg { fill: var(--gold); }
.stars-sm { --star: 14px; }
.stars-md { --star: 17px; }
.stars-lg { --star: 22px; }
.stars-xl { --star: 28px; }

/* input voto (radio, senza JavaScript) */
.rating-input { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; gap: .2rem; border: 0; padding: 0; margin: 0; width: max-content; justify-self: start; }
.rating-input input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.rating-input label { cursor: pointer; line-height: 0; padding: 2px; border-radius: 6px; }
.rating-input svg { width: 36px; height: 36px; fill: var(--star-empty); transition: fill .12s, transform .12s; }
.rating-input label:hover svg, .rating-input label:hover ~ label svg,
.rating-input input:checked ~ label svg { fill: var(--gold); }
.rating-input label:hover svg { transform: scale(1.08); }
.rating-input input:focus-visible + label { outline: 3px solid #8b5cf6; outline-offset: 1px; }
.rating-hint { font-size: .875rem; color: var(--muted); margin-top: .25rem; min-height: 1.3em; }

/* ---------------------------------------------------------------- moduli */
.form { display: grid; gap: 1.1rem; }
.form-row { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.form-group { display: grid; gap: .35rem; }
.form-group > label, .label { font-weight: 600; font-size: .92rem; color: var(--text); }
.form-group .opt { font-weight: 400; color: var(--muted); font-size: .85rem; }
input:not([type]), input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="number"], input[type="url"], input[type="month"], input[type="date"], input[type="datetime-local"], input[type="file"], select, textarea {
  width: 100%; min-height: 46px; padding: .65rem .9rem;
  font: inherit; font-size: 1rem; color: var(--text);
  background: #fff; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 150px; resize: vertical; line-height: 1.55; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary-600); box-shadow: 0 0 0 3px var(--primary-100); }
.is-invalid, input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--danger) !important; }
.field-error { margin: .1rem 0 0; color: var(--danger); font-size: .85rem; font-weight: 500; }
.help { font-size: .84rem; color: var(--muted); margin: 0; }
.checkbox { display: flex; gap: .65rem; align-items: flex-start; font-size: .92rem; line-height: 1.45; color: var(--text-2); cursor: pointer; }
.checkbox input { width: 18px; height: 18px; margin-top: .15rem; accent-color: var(--primary); flex: 0 0 18px; }
.form-actions { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.char-count { font-size: .8rem; color: var(--muted); text-align: right; }
.form-card { max-width: 520px; margin: 2rem auto 3rem; }
.form-card h1 { font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.1rem); }
.auth-alt { text-align: center; font-size: .92rem; color: var(--muted); margin-top: 1rem; }

/* ---------------------------------------------------------------- filtri elenco */
.filters { display: grid; gap: .75rem; grid-template-columns: 2fr repeat(3, 1fr) auto; align-items: end; padding: 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 1.25rem; }
.filters .form-group > label { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
@media (max-width: 900px) { .filters { grid-template-columns: 1fr 1fr; } .filters .filters-q { grid-column: 1 / -1; } }
.results-info { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; color: var(--muted); font-size: .92rem; }

/* ---------------------------------------------------------------- breadcrumb e paginazione */
.breadcrumbs { padding: 1rem 0 0; font-size: .85rem; color: var(--muted); }
.breadcrumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .35rem; }
.breadcrumbs li + li::before { content: "›"; margin-right: .35rem; color: var(--border-strong); }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--primary); text-decoration: underline; }
.pagination { display: flex; justify-content: center; flex-wrap: wrap; gap: .35rem; margin: 2rem 0 .5rem; }
.pagination a, .pagination span { min-width: 42px; height: 42px; padding: 0 .75rem; display: inline-grid; place-items: center; border-radius: 999px; border: 1px solid var(--border); background: #fff; text-decoration: none; color: var(--text-2); font-weight: 600; font-size: .92rem; font-variant-numeric: tabular-nums; }
.pagination a:hover { border-color: var(--primary-100); background: var(--primary-50); color: var(--primary); }
.pagination [aria-current="page"] { background: var(--primary); border-color: var(--primary); color: #fff; }
.pagination .gap { border: 0; background: none; min-width: 20px; }

/* ---------------------------------------------------------------- scheda cartomante */
.profile-hero { padding: 1.25rem 0 2rem; background: linear-gradient(180deg, #f6f1ff, var(--bg)); border-bottom: 1px solid var(--border); }
.profile-top { display: grid; grid-template-columns: auto 1fr auto; gap: 1.75rem; align-items: center; margin-top: 1rem; }
.profile-top h1 { margin: 0 0 .35rem; }
.profile-sub { display: flex; flex-wrap: wrap; gap: .5rem .75rem; align-items: center; color: var(--text-2); }
.profile-sub a { font-weight: 600; }
.profile-score { text-align: center; padding: 1rem 1.4rem; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 190px; }
.score-big { font-size: 3rem; font-weight: 700; line-height: 1; color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.score-big small { font-size: 1.1rem; color: var(--muted); font-weight: 500; }
.profile-score .muted { font-size: .85rem; display: block; margin-top: .3rem; }
.profile-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.1rem; }
.fav-btn[aria-pressed="true"] { --btn-bg: #fff0f3; --btn-fg: #be123c; --btn-bd: #fecdd6; }
.fav-btn svg { width: 18px; height: 18px; }
.fav-btn[aria-pressed="true"] svg { fill: currentColor; }
@media (max-width: 820px) {
  .profile-top { grid-template-columns: auto 1fr; }
  .profile-score { grid-column: 1 / -1; display: flex; align-items: center; gap: 1rem; text-align: left; }
  .profile-top .avatar-lg { --size: 96px; }
}
@media (max-width: 520px) { .profile-top { grid-template-columns: 1fr; justify-items: start; } }

.profile-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1.75rem; padding: 2rem 0 3rem; align-items: start; }
.profile-layout aside { display: grid; gap: 1.1rem; position: sticky; top: calc(var(--header-h) + 16px); }
@media (max-width: 960px) { .profile-layout { grid-template-columns: 1fr; } .profile-layout aside { position: static; } }
.prose { color: var(--text-2); }
.prose p { margin-bottom: 1em; }
.prose h2 { margin-top: 1.6em; }
.prose h3 { margin-top: 1.4em; }
.prose img { border-radius: var(--radius-sm); margin: 1rem 0; }
.prose table { width: 100%; border-collapse: collapse; font-size: .92rem; margin: 1rem 0; }
.prose th, .prose td { border: 1px solid var(--border); padding: .55rem .7rem; text-align: left; vertical-align: top; }
.prose th { background: var(--surface-2); }
.schedule { white-space: pre-line; font-size: .95rem; color: var(--text-2); font-variant-numeric: tabular-nums; }
.tag-list { display: flex; flex-wrap: wrap; gap: .4rem; }
.info-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; font-size: .93rem; }
.info-list li { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 1px dashed var(--border); padding-bottom: .5rem; }
.info-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.info-list span:first-child { color: var(--muted); }
.notice-inactive { margin-top: 1rem; }

/* distribuzione voti (istogramma orizzontale, serie singola) */
.dist { display: grid; gap: .5rem; margin: .25rem 0 0; }
.dist-row { display: grid; grid-template-columns: 4.2rem 1fr 4.6rem; align-items: center; gap: .6rem; font-size: .88rem; color: var(--text-2); }
.dist-label { white-space: nowrap; }
.dist-track { height: 10px; background: var(--bar-track); border-radius: 0 4px 4px 0; overflow: hidden; }
.dist-bar { display: block; height: 100%; background: var(--bar); border-radius: 0 4px 4px 0; min-width: 0; }
.dist-value { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------------------------------------------------------------- recensioni */
.reviews-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin: 2rem 0 1rem; }
.reviews-head h2 { margin: 0; }
.review-list { display: grid; gap: 1rem; }
.review { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem 1.25rem; box-shadow: var(--shadow); }
.review-top { display: flex; align-items: center; gap: .8rem; margin-bottom: .65rem; }
.review-author { font-weight: 650; color: var(--text); text-decoration: none; }
a.review-author:hover { color: var(--primary); text-decoration: underline; }
.review-date { font-size: .82rem; color: var(--muted); }
.review-top .stars { margin-left: auto; }
.review-title { font-size: 1.05rem; font-weight: 700; margin: 0 0 .35rem; font-family: var(--font); }
.review-body { color: var(--text-2); }
.review-body p:last-child { margin-bottom: 0; }
.review-meta { display: flex; flex-wrap: wrap; gap: .4rem .9rem; margin-top: .7rem; font-size: .82rem; color: var(--muted); }
.review-target { font-size: .88rem; margin-bottom: .45rem; }
.review-target a { font-weight: 650; }
.review-reply { margin-top: .9rem; padding: .8rem 1rem; background: var(--primary-50); border-left: 3px solid var(--primary); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: .93rem; color: var(--text-2); }
.review-reply strong { color: var(--primary); display: block; font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; margin-bottom: .2rem; }
.review-actions { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-top: .9rem; padding-top: .75rem; border-top: 1px solid var(--border); font-size: .85rem; }
.review-actions form { margin: 0; }
.helpful-btn { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .75rem; border: 1px solid var(--border); background: #fff; border-radius: 999px; font: inherit; font-size: .84rem; color: var(--text-2); cursor: pointer; }
.helpful-btn:hover { border-color: var(--primary-100); color: var(--primary); }
.helpful-btn[aria-pressed="true"] { background: var(--primary-50); border-color: var(--primary-100); color: var(--primary); }
.report details { position: relative; }
.report summary { cursor: pointer; color: var(--muted); list-style: none; }
.report summary::-webkit-details-marker { display: none; }
.report summary:hover { color: var(--danger); }
.report-box { position: absolute; z-index: 5; left: 0; top: 1.8rem; width: min(320px, 80vw); padding: 1rem; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); display: grid; gap: .6rem; }
.review-status { display: inline-block; margin-bottom: .5rem; }
.review-own { border-color: var(--primary-100); box-shadow: 0 0 0 3px var(--primary-50); }
.review-form-card { scroll-margin-top: calc(var(--header-h) + 20px); }
.review-form-card h2 { font-size: 1.4rem; }
.login-cta { display: flex; gap: 1rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.sort-links { display: flex; gap: .3rem; flex-wrap: wrap; }
.sort-links a { padding: .3rem .75rem; border-radius: 999px; font-size: .85rem; text-decoration: none; color: var(--text-2); border: 1px solid transparent; }
.sort-links a[aria-current="true"] { background: var(--primary-50); color: var(--primary); border-color: var(--primary-100); font-weight: 600; }

/* ---------------------------------------------------------------- classifica */
.rank-table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.rank-table th, .rank-table td { padding: .8rem 1rem; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.rank-table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); background: var(--surface-2); font-weight: 700; }
.rank-table tr:last-child td { border-bottom: 0; }
.rank-table tbody tr:hover td { background: #fcfaff; }
.rank-pos { width: 56px; font-weight: 800; font-size: 1.1rem; color: var(--muted); font-variant-numeric: tabular-nums; text-align: center !important; }
.rank-pos.top1 { color: var(--gold-dark); } .rank-pos.top2 { color: #6b7280; } .rank-pos.top3 { color: #9a5b23; }
.rank-who { display: flex; align-items: center; gap: .8rem; }
.rank-who a { font-weight: 650; text-decoration: none; color: var(--text); }
.rank-who a:hover { color: var(--primary); }
.num { text-align: right !important; font-variant-numeric: tabular-nums; }
@media (max-width: 720px) { .rank-table .hide-sm { display: none; } .rank-table th, .rank-table td { padding: .65rem .6rem; } }
.tabs { display: flex; gap: .35rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tabs a { padding: .45rem 1rem; border-radius: 999px; border: 1px solid var(--border); background: #fff; text-decoration: none; color: var(--text-2); font-weight: 600; font-size: .9rem; }
.tabs a[aria-current="page"] { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---------------------------------------------------------------- siti */
.site-card { display: flex; flex-direction: column; gap: .75rem; }
.site-card-top { display: flex; align-items: center; gap: .9rem; }
.site-logo { width: 64px; height: 64px; border-radius: 14px; border: 1px solid var(--border); background: #fff; display: grid; place-items: center; overflow: hidden; flex: 0 0 64px; font-weight: 800; color: var(--primary); font-size: 1.3rem; }
.site-logo img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.site-card h3 { margin: 0; font-size: 1.1rem; }
.site-card h3 a { color: var(--text); text-decoration: none; }
.site-card h3 a:hover { color: var(--primary); }
.site-stats { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .88rem; color: var(--muted); }
.site-stats strong { color: var(--text); }

/* ---------------------------------------------------------------- come funziona / guide */
.steps { counter-reset: step; display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.step { position: relative; padding: 1.4rem 1.25rem 1.25rem 1.25rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.step::before { counter-increment: step; content: counter(step); display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 800; margin-bottom: .75rem; }
.step h3 { margin-bottom: .35rem; }
.step p { margin: 0; color: var(--text-2); font-size: .95rem; }
.article-card { display: flex; flex-direction: column; overflow: hidden; padding: 0; }
.article-card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.article-card .article-body { padding: 1.1rem 1.2rem 1.3rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.article-card h3 { margin: 0; font-size: 1.1rem; }
.article-card h3 a { color: var(--text); text-decoration: none; }
.article-card h3 a:hover { color: var(--primary); }
.article-cover { border-radius: var(--radius); margin: 0 0 1.5rem; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.seo-text { max-width: 860px; }
.cta-band { padding: 2rem; border-radius: var(--radius-lg); background: linear-gradient(120deg, var(--primary-700), var(--primary-600)); color: #fff; display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.cta-band h2 { color: #fff; margin: 0 0 .25rem; }
.cta-band p { margin: 0; color: #e9e0fb; }

/* ---------------------------------------------------------------- tabelle generiche */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { padding: .6rem .7rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.table th { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; }

/* ---------------------------------------------------------------- footer */
.site-footer { margin-top: 3rem; background: #1c1030; color: #cfc6e2; font-size: .92rem; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 2rem; padding: 3rem 20px 2rem; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.footer-grid a { color: #eee8fa; text-decoration: none; }
.footer-grid a:hover { color: #fff; text-decoration: underline; }
.footer-title { font-family: var(--font); font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #a99bc8; margin-bottom: .9rem; }
.footer-about img { margin-bottom: 1rem; }
.footer-disclosure { font-size: .85rem; color: #b6abd0; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .1); padding: 1.25rem 20px 5.5rem; font-size: .8rem; color: #a99bc8; }
.footer-bottom p { margin: 0 0 .4rem; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-about { grid-column: 1 / -1; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- pagine errore */
.error-page { text-align: center; padding: 4rem 0; }
.error-code { font-family: var(--font-display); font-size: 5rem; color: var(--primary-100); line-height: 1; margin-bottom: .5rem; }

/* =====================================================================
   COOKIE BANNER — nero, testo bianco, pulsanti blu
   ===================================================================== */
.cc-banner {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 9990;
  background: var(--cc-bg); color: var(--cc-text);
  box-shadow: 0 -8px 30px rgba(0, 0, 0, .35);
  animation: cc-up .25s ease-out;
}
.cc-banner[hidden], .cc-modal[hidden] { display: none !important; }
@keyframes cc-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
.cc-inner { position: relative; max-width: var(--container); margin: 0 auto; padding: 1.25rem 3.5rem 1.25rem 20px; display: grid; grid-template-columns: 1fr auto; gap: 1rem 2rem; align-items: center; }
.cc-title { font-family: var(--font); font-size: 1.05rem; font-weight: 700; color: var(--cc-text); margin: 0 0 .35rem; }
.cc-text p, .cc-small { margin: 0; font-size: .88rem; line-height: 1.55; color: var(--cc-muted); }
.cc-banner a:not(.cc-btn), .cc-modal a:not(.cc-btn) { color: #ffffff; text-decoration: underline; }
.cc-actions { display: flex; gap: .6rem; flex-wrap: wrap; justify-content: flex-end; }
.cc-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; min-width: 128px; padding: .6rem 1.2rem;
  background: var(--cc-btn); color: #fff; border: 1px solid var(--cc-btn); border-radius: 8px;
  font: 600 .93rem/1.2 var(--font); text-decoration: none; cursor: pointer; transition: background-color .15s;
}
.cc-btn:hover, .cc-btn:focus-visible { background: var(--cc-btn-hover); border-color: var(--cc-btn-hover); color: #fff; }
.cc-btn:focus-visible { outline: 3px solid #93c5fd; outline-offset: 2px; }
.cc-close {
  position: absolute; top: .6rem; right: .6rem; width: 40px; height: 40px;
  display: grid; place-items: center; background: transparent; border: 0; border-radius: 50%;
  color: #fff; cursor: pointer;
}
.cc-close:hover { background: rgba(255, 255, 255, .12); }
.cc-close:focus-visible { outline: 3px solid #93c5fd; }
@media (max-width: 860px) {
  .cc-inner { grid-template-columns: 1fr; padding: 1.1rem 16px 1.1rem; padding-right: 3.2rem; }
  .cc-actions { justify-content: stretch; }
  .cc-actions .cc-btn { flex: 1 1 30%; min-width: 0; }
}
@media (max-width: 460px) {
  .cc-actions .cc-btn { flex: 1 1 100%; min-height: 42px; }
  .cc-text p { font-size: .82rem; line-height: 1.5; }
  .cc-title { font-size: 1rem; }
}

.cc-modal { position: fixed; inset: 0; z-index: 9995; display: grid; place-items: center; padding: 16px; }
.cc-modal-backdrop { position: absolute; inset: 0; background: rgba(10, 10, 15, .6); }
.cc-modal-box {
  position: relative; width: min(560px, 100%); max-height: calc(100vh - 32px); overflow-y: auto;
  padding: 1.6rem 1.5rem 1.4rem; background: var(--cc-bg); color: var(--cc-text);
  border-radius: 14px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
}
.cc-modal-box .cc-title { font-size: 1.2rem; padding-right: 2rem; }
.cc-cat { border-top: 1px solid rgba(255, 255, 255, .14); padding: .9rem 0; }
.cc-cat p { margin: .35rem 0 0; font-size: .85rem; color: var(--cc-muted); }
.cc-cat-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; cursor: pointer; }
.cc-cat-name { font-weight: 700; }
.cc-always { font-size: .8rem; font-weight: 600; color: #93c5fd; }
.cc-switch { position: relative; display: inline-block; width: 48px; height: 28px; flex: 0 0 48px; }
.cc-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.cc-switch span { position: absolute; inset: 0; background: #52525b; border-radius: 999px; transition: background .15s; }
.cc-switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .15s; }
.cc-switch input:checked + span { background: var(--cc-btn); }
.cc-switch input:checked + span::after { transform: translateX(20px); }
.cc-switch input:focus-visible + span { outline: 3px solid #93c5fd; outline-offset: 2px; }
.cc-modal .cc-actions { margin-top: .75rem; justify-content: stretch; }
.cc-modal .cc-actions .cc-btn { flex: 1 1 30%; min-width: 0; }

.cc-reopen {
  position: fixed; right: 16px; bottom: 16px; z-index: 9980;
  width: 50px; height: 50px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--cc-bg); color: #fff; border: 2px solid var(--cc-btn);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .3); text-decoration: none;
  transition: transform .15s, background-color .15s;
}
.cc-reopen:hover, .cc-reopen:focus-visible { transform: scale(1.06); background: var(--cc-btn); color: #fff; }
body.cc-banner-open .cc-reopen { display: none; }

/* stampa */
@media print {
  .site-header, .site-footer, .cc-banner, .cc-reopen, .cc-modal, .review-actions, .profile-actions { display: none !important; }
  body { background: #fff; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* numeri nei titoli in carattere lineare (Playfair usa cifre "old style") */
.h-count { font-family: var(--font); font-weight: 500; font-size: .62em; color: var(--muted); letter-spacing: 0; vertical-align: middle; }
h1, h2 { font-variant-numeric: lining-nums; }

/* card cartomanti su smartphone: due colonne */
@media (max-width: 560px) {
  .grid-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
  .cm-card { padding: 1.1rem .6rem .9rem; }
  .cm-card .avatar { --size: 58px; }
  .cm-name { font-size: .98rem; }
  .cm-rating .stars { --star: 12px; }
  .cm-badges .badge { font-size: .62rem; padding: .1rem .4rem; }
  .hero-stats { gap: 1.25rem; }
  .hero-stat strong { font-size: 1.4rem; }
}

input[type="file"] { padding: .5rem .7rem; min-height: 0; background: #faf8fd; cursor: pointer; }
