/* =========================================================
   LegalClarity — Design System (rinnovato)
   ========================================================= */
:root {
  /* Palette principale (TEAL premium) */
  --lc-green-darkest: #003636;
  --lc-green-dark: #004d4d;
  --lc-green: #008080;
  --lc-green-light: #00a3a3;
  --lc-green-accent: #00c2c2;
  --lc-mint: #d4f4f4;

  /* Neutri */
  --lc-bg-page: #eef5f5;
  --lc-bg-soft: #f5fafa;
  --lc-bg-card: #ffffff;
  --lc-text: #1f2937;
  --lc-text-muted: #6b7785;
  --lc-border: #e3eded;

  /* Stati / accenti */
  --lc-amber: #f59e0b;
  --lc-amber-soft: #fff3d6;
  --lc-red: #ef4444;
  --lc-red-soft: #fee2e2;
  --lc-success: #10b981;
  --lc-info: #3b82f6;

  /* Compatibilità con vecchi nomi (mantengo per non rompere nulla) */
  --orange: #c45a37;
  --orange-soft: #e08a5b;
  --orange-border: #d47047;
  --bg-body: var(--lc-bg-page);
  --bg-card: var(--lc-bg-card);
  --bg-drop: var(--lc-mint);
  --text-main: var(--lc-text);
  --text-muted: var(--lc-text-muted);
  --red: var(--lc-red);
  --amber: var(--lc-amber);

  /* Geometria */
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  /* Ombre */
  --shadow-xs: 0 1px 2px rgba(0, 77, 77, 0.05);
  --shadow-sm: 0 4px 12px rgba(0, 77, 77, 0.06);
  --shadow-md: 0 10px 30px rgba(0, 77, 77, 0.08);
  --shadow-lg: 0 20px 50px rgba(0, 77, 77, 0.12);
  --shadow-glow: 0 0 0 4px rgba(0, 194, 194, 0.18);
  --shadow-soft: var(--shadow-md);

  /* Gradients */
  --grad-primary: linear-gradient(135deg, #00c2c2 0%, #008080 50%, #004d4d 100%);
  --grad-primary-soft: linear-gradient(135deg, #d4f4f4 0%, #b0e0e0 100%);
  --grad-hero: radial-gradient(ellipse at top left, rgba(0, 194, 194, 0.18) 0%, transparent 60%),
               radial-gradient(ellipse at bottom right, rgba(0, 128, 128, 0.14) 0%, transparent 60%);
  --grad-card: linear-gradient(180deg, #ffffff 0%, #f8fcfc 100%);

  /* Layout */
  --left-col: 38%;
  --right-col: 60%;

  /* Misc */
  --header-height: 70px;
}

/* =========================================================
   RESET & BASE
   ========================================================= */
* {
  box-sizing: border-box;
}

html, body {
  /* niente height:100% — schiacciava il body al viewport e tagliava il footer.
     Pattern sticky-footer corretto: min-height:100vh sul body in flex column. */
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--lc-bg-page);
  background-image:
    radial-gradient(circle at 0% 0%, rgba(0, 194, 194, 0.08), transparent 40%),
    radial-gradient(circle at 100% 100%, rgba(0, 77, 77, 0.06), transparent 40%);
  background-attachment: fixed;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: var(--lc-text);
  font-size: 16px;
  line-height: 1.65;
  letter-spacing: 0.1px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

a { text-decoration: none; }

/* Selezione testo */
::selection {
  background: rgba(0, 194, 194, 0.32);
  color: var(--lc-green-darkest);
}

/* Scrollbar morbida */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--lc-green-light), var(--lc-green-dark));
  border-radius: 999px;
  border: 2px solid var(--lc-bg-page);
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--lc-green-accent), var(--lc-green));
}

/* =========================================================
   APP SHELL
   ========================================================= */
.app-shell {
  width: min(1320px, 94%);
  margin: 0 auto 60px;
  flex: 1;
  position: relative;
}

/* =========================================================
   HEADER — restyled
   ========================================================= */
.header {
  background-color: var(--lc-green-dark) !important;
  color: white;
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.main-header {
  background-color: var(--lc-green-dark);
  position: sticky;
  top: 0;
  z-index: 999;
  box-shadow: var(--shadow-sm);
}

.navbar {
  background: linear-gradient(90deg, var(--lc-green-darkest) 0%, var(--lc-green-dark) 60%, #006262 100%) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  padding: 12px 20px;
  position: relative;
  z-index: 1050;
  min-height: 70px;
  /* niente overflow:hidden qui — clippava il dropdown utente */
}

/* Forza l'allineamento verticale centrale di TUTTI gli item della navbar
   (brand, nav-link, avatar) anche quando hanno altezze intrinseche diverse */
.navbar .container-fluid {
  align-items: center;
}

.navbar-nav {
  align-items: center;
}

.navbar-nav .nav-item {
  display: flex;
  align-items: center;
}

.navbar::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 10% 50%, rgba(0, 194, 194, 0.18), transparent 30%),
    radial-gradient(circle at 90% 50%, rgba(0, 194, 194, 0.12), transparent 30%);
  pointer-events: none;
  /* Il gradiente è già contenuto nel box; nessun bisogno di overflow:hidden sul parent */
}

/* Il tag <header> (usato in tutte le pagine) deve restare sopra i contenuti
   anche se le sezioni successive creano stacking context (es. .gui-hero
   con isolation:isolate, oppure .profile-hero) */
header {
  position: relative;
  z-index: 1050;
}

/* Il dropdown utente sopra tutto, anche sopra l'hero animato */
.dropdown-menu {
  z-index: 1100 !important;
}
.lc-dropdown {
  z-index: 1100 !important;
}

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

.navbar-brand {
  font-family: 'Yeseva One', serif;
  font-size: 1.4rem;
  color: white !important;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: 0.5px;
  transition: transform .25s ease, filter .25s ease;
}

.navbar-brand:hover {
  transform: translateY(-1px);
  filter: drop-shadow(0 4px 10px rgba(0, 194, 194, 0.5));
}

.navbar-brand img {
  filter: brightness(1.1) drop-shadow(0 2px 8px rgba(0, 194, 194, 0.4));
  transition: transform .35s ease;
}

.navbar-brand:hover img {
  transform: rotate(-6deg) scale(1.05);
}

.nav-link {
  color: rgba(255,255,255,0.92) !important;
  font-weight: 500;
  position: relative;
  padding: 8px 16px !important;
  border-radius: 10px;
  transition: all .22s ease;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 16px; right: 16px; bottom: 4px;
  height: 2px;
  background: var(--lc-green-accent);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .28s ease;
}

.nav-link:hover {
  color: white !important;
  background: rgba(255, 255, 255, 0.08);
}

.nav-link:hover::after { transform: scaleX(1); }

.dropdown-menu {
  border: none;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  margin-top: 8px;
}

.dropdown-item {
  padding: 10px 14px;
  border-radius: 8px;
  font-weight: 500;
  transition: all .18s ease;
}

.dropdown-item:hover {
  background: var(--lc-mint);
  color: var(--lc-green-dark);
  transform: translateX(2px);
}

.bg-green-dark { background-color: var(--lc-green-dark) !important; }

/* Brand mark-link (left part of original) */
.brand {
  font-family: "Yeseva One", serif;
  font-size: clamp(18px, 2.2vw, 26px);
  color: var(--lc-green-dark);
  letter-spacing: 1px;
}

.menu-link {
  font-size: 16px;
  margin-left: 20px;
  color: var(--lc-text);
  transition: color .15s;
}

.menu-link:hover { color: var(--lc-green-accent); }

.header-divider {
  height: 3px;
  background: var(--grad-primary);
  width: 100%;
}

/* =========================================================
   HERO — riprogettato con animazioni
   ========================================================= */
.hero {
  text-align: center;
  padding: 56px 16px 36px;
  position: relative;
  z-index: 1;
}

.hero-title {
  font-family: 'Yeseva One', serif;
  font-size: clamp(34px, 5.2vw, 60px);
  line-height: 1.06;
  margin: 0 0 14px;
  background: linear-gradient(90deg, var(--lc-green-dark) 0%, var(--lc-green) 50%, var(--lc-green-accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  background-size: 220% 100%;
  animation: gradientShift 8s ease-in-out infinite;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}

.hero-subtitle {
  font-size: clamp(15px, 2vw, 19px);
  color: var(--lc-text-muted);
  margin: 0 auto;
  max-width: 720px;
  font-weight: 400;
}

/* Floating shapes nella hero (decorative) */
.hero-deco {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: -1;
}

.hero-deco span {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 194, 194, 0.35), transparent 70%);
  filter: blur(40px);
  animation: floatBlob 18s ease-in-out infinite;
}

.hero-deco span:nth-child(1) { width: 240px; height: 240px; top: -40px; left: 6%; }
.hero-deco span:nth-child(2) { width: 320px; height: 320px; top: 10%; right: -60px; animation-delay: -6s; }
.hero-deco span:nth-child(3) { width: 200px; height: 200px; bottom: -60px; left: 30%; animation-delay: -12s; }

@keyframes floatBlob {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(40px, -30px) scale(1.06); }
  66%      { transform: translate(-30px, 30px) scale(0.96); }
}

/* =========================================================
   CARDS GENERICHE
   ========================================================= */
.card-shell {
  background: var(--grad-card);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--lc-border);
  transition: transform .3s ease, box-shadow .3s ease;
}

.card-shell:hover {
  box-shadow: var(--shadow-lg);
}

/* =========================================================
   UPLOAD CARD — premium look
   ========================================================= */
.upload-card {
  padding: 26px 24px;
  margin-bottom: 22px;
  position: relative;
  overflow: hidden;
}

.upload-card::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -10%;
  width: 50%;
  height: 200%;
  background: radial-gradient(ellipse, rgba(0, 194, 194, 0.08), transparent 60%);
  pointer-events: none;
}

.upload-label {
  font-weight: 700;
  font-size: 18px;
  color: var(--lc-green-dark);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.upload-label::before {
  content: "";
  width: 6px;
  height: 24px;
  background: var(--grad-primary);
  border-radius: 4px;
  display: inline-block;
}

.upload-label span {
  font-weight: 400;
  font-size: 14px;
  color: var(--lc-text-muted);
}

.file-drop {
  border: 2px dashed var(--lc-green-light);
  border-radius: var(--radius-md);
  padding: 28px 18px;
  cursor: pointer;
  background: linear-gradient(135deg, var(--lc-mint) 0%, #e6f7f7 100%);
  color: var(--lc-green-dark);
  text-align: center;
  font-weight: 600;
  transition: all .3s cubic-bezier(.4, 0, .2, 1);
  position: relative;
  overflow: hidden;
}

.file-drop::before {
  content: "📄";
  display: block;
  font-size: 38px;
  margin-bottom: 8px;
  filter: grayscale(0.2);
  transition: transform .35s ease;
}

.file-drop:hover {
  border-color: var(--lc-green-accent);
  background: linear-gradient(135deg, #c4ecec 0%, #d4f4f4 100%);
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(0, 194, 194, 0.18);
}

.file-drop:hover::before {
  transform: translateY(-4px) scale(1.06);
}

.file-drop:focus,
.file-drop.bg-light {
  outline: 3px solid rgba(0, 194, 194, 0.3);
  outline-offset: 3px;
}

.file-info {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--lc-bg-soft);
  border-radius: var(--radius-sm);
  border: 1px solid var(--lc-border);
  color: var(--lc-text);
  font-weight: 500;
  animation: slideInUp .35s ease;
}

.buttons-container {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

/* =========================================================
   BOTTONI — sistema unificato
   ========================================================= */
.btn {
  border-radius: var(--radius-sm);
  font-weight: 600;
  letter-spacing: .2px;
  transition: all .22s ease;
  position: relative;
  overflow: hidden;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--grad-primary) !important;
  border: none !important;
  color: white !important;
  box-shadow: 0 6px 16px rgba(0, 128, 128, 0.28);
}

.btn-primary:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(0, 128, 128, 0.36);
}

.btn-success {
  background: linear-gradient(135deg, #10b981, #059669) !important;
  border: none !important;
  color: white !important;
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.28);
}

.btn-success:hover {
  filter: brightness(1.07);
  transform: translateY(-1px);
}

.btn-warning {
  background: linear-gradient(135deg, #fbbf24, #f59e0b) !important;
  border: none !important;
  color: #4a2e00 !important;
  font-weight: 700;
  box-shadow: 0 6px 16px rgba(245, 158, 11, 0.3);
}

.btn-warning:hover { filter: brightness(1.05); transform: translateY(-1px); }

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626) !important;
  border: none !important;
  color: white !important;
  box-shadow: 0 6px 16px rgba(239, 68, 68, 0.28);
}

.btn-info {
  background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
  border: none !important;
  color: white !important;
}

.btn-dark {
  background: linear-gradient(135deg, var(--lc-green-darkest), var(--lc-green-dark)) !important;
  border: none !important;
  color: white !important;
  box-shadow: 0 6px 16px rgba(0, 77, 77, 0.3);
}

.btn-dark:hover { filter: brightness(1.1); transform: translateY(-1px); }

.btn-secondary {
  background: #e6f0f0 !important;
  border: 1px solid var(--lc-border) !important;
  color: var(--lc-green-dark) !important;
  font-weight: 600;
}

.btn-secondary:hover { background: var(--lc-mint) !important; }

.btn-outline-primary {
  border: 1.5px solid var(--lc-green) !important;
  color: var(--lc-green-dark) !important;
  background: white !important;
  font-weight: 600;
}

.btn-outline-primary:hover {
  background: var(--lc-mint) !important;
  color: var(--lc-green-darkest) !important;
}

.btn-outline-secondary {
  border: 1.5px solid var(--lc-border) !important;
  color: var(--lc-text-muted) !important;
  background: white !important;
}

.btn-outline-secondary:hover {
  background: var(--lc-bg-soft) !important;
  color: var(--lc-green-dark) !important;
  border-color: var(--lc-green-light) !important;
}

.btn-outline-warning {
  border: 1.5px solid var(--lc-amber) !important;
  color: #92400e !important;
  background: white !important;
  font-weight: 600;
}

.btn-outline-warning:hover {
  background: var(--lc-amber-soft) !important;
}

/* Effetto "shine" su hover dei bottoni primary/dark */
.btn-primary::after,
.btn-dark::after,
.btn-success::after {
  content: "";
  position: absolute;
  top: 0; left: -75%;
  width: 50%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  transform: skewX(-20deg);
  transition: left .6s ease;
}

.btn-primary:hover::after,
.btn-dark:hover::after,
.btn-success:hover::after {
  left: 130%;
}

/* =========================================================
   AI SUGGESTION (analisi globale)
   ========================================================= */
.ai-suggestion {
  background: linear-gradient(135deg, #f4fbff 0%, #e9f7ff 100%);
  border: 1px solid #cfe7f7;
  padding: 18px 20px;
  border-radius: var(--radius-md);
  margin-top: 14px;
  box-shadow: var(--shadow-sm);
}

.ai-suggestion h5 {
  margin: 0 0 10px;
  font-weight: 700;
  color: #0b6dab;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-suggestion h5::before {
  content: "🧠";
  font-size: 1.05em;
}

/* =========================================================
   COLONNE LIST + DETAIL
   ========================================================= */
#columnsWrapper {
  display: grid;
  grid-template-columns: minmax(300px, var(--left-col)) minmax(360px, var(--right-col));
  gap: 22px;
  align-items: start;
  margin-top: 18px;
}

.col-right-scroll {
  max-height: 720px;
  overflow-y: auto;
  padding: 4px 8px 4px 0;
}

.two-card {
  padding: 20px;
  border-radius: var(--radius-lg);
  background: var(--grad-card);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--lc-border);
  transition: box-shadow .3s ease;
}

.two-card:hover { box-shadow: var(--shadow-lg); }

.card-title-section {
  font-family: 'Yeseva One', serif;
  font-size: 20px;
  color: var(--lc-green-dark);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-subtitle-muted {
  font-size: 14px;
  color: var(--lc-text-muted);
  margin-bottom: 14px;
}

/* =========================================================
   CLAUSOLE LIST
   ========================================================= */
#clausoleList {
  max-height: 600px;
  overflow: auto;
  padding-right: 6px;
}

.article-group {
  background: linear-gradient(135deg, #ffffff 0%, var(--lc-bg-soft) 100%);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 12px;
  border: 1px solid var(--lc-border);
  transition: all .25s ease;
}

.article-group:hover {
  border-color: var(--lc-green-light);
  box-shadow: var(--shadow-sm);
}

.article-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.article-title {
  font-weight: 700;
  color: var(--lc-green-dark);
  font-size: 15px;
}

.article-sub {
  font-size: 12.5px;
  color: var(--lc-text-muted);
}

.article-toggle {
  font-size: 18px;
  color: var(--lc-green);
  transition: transform .25s ease;
}

.article-body {
  margin-top: 10px;
}

/* Clausola item */
.clausola-list-item {
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 8px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: white;
  border: 1px solid var(--lc-border);
  cursor: pointer;
  transition: all .22s ease;
  position: relative;
}

.clausola-list-item:hover {
  border-color: var(--lc-green-accent);
  transform: translateX(2px);
  box-shadow: var(--shadow-sm);
}

.clausola-list-item.selected {
  border-color: var(--lc-green) !important;
  background: linear-gradient(135deg, #ffffff 0%, var(--lc-mint) 100%) !important;
  box-shadow: 0 0 0 3px rgba(0, 194, 194, 0.16);
}

.clausola-list-item.selected::before {
  content: "";
  position: absolute;
  left: -1px; top: -1px; bottom: -1px;
  width: 4px;
  background: var(--grad-primary);
  border-radius: 4px 0 0 4px;
}

.clausola-list-title {
  font-weight: 700;
  font-size: 14.5px;
  color: var(--lc-text);
}

.clausola-list-snippet {
  font-size: 13px;
  color: var(--lc-text-muted);
  line-height: 1.5;
  margin-top: 2px;
}

.clausola-list-main { flex: 1; min-width: 0; }

/* Checkbox circle */
.checkbox-circle {
  width: 22px;
  height: 22px;
  border-radius: 30%;
  border: 2px solid #c0cfcf;
  background: white;
  flex-shrink: 0;
  cursor: pointer;
  margin-top: 2px;
  transition: all .22s ease;
}

.checkbox-circle:hover { border-color: var(--lc-green); }

.checkbox-circle.empty {
  background: var(--lc-green-accent);
  border-color: var(--lc-green);
}

.checkbox-circle.done {
  background: var(--lc-green-dark);
  border-color: var(--lc-green-darkest);
  position: relative;
}

.checkbox-circle.done::after {
  content: "✓";
  color: white;
  font-size: 13px;
  font-weight: 700;
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Pills */
.clause-type-pill {
  font-size: 11.5px;
  padding: 3px 10px;
  border-radius: 999px;
  margin-left: 6px;
  font-weight: 600;
  letter-spacing: .2px;
}

.pill-giusta {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
}

.pill-vessatoria {
  background: var(--lc-amber-soft);
  border: 1px solid #fcd34d;
  color: #92400e;
}

.pill-gravosa {
  background: var(--lc-red-soft);
  border: 1px solid #fca5a5;
  color: #991b1b;
}

.pill-da-analizzare {
  background: white;
  color: #92400e;
}

/* =========================================================
   DETAIL AREA
   ========================================================= */
#clausolaDetail {
  min-height: 240px;
  font-size: 16px;
}

.detail-pill-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.detail-pill-row .badge {
  background: var(--lc-mint) !important;
  color: var(--lc-green-darkest) !important;
  border: 1px solid var(--lc-green-light) !important;
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: 999px;
}

.detail-section-title {
  font-weight: 700;
  margin-top: 8px;
  margin-bottom: 6px;
  color: var(--lc-green-dark);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: .8px;
}

.detail-text {
  font-size: 15.5px;
  line-height: 1.7;
  color: var(--lc-text);
}

.detail-note {
  font-size: 13.5px;
  color: #b45309;
  font-style: italic;
  margin-top: 6px;
}

/* AI block dentro al dettaglio */
.detail-ai-block {
  background: linear-gradient(135deg, #fff8ec 0%, #fffbf2 100%);
  border: 1px solid #ffe1a6;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  margin-top: 12px;
  box-shadow: var(--shadow-xs);
}

/* =========================================================
   RATING BAR (orizzontale + verticale)
   ========================================================= */
.rating-horizontal-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.rating-horizontal {
  width: 220px;
  height: 14px;
  background: linear-gradient(90deg, #fee2e2, #fef3c7, #d1fae5);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
  border: 1px solid var(--lc-border);
  flex-shrink: 0;
}

.rating-horizontal .rating-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--lc-green-accent), var(--lc-green));
  border-radius: 999px;
  transition: width .9s cubic-bezier(.4, 0, .2, 1);
  box-shadow: 0 0 12px rgba(0, 194, 194, 0.55);
}

.rating-percent {
  font-weight: 800;
  font-size: 18px;
  color: var(--lc-green);
  min-width: 50px;
  text-align: right;
}

.rating-labels { font-size: 13px; color: var(--lc-text-muted); }

/* AI readability mini bar */
.ai-readit-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.ai-readit-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--lc-green);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: .4px;
}

.ai-readit-bar {
  flex: 1;
  height: 8px;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 999px;
  overflow: hidden;
}

.ai-readit-bar > div {
  height: 100%;
  width: 0%;
  background: var(--grad-primary);
  border-radius: 999px;
  transition: width .8s cubic-bezier(.4, 0, .2, 1);
}

.ai-readit-value {
  font-size: 12px;
  font-weight: 700;
  color: var(--lc-green);
  min-width: 44px;
  text-align: right;
}

/* =========================================================
   SUPERVISIONE
   ========================================================= */
.supervision-panel {
  display: none;
  animation: fadeIn .3s ease;
}

.supervision-field { margin-bottom: 15px; }

.input-group-text {
  background: white;
  cursor: pointer;
  border-left: none;
}

.supervision-field input { border-right: none; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Toggle btn (Vessatoria / Gravosa / Normative) */
.btn-check + .btn-custom-toggle {
  background-color: white !important;
  border: 1.5px solid var(--lc-border) !important;
  color: var(--lc-text-muted) !important;
  font-weight: 600;
  border-radius: var(--radius-sm) !important;
  transition: all .22s ease;
}

.btn-check + .btn-custom-toggle:hover {
  border-color: var(--lc-green-light) !important;
  background: var(--lc-mint) !important;
  color: var(--lc-green-dark) !important;
}

.btn-check:checked + .btn-custom-toggle {
  background: var(--grad-primary) !important;
  border-color: transparent !important;
  color: white !important;
  box-shadow: 0 4px 12px rgba(0, 128, 128, 0.3);
}

/* =========================================================
   SEARCH INPUT
   ========================================================= */
#searchInput {
  border-radius: 999px;
  padding: 12px 18px;
  font-size: 15px;
  border: 1.5px solid var(--lc-border);
  background: white;
  transition: all .22s ease;
}

#searchInput:focus {
  border-color: var(--lc-green-accent);
  box-shadow: 0 0 0 4px rgba(0, 194, 194, 0.16);
  outline: none;
}

/* =========================================================
   FORM CONTROLS GENERICI
   ========================================================= */
.form-control,
.form-select {
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--lc-border);
  padding: 10px 14px;
  font-size: 14.5px;
  transition: all .22s ease;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--lc-green-accent);
  box-shadow: 0 0 0 4px rgba(0, 194, 194, 0.14);
  outline: none;
}

/* =========================================================
   BACK TO TOP
   ========================================================= */
#backToTop {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: none;
  z-index: 999;
  background: var(--grad-primary) !important;
  border: none !important;
  color: white !important;
  border-radius: 50% !important;
  width: 48px;
  height: 48px;
  font-size: 12px;
  font-weight: 700;
  box-shadow: var(--shadow-lg);
  padding: 0 !important;
  min-width: 0 !important;
  line-height: 1.2 !important;
  transition: transform .25s ease, box-shadow .25s ease;
}

#backToTop:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 16px 40px rgba(0, 128, 128, 0.4);
}

/* =========================================================
   FOOTER
   ========================================================= */
footer.site-footer {
  background: linear-gradient(135deg, var(--lc-green-darkest) 0%, var(--lc-green-dark) 60%, #006464 100%);
  color: white;
  margin-top: auto;
  padding: 36px 24px 28px;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

footer.site-footer::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 0%, rgba(0, 194, 194, 0.18), transparent 40%),
    radial-gradient(circle at 80% 100%, rgba(0, 194, 194, 0.12), transparent 40%);
  pointer-events: none;
}

footer.site-footer > * { position: relative; z-index: 1; }

footer .footer-inner {
  width: min(1320px, 94%);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 28px;
  align-items: center;
  flex-wrap: wrap;
}

footer .contacts {
  font-size: 14px;
  line-height: 1.9;
}

footer .contacts a {
  color: #cbeded;
  text-decoration: none;
  transition: color .2s;
}

footer .contacts a:hover {
  color: var(--lc-green-accent);
  text-decoration: underline;
}

footer .logs {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
}

footer .logs > div {
  text-align: center;
  font-size: 12.5px;
  opacity: 0.95;
}

footer .logs img {
  filter: brightness(1.2) drop-shadow(0 2px 6px rgba(0, 194, 194, 0.4));
  background: rgba(255, 255, 255, 0.92);
  padding: 6px 8px;
  border-radius: 8px;
  transition: transform .25s ease;
}

footer .logs > div:hover img {
  transform: translateY(-2px) scale(1.04);
}

/* Highlight per ricerca */
.highlight {
  background: linear-gradient(180deg, transparent 60%, #fde68a 60%);
  padding: 0 2px;
  font-weight: 600;
}

/* =========================================================
   ANIMAZIONI scroll-reveal
   ========================================================= */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .8s ease, transform .8s ease;
  will-change: opacity, transform;
}

.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: .08s; }
.reveal-delay-2 { transition-delay: .16s; }
.reveal-delay-3 { transition-delay: .24s; }
.reveal-delay-4 { transition-delay: .32s; }

@keyframes slideInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulseSoft {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 194, 194, 0.4); }
  50%      { box-shadow: 0 0 0 14px rgba(0, 194, 194, 0); }
}

/* =========================================================
   GUI3.1.1 — sezione INTRO (nuova)
   ========================================================= */
.intro-block {
  margin: 28px 0 48px;
  position: relative;
}

.intro-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  background: var(--grad-primary);
  color: white !important;
  font-weight: 700;
  font-size: 16px;
  border-radius: 999px;
  box-shadow: 0 12px 30px rgba(0, 128, 128, 0.3);
  transition: transform .25s ease, box-shadow .25s ease;
  border: none;
  cursor: pointer;
  text-decoration: none;
}

.intro-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(0, 128, 128, 0.42);
  color: white !important;
}

.intro-cta .arrow {
  display: inline-block;
  transition: transform .25s ease;
}

.intro-cta:hover .arrow { transform: translateX(4px); }

/* Feature cards */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin: 24px 0 0;
}

.feature-card {
  background: var(--grad-card);
  border-radius: var(--radius-lg);
  padding: 26px 22px;
  border: 1px solid var(--lc-border);
  box-shadow: var(--shadow-sm);
  transition: all .35s ease;
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: "";
  position: absolute;
  top: -40%;
  right: -40%;
  width: 80%;
  height: 80%;
  background: radial-gradient(circle, rgba(0, 194, 194, 0.10), transparent 70%);
  transition: transform .6s ease;
}

.feature-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--lc-green-light);
}

.feature-card:hover::before {
  transform: translate(-15%, 15%);
}

.feature-icon {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--grad-primary);
  color: white;
  font-size: 24px;
  margin-bottom: 14px;
  box-shadow: 0 8px 20px rgba(0, 128, 128, 0.28);
  transition: transform .35s ease;
}

.feature-card:hover .feature-icon {
  transform: rotate(-6deg) scale(1.06);
}

.feature-title {
  font-family: 'Yeseva One', serif;
  font-size: 19px;
  color: var(--lc-green-dark);
  margin: 0 0 6px;
}

.feature-desc {
  font-size: 14px;
  color: var(--lc-text-muted);
  line-height: 1.6;
  margin: 0;
}

/* Steps */
.steps-block {
  margin: 56px 0 32px;
  text-align: center;
}

.section-eyebrow {
  display: inline-block;
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--lc-green);
  background: var(--lc-mint);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 12px;
}

.section-title {
  font-family: 'Yeseva One', serif;
  font-size: clamp(26px, 4vw, 40px);
  color: var(--lc-green-dark);
  margin: 0 0 10px;
  line-height: 1.1;
}

.section-subtitle {
  font-size: 16px;
  color: var(--lc-text-muted);
  max-width: 640px;
  margin: 0 auto 28px;
}

.steps-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 22px;
  text-align: left;
  position: relative;
}

.step-item {
  background: white;
  border-radius: var(--radius-lg);
  padding: 22px 20px;
  border: 1px solid var(--lc-border);
  box-shadow: var(--shadow-sm);
  position: relative;
  transition: all .3s ease;
}

.step-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.step-num {
  position: absolute;
  top: -16px;
  left: 22px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--grad-primary);
  color: white;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  box-shadow: 0 6px 16px rgba(0, 128, 128, 0.3);
}

.step-title {
  font-weight: 700;
  color: var(--lc-green-dark);
  margin: 8px 0 6px;
  font-size: 16px;
}

.step-desc {
  font-size: 13.5px;
  color: var(--lc-text-muted);
  line-height: 1.55;
  margin: 0;
}

/* Stats / trust strip */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin: 36px 0 0;
  padding: 24px 22px;
  background: linear-gradient(135deg, var(--lc-green-darkest), var(--lc-green-dark));
  border-radius: var(--radius-lg);
  color: white;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.stats-strip::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 0% 0%, rgba(0, 194, 194, 0.22), transparent 50%),
    radial-gradient(circle at 100% 100%, rgba(0, 194, 194, 0.16), transparent 50%);
  pointer-events: none;
}

.stat-item {
  text-align: center;
  position: relative;
  z-index: 1;
}

.stat-num {
  font-family: 'Yeseva One', serif;
  font-size: clamp(26px, 3vw, 36px);
  background: linear-gradient(135deg, #ffffff, var(--lc-mint));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: block;
  line-height: 1.05;
}

.stat-label {
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: rgba(255,255,255,0.82);
  margin-top: 6px;
}

/* =========================================================
   COMPATIBILITÀ con vecchi nomi/badges
   ========================================================= */
.text-green { color: var(--lc-green-dark) !important; }
.text-orange { color: var(--lc-green-dark) !important; }

/* =========================================================
   MEDIA QUERIES
   ========================================================= */
@media (max-width: 992px) {
  .col-right-40 {
    flex: 0 0 100%;
    max-width: 100%;
  }
  #columnsWrapper {
    grid-template-columns: 1fr;
  }
  .col-left-60, .col-right-40 {
    max-width: 100% !important;
  }
  .app-shell { width: 96%; }
}

@media (max-width: 768px) {
  .navbar-brand { font-size: 1.15rem; }
  .hero { padding: 36px 12px 22px; }
  footer .footer-inner { flex-direction: column; align-items: flex-start; }
  footer .logs { gap: 12px; }
  #clausoleList { max-height: 380px; }
  .rating-horizontal-wrap { gap: 8px; }
  .rating-horizontal { width: 140px; }
}

@media (max-width: 576px) {
  .brand { font-size: 18px; }
  .hero-title { font-size: 28px; }
  .hero-subtitle { font-size: 14px; }
  .file-drop { padding: 18px 12px; }
  .card-title-section { font-size: 17px; }
  .upload-card { padding: 18px 16px; }
  .feature-card { padding: 20px 16px; }
}

/* Riduce animazioni se l'utente preferisce */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* =========================================================
   GUI page — utilities aggiuntive
   ========================================================= */
.user-avatar-link {
  position: relative;
  display: inline-block;
}
.user-avatar-link::after {
  display: none !important;
}
.user-avatar {
  border: 2px solid rgba(255,255,255,0.4);
  transition: all .25s ease;
  background: rgba(255,255,255,0.06);
}
.user-avatar-link:hover .user-avatar,
.user-avatar-link[aria-expanded="true"] .user-avatar {
  border-color: var(--lc-green-accent);
  box-shadow: 0 0 0 4px rgba(0, 194, 194, 0.25);
  transform: scale(1.04);
}

.lc-dropdown .dropdown-item {
  padding: 10px 14px;
  border-radius: 8px;
  font-weight: 500;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}
.lc-dropdown .dropdown-item:hover {
  background: var(--lc-mint);
  color: var(--lc-green-dark);
  transform: translateX(2px);
}
.lc-dropdown .dropdown-item.text-danger:hover {
  background: var(--lc-red-soft);
  color: var(--lc-red);
}

/* Supervision button */
.btn-supervision {
  background: linear-gradient(135deg, #1a2bc6 0%, #4f5fe0 100%) !important;
  border: none !important;
  color: #fff !important;
  border-radius: 14px !important;
  padding: 14px 18px !important;
  font-weight: 700;
  letter-spacing: 0.2px;
  box-shadow: 0 10px 24px rgba(26, 43, 198, 0.28);
  position: relative;
  overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease;
}
.btn-supervision::before {
  content: "";
  position: absolute;
  top: 0; left: -120%;
  width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
  transform: skewX(-22deg);
  transition: left .7s ease;
}
.btn-supervision:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(26, 43, 198, 0.4);
  color: #fff !important;
}
.btn-supervision:hover::before { left: 130%; }
.btn-supervision:active { transform: translateY(0); }

/* Footer bottom bar */
.site-footer .footer-bottom {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.85rem;
  opacity: 0.78;
}
.site-footer .footer-bottom a {
  color: rgba(255,255,255,0.78);
  text-decoration: none;
  transition: color .2s ease;
}
.site-footer .footer-bottom a:hover {
  color: var(--lc-green-accent);
}
@media (max-width: 600px) {
  .site-footer .footer-bottom { flex-direction: column; align-items: flex-start; }
}

/* =========================================================
   AI REWRITE / ANALYSIS BLOCKS — DSA-friendly
   Linee guida DSA rispettate:
   - sfondo crema/avorio (riduce affaticamento visivo, contrasto morbido)
   - sans-serif (Inter), line-height generoso (1.75), letter-spacing 0.2px
   - testo allineato a sinistra, mai justify
   - alto contrasto testo/sfondo, niente corsivo/underline come emphasis
   - spaziatura ampia tra paragrafi e voci di lista
   ========================================================= */
.rewrite-block {
  background: linear-gradient(180deg, #fffaf0 0%, #fff5e1 100%);
  border-radius: 18px;
  padding: 22px 24px 24px;
  margin-bottom: 18px;
  position: relative;
  box-shadow: 0 6px 22px rgba(0, 77, 77, 0.06);
  border: 1px solid rgba(0, 128, 128, 0.10);
  overflow: hidden;
}
.rewrite-block::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: 5px;
  background: linear-gradient(180deg, var(--lc-green-accent) 0%, var(--lc-green) 50%, var(--lc-green-dark) 100%);
}

.rewrite-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.rewrite-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  background: var(--grad-primary);
  color: #fff;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  box-shadow: 0 4px 12px rgba(0, 128, 128, 0.28);
}
.rewrite-badge i { font-size: 0.95rem; }

.rewrite-title {
  font-family: 'Yeseva One', serif;
  font-size: 1.25rem;
  color: var(--lc-green-darkest);
  margin: 0;
  letter-spacing: 0.2px;
}

/* Barra leggibilità riscritta */
.readit-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(0, 128, 128, 0.10);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 16px;
}
.readit-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--lc-green-dark);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  white-space: nowrap;
}
.readit-bar {
  flex: 1;
  height: 12px;
  background: rgba(0, 77, 77, 0.10);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.readit-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--lc-green-accent) 0%, var(--lc-green) 60%, var(--lc-green-dark) 100%);
  border-radius: 999px;
  transition: width .6s cubic-bezier(.22, 1, .36, 1);
  position: relative;
  overflow: hidden;
}
.readit-bar-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.45), transparent);
  animation: barShine 2.6s ease-in-out infinite;
}
@keyframes barShine {
  0%, 100% { transform: translateX(-100%); }
  50% { transform: translateX(100%); }
}
.readit-value {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--lc-green-darkest);
  min-width: 48px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Corpo testo riscritto — DSA-friendly */
.rewrite-content {
  color: #2a3a3a;
  font-size: 1rem;
  line-height: 1.75;
  letter-spacing: 0.2px;
  text-align: left;
}
.rewrite-content h1, .rewrite-content h2, .rewrite-content h3,
.rewrite-content h4, .rewrite-content h5, .rewrite-content h6 {
  color: var(--lc-green-darkest);
  font-weight: 700;
  letter-spacing: 0.1px;
  margin-top: 1.4em;
  margin-bottom: 0.6em;
  line-height: 1.35;
}
.rewrite-content h3 { font-size: 1.08rem; }
.rewrite-content h4 { font-size: 1rem; }
.rewrite-content p {
  margin-bottom: 0.95em;
}
.rewrite-content ul, .rewrite-content ol {
  padding-left: 1.4em;
  margin-bottom: 1em;
}
.rewrite-content li {
  margin-bottom: 0.55em;
  padding-left: 0.2em;
}
.rewrite-content li::marker {
  color: var(--lc-green);
}
.rewrite-content strong, .rewrite-content b {
  color: var(--lc-green-darkest);
  font-weight: 700;
}
.rewrite-content em, .rewrite-content i {
  /* DSA: niente corsivo come unico marker di emphasis — uso peso + colore */
  font-style: normal;
  color: var(--lc-green-dark);
  font-weight: 600;
}
.rewrite-content a {
  color: var(--lc-green);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
}
.rewrite-content a:hover {
  color: var(--lc-green-dark);
}
.rewrite-content code {
  background: rgba(0, 128, 128, 0.10);
  color: var(--lc-green-darkest);
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 0.9em;
}

/* Variante "analisi" — stesso pattern, accento ambra per distinguere */
.analysis-block {
  background: linear-gradient(180deg, #ffffff 0%, #f6fbfb 100%);
  border-radius: 18px;
  padding: 22px 24px 24px;
  margin-bottom: 18px;
  position: relative;
  box-shadow: 0 6px 22px rgba(0, 77, 77, 0.06);
  border: 1px solid var(--lc-border);
  overflow: hidden;
}
.analysis-block::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: 5px;
  background: linear-gradient(180deg, #fbbf24 0%, var(--lc-amber) 100%);
}
.analysis-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.analysis-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  color: #fff;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.28);
}
.btn-rerun {
  background: transparent;
  border: 1.5px solid var(--lc-amber);
  color: var(--lc-amber);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all .22s ease;
}
.btn-rerun:hover {
  background: var(--lc-amber);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.32);
}
