@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;0,700;1,300;1,400&family=Josefin+Sans:wght@200;300;400;600;700&display=swap');

/* ============================================================
   MINERALIA — DESIGN SYSTEM v2.0
   Tema: Geological Luxury / Dark Stone
   ============================================================ */

:root {
  /* === ROCCE BASE === */
  --c-obsidian:   #08070a;
  --c-basalt:     #111016;
  --c-granite:    #19171e;
  --c-slate:      #221f28;
  --c-schist:     #2e2a38;
  --c-sandstone:  #3b3648;

  /* === MINERALI CHIARI === */
  --c-quartz:     #ede0f0;
  --c-limestone:  #c0aed0;
  --c-shale:      #786888;
  --c-fossil:     #4e4060;

  /* === GEMME (estratte dal logo) === */
  --gem-gold:      #d4a840;
  --gem-sapphire:  #3a60a8;
  --gem-amethyst:  #8048a0;
  --gem-ruby:      #c84040;
  --gem-crystal:   #88c0c8;
  --gem-malachite: #3a7850;
  --gem-malachite-h: #4d9668;

  /* === TOKEN SEMANTICI === */
  --bg:           var(--c-obsidian);
  --surface-0:    var(--c-basalt);
  --surface-1:    var(--c-granite);
  --surface-2:    var(--c-slate);
  --surface-3:    var(--c-schist);
  --border-faint: rgba(255,255,255,0.05);
  --border:       rgba(255,255,255,0.10);
  --border-bright:rgba(255,255,255,0.20);

  --text-0: var(--c-quartz);
  --text-1: var(--c-limestone);
  --text-2: var(--c-shale);

  --accent:   var(--gem-malachite);
  --accent-h: var(--gem-malachite-h);
  --gold:     var(--gem-gold);

  --shadow-sm:  0 2px 10px rgba(0,0,0,0.6);
  --shadow-md:  0 8px 32px  rgba(0,0,0,0.55);
  --shadow-lg:  0 20px 64px rgba(0,0,0,0.65);
  --glow-green: 0 0 28px rgba(58,120,80,0.30);
  --glow-gold:  0 0 24px rgba(212,168,64,0.25);

  --r-sm:   4px;
  --r-md:   10px;
  --r-lg:   18px;
  --r-pill: 100px;

  --f-display: 'Cormorant Garamond', Georgia, serif;
  --f-ui:      'Josefin Sans', sans-serif;

  /* === COMPAT con vecchie variabili usate negli HTML === */
  --deep-green:    var(--gem-malachite);
  --earth-green:   var(--gem-malachite-h);
  --ocean-blue:    var(--gem-sapphire);
  --mineral-yellow: var(--gem-gold);
  --mineral-red:   var(--gem-ruby);
  --mineral-purple: var(--gem-amethyst);
  --mineral-white: var(--c-quartz);
  --text-main:     var(--text-0);
  --card-bg:       var(--surface-1);
  --bg-gradient:   var(--bg);
  --viola:         var(--gem-amethyst);
}

/* ============================================================
   TEMA CHIARO (ispirato al logo Mineralia)
   ============================================================ */

[data-theme="light"] {
  --bg:           #f0ede6;
  --surface-0:    #faf8f4;
  --surface-1:    #ffffff;
  --surface-2:    #f2ede4;
  --surface-3:    #e8e0d2;
  --border-faint: rgba(60,90,60,0.06);
  --border:       rgba(60,90,60,0.14);
  --border-bright:rgba(60,90,60,0.30);

  --c-obsidian:   #f0ede6;
  --c-basalt:     #faf8f4;
  --c-granite:    #ffffff;
  --c-slate:      #f2ede4;
  --c-schist:     #e8e0d2;

  --c-quartz:     #1e2a1e;
  --c-limestone:  #3a4a3a;
  --c-shale:      #6a7a6a;

  --text-0: #1e2a1e;
  --text-1: #3a4a3a;
  --text-2: #6a7a6a;

  --accent:   #2d7a48;
  --accent-h: #3a9658;
  --gold:     #b07a20;

  --gem-malachite:   #2d7a48;
  --gem-malachite-h: #3a9658;
  --gem-gold:        #b07a20;
  --gem-ruby:        #b03030;
  --gem-sapphire:    #2a4f94;
  --gem-amethyst:    #7040a0;
  --gem-crystal:     #3a8890;

  --deep-green:    #2d7a48;
  --earth-green:   #3a9658;
  --mineral-yellow: #b07a20;
  --mineral-red:   #b03030;

  --shadow-sm:  0 2px 10px rgba(40,60,40,0.12);
  --shadow-md:  0 8px 32px  rgba(40,60,40,0.14);
  --shadow-lg:  0 20px 64px rgba(40,60,40,0.18);
  --glow-green: 0 0 28px rgba(45,122,72,0.20);
  --glow-gold:  0 0 24px rgba(176,122,32,0.25);
}

[data-theme="light"] body::before {
  background-image:
    repeating-linear-gradient(
      30deg,
      transparent 0, transparent 80px,
      rgba(60,90,60,0.03) 80px, rgba(60,90,60,0.03) 81px
    ),
    repeating-linear-gradient(
      150deg,
      transparent 0, transparent 80px,
      rgba(60,90,60,0.03) 80px, rgba(60,90,60,0.03) 81px
    );
}

[data-theme="light"] header {
  background: rgba(240,237,230,0.90);
}

[data-theme="light"] section::before {
  background: radial-gradient(
    ellipse at top right,
    rgba(45,122,72,0.07) 0%,
    transparent 70%
  );
}

[data-theme="light"] .card {
  box-shadow: 0 2px 12px rgba(40,60,40,0.07);
}

[data-theme="light"] ::-webkit-scrollbar-track { background: #e8e0d2; }
[data-theme="light"] ::-webkit-scrollbar-thumb { background: #b0c8b0; }

/* ============================================================
   MODALITÀ ACCESSIBILITÀ (applicate via data-a11y su <html>)
   ============================================================ */

/* Daltonismo Rosso-Verde (Deuteranopia/Protanopia) — contrasti molto marcati */
[data-a11y="cb-rg"] {
  --accent:          #0060b0;
  --accent-h:        #007fd0;
  --gem-malachite:   #0060b0;
  --gem-malachite-h: #007fd0;
  --gem-ruby:        #cc6600;
  --gem-gold:        #d4aa00;
  --gem-sapphire:    #0040c0;
  --gem-amethyst:    #6600cc;
  --gem-crystal:     #00a0c0;
  --deep-green:      #0060b0;
  --earth-green:     #007fd0;
  --mineral-yellow:  #d4aa00;
  --mineral-red:     #cc6600;
  --gold:            #d4aa00;
  --border:          rgba(0,127,208,0.30);
  --border-bright:   rgba(0,127,208,0.60);
}

[data-a11y="cb-rg"] .btn-green  { background: linear-gradient(135deg, #0060b0, #007fd0); }
[data-a11y="cb-rg"] .btn-red    { background: linear-gradient(135deg, #994d00, #cc6600); }
[data-a11y="cb-rg"] .btn-yellow { background: linear-gradient(135deg, #997700, #d4aa00); }

/* Daltonismo Blu-Giallo (Tritanopia) — contrasti molto marcati */
[data-a11y="cb-by"] {
  --accent:          #1a8830;
  --accent-h:        #22aa3c;
  --gem-malachite:   #1a8830;
  --gem-malachite-h: #22aa3c;
  --gem-sapphire:    #cc1050;
  --gem-crystal:     #ee4020;
  --gem-gold:        #aa6600;
  --gem-amethyst:    #cc0060;
  --gem-ruby:        #dd0000;
  --deep-green:      #1a8830;
  --earth-green:     #22aa3c;
  --mineral-yellow:  #aa6600;
  --mineral-red:     #dd0000;
  --gold:            #aa6600;
  --border:          rgba(26,136,48,0.30);
  --border-bright:   rgba(26,136,48,0.60);
}

[data-a11y="cb-by"] .btn-green  { background: linear-gradient(135deg, #1a8830, #22aa3c); }
[data-a11y="cb-by"] .btn-blue   { background: linear-gradient(135deg, #880030, #cc1050); }
[data-a11y="cb-by"] .btn-yellow { background: linear-gradient(135deg, #775000, #aa7800); }

/* Alto Contrasto */
[data-a11y="hc"] {
  --bg:           #000000;
  --surface-0:    #080808;
  --surface-1:    #101010;
  --surface-2:    #181818;
  --surface-3:    #202020;
  --border:       rgba(255,255,255,0.55);
  --border-bright:rgba(255,255,255,0.85);
  --text-0:       #ffffff;
  --text-1:       #ffffff;
  --text-2:       #cccccc;
  --accent:       #00ff88;
  --accent-h:     #00ffaa;
  --gold:         #ffee00;
  --gem-ruby:     #ff4444;
  --gem-sapphire: #4499ff;
  --gem-amethyst: #dd88ff;
  --glow-green:   0 0 24px rgba(0,255,136,0.45);
  --c-quartz:     #ffffff;
  --c-limestone:  #ffffff;
  --c-shale:      #cccccc;
}

/* Font leggibile — dimensioni e spaziatura aumentate */
[data-a11y="readable"] {
  --f-display: 'Josefin Sans', sans-serif;
  --f-ui:      'Josefin Sans', sans-serif;
}

[data-a11y="readable"] body {
  font-size: 1.1rem;
  line-height: 1.85;
  letter-spacing: 0.02em;
}

[data-a11y="readable"] p {
  font-size: 1.15rem;
  line-height: 1.85;
}

[data-a11y="readable"] h2 {
  font-size: clamp(2rem, 4.5vw, 3.2rem);
}

[data-a11y="readable"] h3 {
  font-size: 1.45rem;
}

[data-a11y="readable"] nav a,
[data-a11y="readable"] label,
[data-a11y="readable"] .btn {
  font-size: 0.9rem;
  letter-spacing: 0.1em;
}

[data-a11y="readable"] input,
[data-a11y="readable"] textarea {
  font-size: 1rem;
  padding: 14px 18px;
}

[data-a11y="readable"] .card p {
  font-size: 1.05rem;
}

/* ============================================================
   RESET & BASE
   ============================================================ */

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg);
  color: var(--text-0);
  font-family: var(--f-ui);
  font-weight: 300;
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Trama cristallina in background — linee di sfaldatura */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(
      30deg,
      transparent 0, transparent 80px,
      rgba(255,255,255,0.012) 80px, rgba(255,255,255,0.012) 81px
    ),
    repeating-linear-gradient(
      150deg,
      transparent 0, transparent 80px,
      rgba(255,255,255,0.012) 80px, rgba(255,255,255,0.012) 81px
    ),
    repeating-linear-gradient(
      90deg,
      transparent 0, transparent 120px,
      rgba(255,255,255,0.008) 120px, rgba(255,255,255,0.008) 121px
    );
}

body > * { position: relative; z-index: 1; }

/* ============================================================
   TIPOGRAFIA
   ============================================================ */

h1, h2, h3 {
  font-family: var(--f-display);
  font-weight: 600;
  color: var(--text-0);
  line-height: 1.15;
  letter-spacing: 0.02em;
}

h2 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  margin-bottom: 0.5em;
  /* Filo di cristallo sotto il titolo */
  padding-bottom: 0.3em;
  border-bottom: 1px solid var(--border);
  position: relative;
}

h2::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  border-radius: 2px;
}

h3 {
  font-size: 1.3rem;
  color: var(--text-1);
  margin-bottom: 0.4em;
}

p {
  color: var(--text-1);
  font-family: var(--f-display);
  font-size: 1.05rem;
  font-weight: 300;
}

a {
  color: var(--accent-h);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover { color: var(--gold); }

label {
  display: block;
  font-family: var(--f-ui);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-2);
  margin-bottom: 6px;
}

/* ============================================================
   HEADER
   ============================================================ */

header {
  background: rgba(8, 7, 10, 0.85);
  backdrop-filter: blur(18px) saturate(1.5);
  -webkit-backdrop-filter: blur(18px) saturate(1.5);
  border-bottom: 1px solid var(--border);
  padding: 0 5%;
  height: 120px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 1000;
  /* Sottile linea dorata nella header */
  box-shadow: 0 1px 0 rgba(212,168,64,0.15), var(--shadow-sm);
}

.logo img {
  height: 110px;
  width: auto;
  transition: opacity 0.3s, filter 0.3s;
  filter: drop-shadow(0 0 8px rgba(58,120,80,0.4));
}

.logo img:hover {
  opacity: 0.85;
  filter: drop-shadow(0 0 14px rgba(212,168,64,0.5));
}

nav {
  display: flex;
  align-items: center;
  gap: 0;
}

nav a {
  font-family: var(--f-ui);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-2);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: var(--r-sm);
  transition: color 0.25s, background 0.25s;
  position: relative;
}

nav a::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 16px;
  right: 16px;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

nav a:hover {
  color: var(--text-0);
  background: var(--border-faint);
}

nav a:hover::after {
  transform: scaleX(1);
}

/* ============================================================
   SEZIONI PRINCIPALI
   ============================================================ */

section {
  max-width: 1000px;
  margin: 36px auto;
  padding: 40px 44px;
  background: var(--surface-1);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  text-align: center;
  /* Sottile sfumatura interna che suggerisce profondità della roccia */
  background-image: linear-gradient(
    160deg,
    rgba(255,255,255,0.025) 0%,
    transparent 60%
  );
}

/* Decorazione cristallo — angolo in alto a destra di ogni sezione */
section::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 120px; height: 120px;
  background: radial-gradient(
    ellipse at top right,
    rgba(58,120,80,0.06) 0%,
    transparent 70%
  );
  border-radius: 0 var(--r-lg) 0 0;
  pointer-events: none;
}

section { position: relative; overflow: hidden; }

/* Sezione con sfondo leggermente più scuro (es. account-header) */
section.account-header {
  background: var(--surface-0);
  border-color: var(--border-faint);
}

p.subtitle {
  color: var(--text-2);
  font-family: var(--f-ui);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  margin-bottom: 28px;
}

/* ============================================================
   CARD
   ============================================================ */

.card {
  background: var(--surface-2);
  padding: 22px 24px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.25s;
  text-align: left;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.card:hover {
  border-color: rgba(77,150,104,0.35);
  box-shadow: var(--glow-green);
  transform: translateY(-2px);
}

.card:hover::before {
  opacity: 1;
}

.card h3 {
  font-family: var(--f-display);
  font-size: 1.25rem;
  color: var(--text-0);
  margin-bottom: 8px;
}

.card p {
  font-size: 0.95rem;
  color: var(--text-1);
}

/* ============================================================
   GRID
   ============================================================ */

.grid {
  display: grid;
  gap: 20px;
  margin-top: 28px;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

@media (max-width: 680px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  section { padding: 28px 22px; margin: 20px 14px; }
  header { padding: 0 4%; }
  nav a { padding: 6px 10px; font-size: 0.68rem; }
}

/* ============================================================
   BOTTONI
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 11px 26px;
  border: none;
  border-radius: var(--r-pill);
  cursor: pointer;
  color: white;
  font-family: var(--f-ui);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s;
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
  margin: 4px;
  position: relative;
  overflow: hidden;
}

/* Riflesso gemma sul bottone */
.btn::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.12), transparent);
  transition: left 0.4s ease;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.5);
}

.btn:hover::after { left: 150%; }

.btn:active {
  transform: translateY(0);
  opacity: 0.85;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.btn-green  { background: linear-gradient(135deg, var(--gem-malachite), var(--gem-malachite-h)); }
.btn-blue   { background: linear-gradient(135deg, #2a4f94, #3a68b8); }
.btn-yellow { background: linear-gradient(135deg, #b88830, var(--gem-gold)); color: #1a1510; }
.btn-red    { background: linear-gradient(135deg, #a03030, var(--gem-ruby)); }
.btn-purple { background: linear-gradient(135deg, #6038800, var(--gem-amethyst)); background: linear-gradient(135deg, #604080, var(--gem-amethyst)); }

/* ============================================================
   FORM
   ============================================================ */

form { text-align: left; }

input[type="text"],
input[type="password"],
input[type="email"],
textarea,
select {
  display: block;
  width: 100%;
  padding: 12px 16px;
  background: var(--surface-0);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text-0);
  font-family: var(--f-ui);
  font-size: 0.9rem;
  font-weight: 300;
  letter-spacing: 0.04em;
  transition: border-color 0.25s, box-shadow 0.25s;
  outline: none;
  margin-bottom: 16px;
}

input::placeholder, textarea::placeholder {
  color: var(--text-2);
  opacity: 0.6;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent-h);
  box-shadow: 0 0 0 3px rgba(58,120,80,0.18);
}

[data-a11y="hc"] input:focus,
[data-a11y="hc"] textarea:focus {
  box-shadow: 0 0 0 3px rgba(0,255,136,0.3);
  border-color: var(--accent);
}

input[type="file"] {
  background: transparent;
  border: 1px dashed var(--border);
  color: var(--text-2);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 10px;
}

input[type="file"]:hover {
  border-color: var(--accent-h);
}

/* ============================================================
   ACCOUNT
   ============================================================ */

.account-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.circle-pic {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  border: 3px solid var(--border);
  box-shadow: var(--glow-green), var(--shadow-md);
  object-fit: cover;
  transition: box-shadow 0.3s;
}

.circle-pic:hover {
  box-shadow: var(--glow-gold), var(--shadow-md);
}

/* UID badge */
.uid-wrapper {
  position: relative;
  display: inline-block;
}

.uid-wrapper .uid-tooltip {
  visibility: hidden;
  opacity: 0;
  background: var(--surface-3);
  color: var(--text-1);
  font-family: var(--f-ui);
  font-size: 0.7rem;
  padding: 6px 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  position: absolute;
  bottom: 130%;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  transition: opacity 0.2s;
  z-index: 10;
}

.uid-wrapper:hover .uid-tooltip {
  visibility: visible;
  opacity: 1;
}

/* ============================================================
   AUTH BUTTONS (in-page)
   ============================================================ */

#authButtons {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 10px 5%;
  max-width: 1000px;
  margin: 0 auto;
}

/* ============================================================
   UPDATE / LISTA PULITA
   ============================================================ */

.update-title {
  font-family: var(--f-display);
  color: var(--text-0);
  font-weight: 700;
  font-size: 2rem;
  margin-bottom: 24px;
}

.update-container {
  border: 1px solid var(--accent);
  border-radius: var(--r-lg);
  padding: 28px 36px;
  margin: 0 auto;
  max-width: 90%;
  background: rgba(58,120,80,0.05);
  box-shadow: inset 0 0 40px rgba(58,120,80,0.04);
}

.clean-list {
  list-style: none;
  padding: 0;
  margin: 0;
  text-align: center;
}

.clean-list li {
  font-family: var(--f-display);
  font-size: 1.05rem;
  color: var(--text-1);
  margin-bottom: 14px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-faint);
  transition: color 0.2s;
}

.clean-list li:last-child { border-bottom: none; }

.clean-list li:hover { color: var(--text-0); }

/* Bullet cristallo prima di ogni li */
.clean-list li::before {
  content: '◆';
  margin-right: 10px;
  font-size: 0.55rem;
  color: var(--gold);
  vertical-align: middle;
}

/* ============================================================
   DIVISORE "OPPURE" (login/register)
   ============================================================ */

.divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 22px 0;
  color: var(--text-2);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  font-family: var(--f-ui);
}

.divider hr {
  flex: 1;
  border: none;
  border-top: 1px solid var(--border);
}

/* Bottone Google */
.btn-google {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 13px;
  border: 1px solid var(--border-bright);
  border-radius: var(--r-pill);
  background: var(--surface-2);
  cursor: pointer;
  font-family: var(--f-ui);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-1);
  transition: background 0.25s, border-color 0.25s, box-shadow 0.25s;
  text-transform: uppercase;
  margin: 0 !important;
}

.btn-google:hover {
  background: var(--surface-3);
  border-color: var(--border-bright);
  box-shadow: var(--shadow-sm);
  color: var(--text-0);
}

/* ============================================================
   TOAST NOTIFICATION (usato da account.js)
   ============================================================ */

#toastNotification {
  font-family: var(--f-ui) !important;
  font-size: 0.8rem !important;
  letter-spacing: 0.06em !important;
}

/* ============================================================
   THEME TOGGLE BUTTON
   ============================================================ */

#theme-toggle-wrapper {
  position: fixed;
  bottom: 88px;
  right: 28px;
  z-index: 9800;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

#theme-toggle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.15);
  background: #19171e;
  box-shadow: 0 4px 20px rgba(0,0,0,0.6), 0 0 0 1px rgba(58,120,80,0.2);
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: box-shadow 0.3s, transform 0.2s;
  color: white;
}

[data-theme="light"] #theme-toggle {
  background: #ffffff;
  border-color: rgba(60,90,60,0.25);
  box-shadow: 0 4px 20px rgba(40,60,40,0.18);
  color: #1e2a1e;
}

#theme-toggle:hover {
  box-shadow: 0 4px 24px rgba(0,0,0,0.7), 0 0 0 2px rgba(58,120,80,0.5);
  transform: scale(1.06);
}

#theme-toggle-label {
  position: absolute;
  right: 58px;
  bottom: 10px;
  background: #19171e;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  padding: 4px 10px;
  font-family: 'Josefin Sans', sans-serif;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.5);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}

[data-theme="light"] #theme-toggle-label {
  background: #ffffff;
  color: rgba(30,42,30,0.5);
  border-color: rgba(60,90,60,0.2);
}

#theme-toggle-wrapper:hover #theme-toggle-label { opacity: 1; }

/* ============================================================
   SCROLLBAR PERSONALIZZATA
   ============================================================ */

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: var(--surface-3);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ============================================================
   SELEZIONE TESTO
   ============================================================ */

::selection {
  background: rgba(58,120,80,0.35);
  color: var(--text-0);
}