/* ── Voxlab — main.css ──────────────────────────────────────────────────────── */
:root {
  --bg:      #0f1117;
  --surface: #1a1d27;
  --surface2:#222636;
  --border:  #2e3348;
  --primary: #3b82f6;
  --primary-h:#2563eb;
  --success: #22c55e;
  --danger:  #ef4444;
  --text:    #e2e8f0;
  --text-2:  #94a3b8;
  --radius:  10px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter', system-ui, sans-serif; background: var(--bg);
       color: var(--text); min-height: 100vh; font-size: 16px; }
a    { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Buttons ─────────────────────────────────────────────────────────────────*/
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; padding: 8px 16px; border-radius: var(--radius);
  border: 1px solid transparent; cursor: pointer; font-size: .875rem;
  font-weight: 600; transition: opacity .15s, background .15s;
}
.btn:hover  { opacity: .88; }
.btn--full  { width: 100%; }
.btn--lg    { padding: 12px 24px; font-size: 1rem; }
.btn--sm    { padding: 5px 10px; font-size: .78rem; }
.btn--primary { background: var(--primary); color: #fff; }
.btn--primary:hover { background: var(--primary-h); opacity: 1; }
.btn--ghost   { background: transparent; border-color: var(--border); color: var(--text-2); }
.btn--outline { background: transparent; border-color: var(--primary); color: var(--primary); }
.btn--danger  { background: var(--danger);  color: #fff; }
.btn--success { background: var(--success); color: #fff; }
.btn-icon { background: transparent; border: 1px solid var(--border);
            color: var(--text-2); padding: 3px 7px; border-radius: 6px;
            cursor: pointer; font-size: .8rem; }
.btn-icon:disabled { opacity: .3; cursor: default; }
.btn-icon--danger { color: var(--danger); border-color: var(--danger); }

/* ── Fields ──────────────────────────────────────────────────────────────────*/
.field { margin-bottom: 16px; }
.field label { display: block; font-size: .8rem; color: var(--text-2);
               margin-bottom: 5px; font-weight: 600; }
.field input, .field textarea, input[type="text"], input[type="email"],
input[type="password"] {
  width: 100%; padding: 9px 12px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface2);
  color: var(--text); font-size: .95rem;
}
.field input:focus, input[type="text"]:focus, input[type="email"]:focus,
input[type="password"]:focus { outline: 2px solid var(--primary); border-color: transparent; }
.hint { font-size: .75rem; color: var(--text-2); font-weight: 400; }

/* ── Flash ───────────────────────────────────────────────────────────────────*/
.flash-container { position: fixed; top: 16px; right: 16px; z-index: 999;
                   display: flex; flex-direction: column; gap: 8px; }
.flash { padding: 10px 16px; border-radius: 8px; font-size: .9rem; font-weight: 600; }
.flash--error   { background: #3b0d0d; border: 1px solid var(--danger); color: #fca5a5; }
.flash--success { background: #052e16; border: 1px solid var(--success); color: #86efac; }

/* ── Logo ────────────────────────────────────────────────────────────────────*/
.logo-icon { font-size: 1.3em; }
.logo-text { font-weight: 800; font-size: 1.1rem; letter-spacing: -.3px; }
.auth-logo { display: flex; align-items: center; gap: 8px; margin-bottom: 24px; }

/* ── Auth pages ──────────────────────────────────────────────────────────────*/
.auth-page { display: flex; align-items: center; justify-content: center;
             min-height: 100vh; padding: 24px; }
.auth-card { background: var(--surface); border: 1px solid var(--border);
             border-radius: 16px; padding: 36px 32px; width: 100%; max-width: 400px; }
.auth-title { font-size: 1.4rem; font-weight: 700; margin-bottom: 24px; }
.auth-footer { text-align: center; margin-top: 20px; font-size: .875rem; color: var(--text-2); }

/* ── Topbar ──────────────────────────────────────────────────────────────────*/
.topbar { display: flex; align-items: center; gap: 12px; padding: 10px 20px;
          background: var(--surface); border-bottom: 1px solid var(--border); }
.topbar__brand { font-weight: 800; font-size: 1.05rem; margin-right: auto; }
.topbar__right { display: flex; align-items: center; gap: 10px; }
.topbar__user  { font-size: .85rem; color: var(--text-2); }
.topbar__rename { display: flex; gap: 8px; align-items: center; flex: 1; max-width: 360px; }
.rename-input { flex: 1; padding: 6px 10px; border-radius: 8px;
                border: 1px solid var(--border); background: var(--surface2);
                color: var(--text); font-weight: 600; font-size: .95rem; }
.back-link { color: var(--text-2); font-size: .88rem; }
.back-link:hover { color: var(--text); text-decoration: none; }

/* ── Badge ───────────────────────────────────────────────────────────────────*/
.badge { display: inline-block; padding: 2px 8px; border-radius: 6px;
         font-size: .75rem; font-weight: 700; font-family: monospace;
         background: var(--surface2); border: 1px solid var(--border); color: var(--text-2); }
.badge--code { background: rgba(59,130,246,.15); border-color: var(--primary); color: var(--primary); }

/* ── Dashboard ───────────────────────────────────────────────────────────────*/
.dashboard-main  { max-width: 900px; margin: 0 auto; padding: 32px 20px; }
.dashboard-header{ display: flex; align-items: center; gap: 16px;
                   flex-wrap: wrap; margin-bottom: 28px; }
.dashboard-header h1 { font-size: 1.5rem; font-weight: 800; flex: 1; }
.inline-form { display: flex; gap: 8px; align-items: center; }
.inline-input { padding: 8px 12px; border-radius: 8px; border: 1px solid var(--border);
                background: var(--surface2); color: var(--text); min-width: 220px; }
.pres-grid    { display: grid; grid-template-columns: repeat(auto-fill,minmax(280px,1fr)); gap: 16px; }
.pres-card    { background: var(--surface); border: 1px solid var(--border);
                border-radius: 12px; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.pres-card:hover { border-color: var(--primary); }
.pres-card__title { font-weight: 700; font-size: 1.05rem; }
.pres-card__meta  { display: flex; align-items: center; gap: 10px; }
.pres-card__count { font-size: .8rem; color: var(--text-2); }
.pres-card__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.empty-state  { text-align: center; padding: 60px 20px; color: var(--text-2); }
.empty-state__icon { font-size: 3rem; margin-bottom: 12px; }

/* ── Edit page ───────────────────────────────────────────────────────────────*/
.edit-main   { max-width: 760px; margin: 0 auto; padding: 24px 20px; }
.slide-item  { background: var(--surface); border: 1px solid var(--border);
               border-radius: 12px; padding: 20px; margin-bottom: 16px; }
.slide-item__header { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.slide-num   { margin-right: auto; color: var(--text-2); font-size: .85rem; }
.slide-item__controls { display: flex; gap: 6px; }
.slide-type-badge { font-size: .72rem; padding: 3px 8px; border-radius: 20px;
                    font-weight: 700; text-transform: uppercase; letter-spacing: .4px; }
.slide-type-badge--multiple_choice { background: rgba(59,130,246,.2); color: #60a5fa; }
.slide-type-badge--word_cloud      { background: rgba(34,197,94,.2);  color: #4ade80; }
.slide-type-badge--open_text       { background: rgba(251,191,36,.2); color: #fbbf24; }
.options-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.add-slide-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
                 padding: 16px 0; border-top: 1px solid var(--border); margin-top: 8px; }
.add-slide-label { font-size: .85rem; color: var(--text-2); font-weight: 600; }
.empty-slides { color: var(--text-2); text-align: center; padding: 32px 0; }

/* ── Present page ────────────────────────────────────────────────────────────*/
.present-page  { overflow: hidden; }
.present-layout{ display: flex; height: 100vh; }

.present-sidebar { width: 280px; min-width: 240px; background: var(--surface);
                   border-right: 1px solid var(--border); display: flex;
                   flex-direction: column; overflow-y: auto; }
.sidebar-brand   { padding: 16px; font-weight: 800; border-bottom: 1px solid var(--border); }
.sidebar-section { padding: 16px; border-bottom: 1px solid var(--border); }
.sidebar-label   { font-size: .75rem; color: var(--text-2); font-weight: 700;
                   text-transform: uppercase; letter-spacing: .6px; margin-bottom: 10px; }
.join-label  { font-size: .75rem; color: var(--text-2); margin-bottom: 4px; }
.join-url    { font-size: .75rem; color: var(--primary); word-break: break-all; margin-bottom: 6px; }
.join-code   { font-size: 1.1rem; font-weight: 800; letter-spacing: 2px;
               font-family: monospace; margin-bottom: 10px; }
.qr-code     { width: 100%; max-width: 160px; border-radius: 8px; display: block; }
.participants-count { font-size: 1.2rem; font-weight: 700; }
.sidebar-slides { flex: 1; overflow-y: auto; }
.slide-thumb { display: flex; align-items: flex-start; gap: 8px; width: 100%;
               padding: 8px 10px; border-radius: 8px; background: transparent;
               border: 1px solid transparent; cursor: pointer; text-align: left;
               color: var(--text); margin-bottom: 4px; }
.slide-thumb:hover   { background: var(--surface2); }
.slide-thumb.is-active { background: rgba(59,130,246,.15); border-color: var(--primary); }
.slide-thumb__num  { font-size: .75rem; color: var(--text-2); min-width: 18px; }
.slide-thumb__q    { font-size: .82rem; line-height: 1.3; }
.sidebar-actions   { padding: 12px; border-top: 1px solid var(--border); margin-top: auto; }

.present-stage { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.stage-header  { display: flex; align-items: center; gap: 16px; padding: 12px 24px;
                 background: var(--surface); border-bottom: 1px solid var(--border); }
.stage-nav     { display: flex; align-items: center; gap: 12px; }
.stage-position { font-size: .9rem; color: var(--text-2); min-width: 60px; text-align: center; }
.stage-voting  { margin-left: auto; }
.stage-content { flex: 1; display: flex; flex-direction: column; align-items: center;
                 justify-content: center; padding: 32px; text-align: center; overflow-y: auto; }
/* In modalità summary: piena larghezza, scroll dall'alto */
.stage-content.is-summary { align-items: stretch; justify-content: flex-start;
                             text-align: left; padding: 20px 28px; }
.stage-placeholder      { color: var(--text-2); }
.stage-placeholder__hint{ font-size: .85rem; margin-top: 8px; }
.slide-question { font-size: 2rem; font-weight: 800; margin-bottom: 32px;
                  max-width: 700px; line-height: 1.25; }
.slide-options  { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 480px; }
.slide-option   { padding: 14px 20px; background: var(--surface2); border: 1px solid var(--border);
                  border-radius: 10px; font-weight: 600; font-size: 1rem; }
.slide-type-hint{ color: var(--text-2); font-size: 1rem; margin-top: 8px; }
.results-panel  { padding: 16px 24px; background: var(--surface);
                  border-top: 1px solid var(--border); max-height: 250px; overflow-y: auto; }
.results-count  { font-size: .85rem; color: var(--text-2); margin-bottom: 12px; }
.results-viz    { display: flex; flex-direction: column; gap: 8px; }
.bar-row        { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.bar-label      { min-width: 140px; max-width: 200px; font-size: .85rem; text-align: right;
                  color: var(--text-2); white-space: nowrap; overflow: hidden;
                  text-overflow: ellipsis; }
.bar-track      { flex: 1; background: var(--surface2); border-radius: 4px; height: 18px; overflow: hidden; }
.bar-fill       { height: 100%; background: var(--primary); border-radius: 4px;
                  transition: width .4s ease; }
.bar-pct        { font-size: .8rem; color: var(--text-2); min-width: 70px; }
.response-chip  { display: inline-block; background: var(--surface2); border: 1px solid var(--border);
                  border-radius: 20px; padding: 4px 12px; font-size: .85rem; margin: 3px; }

/* ── Audience: join ──────────────────────────────────────────────────────────*/
.join-page  { display: flex; align-items: center; justify-content: center;
              min-height: 100vh; padding: 24px; }
.join-card  { background: var(--surface); border: 1px solid var(--border);
              border-radius: 16px; padding: 36px 32px; width: 100%; max-width: 380px; }
.join-brand { display: flex; align-items: center; gap: 8px; margin-bottom: 20px; }
.join-title { font-size: 1.5rem; font-weight: 800; margin-bottom: 24px; }
.join-hint  { text-align: center; margin-top: 14px; font-size: .82rem; color: var(--text-2); }
.code-input { font-size: 1.4rem; font-weight: 800; letter-spacing: 4px;
              font-family: monospace; text-align: center; }

/* ── Audience: vote ──────────────────────────────────────────────────────────*/
.vote-page   { }
.vote-layout { display: flex; flex-direction: column; min-height: 100vh; }
.vote-header { display: flex; align-items: center; gap: 10px; padding: 14px 20px;
               background: var(--surface); border-bottom: 1px solid var(--border); }
.vote-pres-title { font-size: .9rem; color: var(--text-2); }
.vote-main   { flex: 1; display: flex; flex-direction: column; align-items: center;
               justify-content: center; padding: 32px 20px; }
.vote-question { font-size: 1.5rem; font-weight: 800; text-align: center;
                 margin-bottom: 28px; max-width: 560px; line-height: 1.3; }
.vote-options  { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 480px; }
.vote-option   { padding: 16px 20px; background: var(--surface); border: 2px solid var(--border);
                 border-radius: 12px; font-weight: 600; font-size: 1rem; cursor: pointer;
                 text-align: left; color: var(--text); transition: all .15s; }
.vote-option:hover  { border-color: var(--primary); background: rgba(59,130,246,.1); }
.vote-option:active { transform: scale(.98); }
.vote-open-form { width: 100%; max-width: 480px; display: flex; flex-direction: column; gap: 12px; }
.open-input    { font-size: 1.1rem; }
.vote-waiting, .vote-done { text-align: center; padding: 32px; }
.waiting-icon, .done-icon { font-size: 3rem; margin-bottom: 16px; }
.vote-waiting p, .vote-done p { color: var(--text-2); font-size: 1.1rem; }

/* ── Responsive ──────────────────────────────────────────────────────────────*/
@media (max-width: 640px) {
  .present-sidebar { display: none; }
  .slide-question  { font-size: 1.4rem; }
  .auth-card, .join-card { padding: 24px 18px; }
}

/* ── Partecipanti: avatar connessi ───────────────────────────────────────────*/
.participants-avatars { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 10px; }
.avatar-chip { font-size: 1.3rem; line-height: 1;
               animation: pop .3s ease; }
@keyframes pop { from { transform: scale(0); } to { transform: scale(1); } }

/* ── Stage voting: due pulsanti affiancati ───────────────────────────────────*/
.stage-voting { display: flex; gap: 8px; align-items: center; }

/* ── Word cloud ──────────────────────────────────────────────────────────────*/
.wordcloud { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center;
             justify-content: center; padding: 16px; }
.cloud-word { font-weight: 800; line-height: 1.1; transition: all .3s ease; }
.viz-empty  { color: var(--text-2); text-align: center; padding: 20px; font-style: italic; }

/* ── Summary (riepilogo finale) ──────────────────────────────────────────────*/
/* Summary: piena larghezza nel contenitore (gestita da is-summary) */
.summary-wrap  { width: 100%; text-align: left; }
.summary-title { font-size: 1.6rem; font-weight: 800; margin-bottom: 24px; text-align: center; }
.summary-slide { background: var(--surface); border: 1px solid var(--border);
                 border-radius: 12px; padding: 20px; margin-bottom: 16px; }
.summary-q     { font-weight: 700; font-size: 1.05rem; margin-bottom: 14px;
                 display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.summary-count { font-size: .78rem; color: var(--text-2); font-weight: 500; white-space: nowrap; }
.summary-viz   { }

/* ── Audience: avatar personale + sottotitolo ────────────────────────────────*/
.vote-sub   { color: var(--text-2); font-size: .95rem; margin-top: 6px; }
.you-avatar { font-size: 1.4rem; }

/* ════════════════════════════════════════════════════════════════════════════
   LANDING PAGE
   ════════════════════════════════════════════════════════════════════════════*/
.landing-page { background:
  radial-gradient(1200px 600px at 50% -10%, rgba(59,130,246,0.18), transparent 60%),
  var(--bg); }

.lp-nav { display: flex; align-items: center; justify-content: space-between;
          padding: 16px 28px; max-width: 1100px; margin: 0 auto; }
.lp-nav__brand { font-weight: 800; font-size: 1.15rem; }
.lp-nav__links { display: flex; gap: 10px; }

.lp-hero { max-width: 720px; margin: 0 auto; padding: 64px 24px 40px; text-align: center; }
.lp-hero__title { font-size: clamp(2.4rem, 6vw, 3.8rem); font-weight: 800;
                  line-height: 1.05; letter-spacing: -1.5px; margin-bottom: 20px; }
.lp-accent { color: var(--primary); }
.lp-hero__sub { font-size: 1.15rem; color: var(--text-2); max-width: 540px;
                margin: 0 auto 32px; line-height: 1.6; }
.lp-cta { display: flex; justify-content: center; gap: 12px; margin-bottom: 28px; }

.lp-join { display: flex; gap: 8px; max-width: 420px; margin: 0 auto;
           background: var(--surface); border: 1px solid var(--border);
           padding: 8px; border-radius: 14px; }
.lp-join__input { flex: 1; border: none !important; background: transparent !important;
                  font-size: 1.2rem; font-weight: 700; letter-spacing: 2px;
                  font-family: monospace; text-align: center; }
.lp-join__input:focus { outline: none !important; }
.lp-join__btn { background: var(--primary); color: #fff; white-space: nowrap; }
.lp-join__hint { font-size: .82rem; color: var(--text-2); margin-top: 10px; }

.lp-features { max-width: 1000px; margin: 40px auto; padding: 0 24px;
               display: grid; grid-template-columns: repeat(auto-fit, minmax(260px,1fr)); gap: 20px; }
.lp-feature { background: var(--surface); border: 1px solid var(--border);
              border-radius: 16px; padding: 28px 24px; text-align: center; }
.lp-feature:hover { border-color: var(--primary); }
.lp-feature__icon { font-size: 2.4rem; margin-bottom: 12px; }
.lp-feature h3 { font-size: 1.15rem; font-weight: 700; margin-bottom: 8px; }
.lp-feature p  { color: var(--text-2); font-size: .92rem; line-height: 1.55; }

.lp-steps { max-width: 760px; margin: 56px auto; padding: 0 24px; text-align: center; }
.lp-steps__title { font-size: 1.8rem; font-weight: 800; margin-bottom: 28px; }
.lp-steps__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px,1fr));
                  gap: 14px; text-align: left; }
.lp-step { background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
           padding: 16px 18px; display: flex; align-items: center; gap: 12px;
           font-size: .95rem; color: var(--text); }
.lp-step__n { display: inline-flex; align-items: center; justify-content: center;
              width: 28px; height: 28px; border-radius: 50%; background: var(--primary);
              color: #fff; font-weight: 800; font-size: .85rem; flex-shrink: 0; }

.lp-footer { max-width: 1100px; margin: 40px auto 0; padding: 24px;
             border-top: 1px solid var(--border); display: flex;
             justify-content: space-between; align-items: center; gap: 12px;
             font-size: .85rem; color: var(--text-2); flex-wrap: wrap; }

/* ── Results page / export bar ───────────────────────────────────────────────*/
.results-head { display: flex; align-items: flex-start; justify-content: space-between;
                gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.export-bar   { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.export-label { font-size: .82rem; color: var(--text-2); font-weight: 600; }
/* La pagina results usa le classi summary-* già definite */
.dashboard-page .summary-slide { background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 20px; margin-bottom: 16px; }
.dashboard-page .summary-q { display:flex; justify-content:space-between; gap:12px;
  align-items:baseline; font-weight:700; margin-bottom:14px; }

/* ── Identità partecipante (telefono) ────────────────────────────────────────*/
.vote-header { gap: 10px; }
.vote-me { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.me-avatar { font-size: 1.5rem; line-height: 1; }
.me-name-input { width: 130px; padding: 5px 9px !important; font-size: .82rem !important;
                 border-radius: 8px !important; background: var(--surface2) !important;
                 color: var(--text) !important;  /* fix: testo visibile su sfondo scuro */
                 border: 1px solid var(--border) !important; }
.me-name-input::placeholder { color: var(--text-2) !important; }
.wc-name { opacity: .9; }

/* Nome accanto all'avatar nella griglia connessi (presenter) */
.avatar-chip { display: inline-flex; align-items: center; gap: 4px;
               background: var(--surface2); border: 1px solid var(--border);
               border-radius: 20px; padding: 2px 8px 2px 6px; }
.avatar-name { font-size: .72rem; color: var(--text-2); font-weight: 600; }

/* ── Word cloud canvas (stage presenter) ─────────────────────────────────────*/
.wc-stage { position: relative; width: 92%; max-width: 1000px; height: 56vh;
            margin: 8px auto 0; }
.wc-stage canvas { width: 100%; height: 100%; display: block; }
.wc-empty { position: absolute; inset: 0; display: flex; align-items: center;
            justify-content: center; color: var(--text-2); font-style: italic; }

/* ── Presenter: results panel più grande e visibile ─────────────────────────*/
.results-panel {
  padding: 20px 28px; background: var(--surface);
  border-top: 2px solid var(--primary);
  max-height: 320px; overflow-y: auto;
}
.results-count { font-size: .95rem; color: var(--text-2); margin-bottom: 14px;
                 display: flex; align-items: center; gap: 8px; }

/* ── Summary: card per slide ────────────────────────────────────────────────*/
.sum-card  { background: var(--surface2); border: 1px solid var(--border);
             border-radius: 12px; padding: 20px 24px; margin-bottom: 16px; }
.sum-q     { font-size: 1.1rem; font-weight: 700; margin-bottom: 16px;
             display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.sum-count { font-size: .78rem; color: var(--text-2); font-weight: 500; white-space: nowrap; }
.sum-bar-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.sum-bar-label { width: 160px; min-width: 120px; max-width: 200px; font-size: .9rem;
                 color: var(--text); text-align: right; flex-shrink: 0;
                 white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sum-bar-track { flex: 1; background: var(--surface2); border-radius: 6px;
                 height: 26px; overflow: hidden; min-width: 0; }
.sum-bar-fill  { height: 100%; background: var(--primary); border-radius: 6px;
                 transition: width .5s ease; min-width: 6px; }
.sum-bar-pct   { font-size: .88rem; font-weight: 700; color: var(--text);
                 min-width: 90px; white-space: nowrap; }
.sum-bar-pct span { font-size: .75rem; color: var(--text-2); font-weight: 400; }
.sum-wordcloud { display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center;
                 justify-content: center; padding: 24px 12px; min-height: 160px; }
.sum-cloud-word { font-weight: 800; line-height: 1.3; cursor: default; }
.sum-word  { font-weight: 800; line-height: 1.2; }
.sum-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.sum-chip  { background: var(--surface); border: 1px solid var(--border); border-radius: 20px;
             padding: 5px 14px; font-size: .9rem; }
.sum-empty { color: var(--text-2); font-style: italic; font-size: .9rem; padding: 8px 0; }

/* ── Audience: attesa con avatar grande ─────────────────────────────────────*/
.vote-waiting-big { display: flex; flex-direction: column; align-items: center;
                    justify-content: center; padding: 48px 24px; gap: 16px; }
.waiting-avatar   { font-size: 5rem; line-height: 1; animation: pulse 2s infinite; }
@keyframes pulse   { 0%,100%{opacity:1} 50%{opacity:.6} }
.waiting-title     { font-size: 1.3rem; font-weight: 700; text-align: center; }
.waiting-sub       { font-size: .9rem; color: var(--text-2); text-align: center; }

/* Avatar grande nell'header telefono */
.me-avatar-big { font-size: 1.6rem; line-height: 1; }

/* Campo nome: solo nella schermata di attesa */
.vote-me { display: flex; align-items: center; gap: 8px; margin-left: auto; }

/* Bottoni di voto più grandi su mobile */
.vote-option { font-size: 1.1rem; padding: 18px 20px; }
@media (max-width: 480px) {
  .vote-question { font-size: 1.3rem; margin-bottom: 20px; }
  .vote-option   { font-size: 1rem; padding: 16px 16px; }
}

/* ── Barra partecipazione (risposte / connessi) ──────────────────────────────*/
.results-count { flex-wrap: wrap; gap: 8px 12px; }
.participation-bar-wrap { flex: 1; min-width: 80px; max-width: 200px;
  background: var(--surface2); border-radius: 6px; height: 10px; overflow: hidden; }
.participation-bar-fill { height: 100%; border-radius: 6px;
  transition: width .5s ease, background .3s ease; min-width: 0; }

/* ── Nuovi tipi di slide ─────────────────────────────────────────────────────*/
/* Immagine slide */
.vote-slide-img { max-width: 100%; max-height: 220px; border-radius: 12px;
                  margin-bottom: 16px; object-fit: contain; }
/* Timer */
.vote-timer { font-size: 2.5rem; font-weight: 900; color: var(--primary);
              text-align: center; margin-bottom: 16px; transition: color .3s; }
.vote-timer--urgent { color: var(--danger); animation: pulse 0.5s infinite; }
/* Multi-select checkboxes */
.vote-checkboxes { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 480px; }
.vote-check-label { display: flex; align-items: center; gap: 12px; padding: 14px 18px;
                    background: var(--surface); border: 2px solid var(--border);
                    border-radius: 12px; cursor: pointer; font-size: 1rem;
                    transition: all .15s; }
.vote-check-label:hover { border-color: var(--primary); background: rgba(59,130,246,.1); }
.vote-checkbox { width: 20px; height: 20px; accent-color: var(--primary); cursor: pointer; }
/* Opzioni nell'edit */
.option-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.option-row input[type="radio"] { width: 18px; height: 18px; accent-color: var(--success);
                                   cursor: pointer; flex-shrink: 0; }
/* Upload immagine nell'edit */
.img-upload-section { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.img-upload-label { display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
                    padding: 8px 14px; border: 1px dashed var(--border); border-radius: 8px;
                    font-size: .85rem; color: var(--text-2); transition: all .15s; }
.img-upload-label:hover { border-color: var(--primary); color: var(--primary); }
.img-preview { display: flex; align-items: center; gap: 12px; }
.slide-img-thumb { max-width: 120px; max-height: 80px; border-radius: 6px; object-fit: cover; }
.img-upload-status { font-size: .8rem; margin-top: 6px; color: var(--text-2); }
/* Slide type badge nuovi tipi */
.slide-type-badge--multi_select { background: rgba(34,197,94,.2);  color: #4ade80; }
.slide-type-badge--timer_quiz   { background: rgba(239,68,68,.2);  color: #fca5a5; }

/* ── Radio button style (multiple_choice) ────────────────────────────────────*/
.vote-radio-list { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 480px; }
.vote-radio-label { display: flex; align-items: center; gap: 14px; padding: 16px 18px;
  background: var(--surface); border: 2px solid var(--border); border-radius: 12px;
  cursor: pointer; transition: all .15s; }
.vote-radio-label:hover { border-color: var(--primary); background: rgba(59,130,246,.08); }
.vote-radio-label:has(.vote-radio:checked) { border-color: var(--primary); background: rgba(59,130,246,.12); }
.vote-radio { width: 20px; height: 20px; accent-color: var(--primary); cursor: pointer; flex-shrink:0; }
.vote-radio-text { font-size: 1rem; font-weight: 500; }

/* ── Word cloud hint ─────────────────────────────────────────────────────────*/
.vote-wc-hint { font-size: .85rem; color: var(--text-2); text-align: center; margin-bottom: 8px; }
.vote-open-form { gap: 8px; }

/* ── Quiz ranking ────────────────────────────────────────────────────────────*/
.quiz-ranking  { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 10px; }
.quiz-winner   { font-weight: 700; color: var(--success); margin-bottom: 8px; font-size: .9rem; }
.quiz-rank-row { display: flex; align-items: center; gap: 10px; padding: 5px 0;
                 border-bottom: 1px solid var(--border); font-size: .85rem; }
.quiz-rank-correct { color: var(--success); }
.quiz-rank-pos  { width: 20px; font-weight: 700; color: var(--text-2); }
.quiz-rank-val  { flex: 1; }
.quiz-rank-time { color: var(--text-2); font-family: monospace; }
.quiz-rank-badge{ font-size: .8rem; }

/* ── Drag & drop label active ────────────────────────────────────────────────*/
.img-upload-label[draggable-active] { border-color: var(--primary); background: rgba(59,130,246,.06); }

/* Immagine nel presenter stage */
.presenter-slide-img { max-width: 60%; max-height: 220px; border-radius: 12px;
                       margin-bottom: 16px; object-fit: contain; display: block;
                       margin-left: auto; margin-right: auto; }

/* Word cloud risultati live: animazione apparizione parole */
.wordcloud .cloud-word { animation: wc-pop .3s ease; }
@keyframes wc-pop { from { opacity:0; transform:scale(.7); } to { opacity:1; transform:scale(1); } }

/* Quiz ranking: colonna risposta */
.quiz-rank-answer { font-size:.78rem; color:var(--text-2); flex:1; overflow:hidden;
                    text-overflow:ellipsis; white-space:nowrap; }
.quiz-rank-val    { min-width:80px; }

/* ══════════════════════════════════════════════════════════════════
   LIGHT MODE — html.light
   ══════════════════════════════════════════════════════════════════ */
html.light {
  color-scheme: light;
  /* Ridefinisce tutte le variabili CSS per il light mode —
     così OGNI elemento che usa var(--text) ecc. si aggiorna automaticamente */
  --bg:       #f0f6ff;
  --surface:  #ffffff;
  --surface2: #f1f5f9;
  --border:   #bfdbfe;
  --text:     #0f172a;
  --text-2:   #475569;
  --primary:  #2563eb;
  --primary-h:#1d4ed8;
}
html.light body       { background: var(--bg); color: var(--text); }
html.light .topbar    { background: rgba(255,255,255,.95) !important;
                        border-color: var(--border) !important; }
html.light .present-sidebar { background: #fff !important; border-color: #bfdbfe !important; }
html.light .slide-thumb { color: #334155; }
html.light .slide-thumb:hover { background: #eff6ff !important; }
html.light .slide-thumb.is-active { background: rgba(59,130,246,.12) !important;
                                    border-color: var(--primary) !important; }
html.light .stage-header { background: #fff !important; border-color: #bfdbfe !important; }
html.light .results-panel { background: #fff !important; border-color: #bfdbfe !important; }
html.light .pres-card,
html.light .slide-item,
html.light .auth-card,
html.light .join-card    { background: #fff !important;
                            border-color: #bfdbfe !important;
                            box-shadow: 0 1px 4px rgba(59,130,246,.08); }
html.light .vote-header  { background: #fff !important; border-color: #bfdbfe !important; }
html.light .vote-option  { background: #fff !important; border-color: #bfdbfe !important;
                            color: #0f172a !important; }
html.light .vote-option:hover { border-color: var(--primary) !important;
                                 background: #eff6ff !important; }
html.light .btn--ghost   { color: #475569 !important; border-color: #bfdbfe !important; }
html.light .btn--outline { border-color: var(--primary) !important; }
html.light .lp-nav       { background: rgba(255,255,255,.95) !important; }
html.light .lp-feature,
html.light .lp-step      { background: #fff !important; border-color: var(--border) !important; }
/* Testi nelle feature/step cards esplicitamente chiari */
html.light .lp-feature p { color: var(--text-2) !important; }
html.light .lp-step      { color: var(--text) !important; }
html.light .lp-step__n   { background: var(--primary) !important; color: #fff !important; }
html.light .landing-page { background: var(--bg) !important; }
html.light .lp-hero__sub { color: var(--text-2) !important; }
html.light .lp-steps__title { color: var(--text) !important; }
html.light input[type="text"],
html.light input[type="email"],
html.light input[type="password"],
html.light input[type="number"],
html.light .rename-input,
html.light .open-input,
html.light .code-input   { background: #fff !important; border-color: #bfdbfe !important;
                            color: #0f172a !important; }
html.light .bar-track    { background: #dbeafe !important; }
html.light .sum-card     { background: #fff !important; border-color: #bfdbfe !important; }
html.light .lp-join      { background: #fff !important; border-color: #bfdbfe !important; }
html.light .wl-lang-menu,
html.light .lang-menu    { background: #fff !important; border-color: #e2e8f0 !important; }

/* ── Vox theme toggle button ─────────────────────────────────────── */
.vox-theme-toggle {
  background: transparent; border: 1px solid var(--border);
  color: var(--text-2); padding: 4px 8px; border-radius: 7px;
  cursor: pointer; font-size: .95rem; line-height: 1; transition: all .15s;
}
.vox-theme-toggle:hover { border-color: var(--primary); color: var(--text); }

/* ── Vox language dropdown ───────────────────────────────────────── */
.vox-lang-dd { position: relative; }
.vox-lang-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 8px; border-radius: 7px; cursor: pointer;
  background: transparent; border: 1px solid var(--border);
  color: var(--text-2); font-size: .72rem; font-weight: 700; font-family: monospace;
  transition: all .15s;
}
.vox-lang-btn:hover { border-color: var(--primary); color: var(--text); }
.vox-lang-menu {
  display: none; position: absolute; right: 0; top: calc(100% + 6px);
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 4px; min-width: 150px; z-index: 200;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
.vox-lang-dd.open .vox-lang-menu { display: block; }
.vox-lang-option {
  display: flex; align-items: center; gap: 9px; padding: 8px 10px;
  border-radius: 7px; text-decoration: none; font-size: .85rem;
  color: var(--text-2); transition: all .12s;
}
.vox-lang-option:hover { background: rgba(255,255,255,.07); color: var(--text); text-decoration: none; }
.vox-lang-option--active { color: var(--primary) !important; font-weight: 600; }
.vox-lang-chevron { transition: transform .2s; margin-left: 2px; }
.vox-lang-dd.open .vox-lang-chevron { transform: rotate(180deg); }

/* ── Summary word cloud canvas ───────────────────────────────────────*/
.sum-wc-wrap   { width: 100%; min-height: 200px; position: relative; }
.sum-wc-canvas { width: 100%; display: block; border-radius: 8px; }
