/* =========================================================
   DISPLAY HELPERS
========================================================= */

.drt-d-block {
  --drt-display: block;
}

.drt-d-flex {
  --drt-display: flex;
}

.drt-d-inline-flex {
  --drt-display: inline-flex;
}

.drt-d-inline-block {
  --drt-display: inline-block;
}


/* =========================================================
   RESET ELEMENTI CONDIZIONALI
========================================================= */

.drt-ui-login,
.drt-ui-logged,
.drt-ui-register,
.drt-ui-calendar,
.drt-ui-countdown-prelive,
.drt-ui-countdown-waiting,
.drt-ui-countdown-thankyou,
.drt-ui-player,
.drt-ui-player-waiting,
.drt-ui-player-live,
.drt-ui-laststep,
.drt-ui-thankyou {
  display: none !important;
}


/* =========================================================
   NON LOGGATO
========================================================= */

/* Registrazione sempre visibile per non loggati, tranne ended */
body:not(.logged):not(.is-ended) .drt-ui-register {
  display: var(--drt-display) !important;
}

/* Login SOLO se near */
body.near:not(.logged):not(.is-ended) .drt-ui-login {
  display: var(--drt-display) !important;
}


/* =========================================================
   LOGGATO
========================================================= */

body.logged:not(.is-ended) .drt-ui-logged {
  display: var(--drt-display) !important;
}

/* Quando è loggato, niente registrati */
body.logged .drt-ui-register {
  display: none !important;
}


/* =========================================================
   LOGGED + ACCESSED
   Utente tornato da DU, deve fare laststep
========================================================= */

body.logged.accessed:not(.is-ended) .drt-ui-laststep {
  display: var(--drt-display) !important;
}
/*
body.logged.accessed:not(.is-ended) .drt-ui-calendar {
  display: var(--drt-display) !important;
}
*/

/* =========================================================
   LOGGED + REGISTERED
========================================================= */

body.logged.registered:not(.is-ended) .drt-ui-calendar {
  display: var(--drt-display) !important;
}


/* =========================================================
   LOGGED + THANKS
========================================================= */

body.logged.thanks:not(.is-ended) .drt-ui-thankyou {
  display: var(--drt-display) !important;
}
/*
body.logged.thanks:not(.is-ended) .drt-ui-calendar {
  display: var(--drt-display) !important;
}
*/
/* =========================================================
   STEP ISOLATION
   Mantengo la HERO visibile.
   Spengo solo contenuti sotto + player + CTA non coerenti.
========================================================= */

/* logged.accessed = hero + logged + laststep */
body.logged.accessed:not(.is-ended) #sinossi,
body.logged.accessed:not(.is-ended) #sectionCdRegister,
body.logged.accessed:not(.is-ended) #speakers,
body.logged.accessed:not(.is-ended) #credits,
body.logged.accessed:not(.is-ended) #help,
body.logged.accessed:not(.is-ended) .drt-ui-player,
body.logged.accessed:not(.is-ended) .drt-ui-player-waiting,
body.logged.accessed:not(.is-ended) .drt-ui-player-live,
body.logged.accessed:not(.is-ended) .drt-ui-calendar,
body.logged.accessed:not(.is-ended) .drt-ui-countdown-prelive,
body.logged.accessed:not(.is-ended) .drt-ui-countdown-waiting,
body.logged.accessed:not(.is-ended) .drt-ui-countdown-thankyou,
body.logged.accessed:not(.is-ended) .drt-ui-thankyou {
  display: none !important;
}

/* La hero deve restare visibile anche se sono in live/waiting ma NON registered */
body.logged.accessed:not(.is-ended) .intro__prelive {
  display: flex !important;
}

body.logged.accessed:not(.is-ended) .intro__heading,
body.logged.accessed:not(.is-ended) .intro__paragraph,
body.logged.accessed:not(.is-ended) .intro__event-card,
body.logged.accessed:not(.is-ended) .intro__date {
  display: block !important;
}

body.logged.accessed:not(.is-ended) .intro__speakers {
  display: flex !important;
}

/* Però i bottoni registrati nella hero restano spenti */
body.logged.accessed:not(.is-ended) .intro__prelive .drt-ui-register {
  display: none !important;
}

/* Mostro solo il laststep sotto la hero */
body.logged.accessed:not(.is-ended) .drt-ui-laststep {
  display: var(--drt-display) !important;
}


/* logged.thanks = hero + logged + thankyou */
body.logged.thanks:not(.is-ended) #sinossi,
body.logged.thanks:not(.is-ended) #sectionCdRegister,
body.logged.thanks:not(.is-ended) #speakers,
body.logged.thanks:not(.is-ended) #credits,
body.logged.thanks:not(.is-ended) #help,
body.logged.thanks:not(.is-ended) .drt-ui-player,
body.logged.thanks:not(.is-ended) .drt-ui-player-waiting,
body.logged.thanks:not(.is-ended) .drt-ui-player-live,
body.logged.thanks:not(.is-ended) .drt-ui-register,
body.logged.thanks:not(.is-ended) .drt-ui-calendar,
body.logged.thanks:not(.is-ended) .drt-ui-countdown-prelive,
body.logged.thanks:not(.is-ended) .drt-ui-countdown-waiting,
body.logged.thanks:not(.is-ended) .drt-ui-laststep {
  display: none !important;
}

/* Anche in thanks la hero deve restare visibile */
body.logged.thanks:not(.is-ended) .intro__prelive {
  display: flex !important;
}

body.logged.thanks:not(.is-ended) .intro__heading,
body.logged.thanks:not(.is-ended) .intro__paragraph,
body.logged.thanks:not(.is-ended) .intro__event-card,
body.logged.thanks:not(.is-ended) .intro__date {
  display: block !important;
}

body.logged.thanks:not(.is-ended) .intro__speakers {
  display: flex !important;
}

/* Però i bottoni registrati nella hero restano spenti */
body.logged.thanks:not(.is-ended) .intro__prelive .drt-ui-register {
  display: none !important;
}

/* Mostro la sezione thankyou */
body.logged.thanks:not(.is-ended) .drt-ui-thankyou {
  display: var(--drt-display) !important;
}

/* Dentro thankyou posso riaccendere calendario e countdown thankyou */
body.logged.thanks:not(.is-ended) #thankyou .drt-ui-calendar,
body.logged.thanks:not(.is-ended) #thankyou .drt-ui-countdown-thankyou {
  display: var(--drt-display) !important;
}


/* =========================================================
   COUNTDOWN
========================================================= */

/* Countdown pre-live: visibile solo prima della fase media */
body:not(.accessed):not(.thanks):not(.is-ended):not(.is-waiting-room):not(.is-live) .drt-ui-countdown-prelive {
  display: var(--drt-display) !important;
}

/* Countdown waiting: solo waiting + registered */
body.is-waiting-room.logged.registered .drt-ui-countdown-waiting {
  display: var(--drt-display) !important;
}

/* Countdown thankyou */
body.logged.thanks:not(.is-ended) .drt-ui-countdown-thankyou {
  display: var(--drt-display) !important;
}


/* =========================================================
   EVENT CTA COUNTDOWN BOX
   In live/waiting:
   - se NON loggato: mostro il box registrazione
   - se logged/accessed/registered/thanks: lo nascondo
========================================================= */

/* Non loggato in waiting/live: il box resta visibile */
body.is-waiting-room:not(.logged):not(.is-ended) #sectionCdRegister,
body.is-live:not(.logged):not(.is-ended) #sectionCdRegister {
  display: block !important;
}

/* Non loggato in waiting/live: label + bottone registrati visibili */
body.is-waiting-room:not(.logged):not(.is-ended) #sectionCdRegister .drt-ui-register,
body.is-live:not(.logged):not(.is-ended) #sectionCdRegister .drt-ui-register {
  display: var(--drt-display) !important;
}

/* In waiting/live il countdown del box lo terrei spento */
body.is-waiting-room #sectionCdRegister .drt-ui-countdown-prelive,
body.is-live #sectionCdRegister .drt-ui-countdown-prelive {
  display: none !important;
}

/* In waiting/live il divisore del box lo spengo se il countdown è spento */
body.is-waiting-room #sectionCdRegister .event-cta-countdown__divider,
body.is-live #sectionCdRegister .event-cta-countdown__divider {
  display: none !important;
}

/* Logged/accessed/registered/thanks: il box registrazione non serve più */
body.logged.accessed:not(.is-ended) #sectionCdRegister,
body.logged.registered:not(.is-ended) #sectionCdRegister,
body.logged.thanks:not(.is-ended) #sectionCdRegister {
  display: none !important;
}

/* =========================================================
   PLAYER
========================================================= */

/* Player solo se logged + registered + waiting/live */
body.is-waiting-room.logged.registered .drt-ui-player,
body.is-live.logged.registered .drt-ui-player {
  display: var(--drt-display) !important;
}

body.is-waiting-room.logged.registered .drt-ui-player-waiting {
  display: var(--drt-display) !important;
}

body.is-live.logged.registered .drt-ui-player-live {
  display: var(--drt-display) !important;
}

/* =========================================================
   LIVE PLAYER FULL WIDTH
   In live, solo per logged + registered, il player occupa tutta la riga.
========================================================= */

body.is-live.logged.registered .intro__waiting.intro__live {
  align-items: center;
}

body.is-live.logged.registered .intro__video {
  width: 100% !important;
  flex: 0 0 100% !important;
  max-width: 100% !important;
}

body.is-live.logged.registered .intro__video .intro__embed {
  width: 100% !important;
  max-width: 100% !important;
  visibility: visible;
  opacity: 1;
}

body.is-live.logged.registered #videoContainer {
  width: 100% !important;
}

/* =========================================================
   HERO SAFETY
   Se l'utente NON può vedere il player,
   la hero pre-live deve restare visibile anche in waiting/live.
========================================================= */

/* Non loggato: in waiting/live deve vedere ancora titolo, testo e CTA */
body.is-waiting-room:not(.logged) .intro__prelive,
body.is-live:not(.logged) .intro__prelive {
  display: flex !important;
}

body.is-waiting-room:not(.logged) .intro__heading,
body.is-waiting-room:not(.logged) .intro__paragraph,
body.is-live:not(.logged) .intro__heading,
body.is-live:not(.logged) .intro__paragraph {
  display: block !important;
}

/* Errore login: stessa logica del non loggato */
body.is-waiting-room.loginError .intro__prelive,
body.is-live.loginError .intro__prelive {
  display: flex !important;
}

body.is-waiting-room.loginError .intro__heading,
body.is-waiting-room.loginError .intro__paragraph,
body.is-live.loginError .intro__heading,
body.is-live.loginError .intro__paragraph {
  display: block !important;
}

/* Solo l'utente logged + registered vede il layout player al posto della hero */
body.is-waiting-room.logged.registered .intro__prelive,
body.is-live.logged.registered .intro__prelive {
  display: none !important;
}

body.is-waiting-room.logged.registered .intro__heading,
body.is-waiting-room.logged.registered .intro__paragraph,
body.is-live.logged.registered .intro__heading,
body.is-live.logged.registered .intro__paragraph {
  display: none !important;
}

/* Embed spento di base: non basta nascondere l'iframe */
.intro__embed,
.intro__live__embed {
  visibility: hidden;
  opacity: 0;
}

/* Embed acceso solo se può davvero vedere il player */
body.is-waiting-room.logged.registered .intro__embed,
body.is-live.logged.registered .intro__embed,
body.is-live.logged.registered .intro__live__embed {
  visibility: visible;
  opacity: 1;
}

/* =========================================================
   REGISTRATION ALWAYS AVAILABLE FOR NOT LOGGED USERS
   Anche in waiting/live l'utente non autenticato può registrarsi.
========================================================= */

/* Non loggato: il box registrazione deve restare visibile anche in waiting/live */
body.is-waiting-room:not(.logged):not(.is-ended) #sectionCdRegister,
body.is-live:not(.logged):not(.is-ended) #sectionCdRegister,
body.is-waiting-room.loginError:not(.logged):not(.is-ended) #sectionCdRegister,
body.is-live.loginError:not(.logged):not(.is-ended) #sectionCdRegister {
  display: block !important;
}

/* Non loggato: tutti i bottoni/testi registrati restano visibili */
body.is-waiting-room:not(.logged):not(.is-ended) .drt-ui-register,
body.is-live:not(.logged):not(.is-ended) .drt-ui-register,
body.is-waiting-room.loginError:not(.logged):not(.is-ended) .drt-ui-register,
body.is-live.loginError:not(.logged):not(.is-ended) .drt-ui-register {
  display: var(--drt-display) !important;
}

/* In waiting/live il countdown del box non serve: tengo solo CTA registrazione */
body.is-waiting-room:not(.logged):not(.is-ended) #sectionCdRegister .drt-ui-countdown-prelive,
body.is-live:not(.logged):not(.is-ended) #sectionCdRegister .drt-ui-countdown-prelive,
body.is-waiting-room.loginError:not(.logged):not(.is-ended) #sectionCdRegister .drt-ui-countdown-prelive,
body.is-live.loginError:not(.logged):not(.is-ended) #sectionCdRegister .drt-ui-countdown-prelive {
  display: none !important;
}

/* Spengo anche il divisore se il countdown è spento */
body.is-waiting-room:not(.logged):not(.is-ended) #sectionCdRegister .event-cta-countdown__divider,
body.is-live:not(.logged):not(.is-ended) #sectionCdRegister .event-cta-countdown__divider,
body.is-waiting-room.loginError:not(.logged):not(.is-ended) #sectionCdRegister .event-cta-countdown__divider,
body.is-live.loginError:not(.logged):not(.is-ended) #sectionCdRegister .event-cta-countdown__divider {
  display: none !important;
}

/* Utente già dentro un flusso logged: il box registrazione non serve */
body.logged.accessed:not(.is-ended) #sectionCdRegister,
body.logged.registered:not(.is-ended) #sectionCdRegister,
body.logged.thanks:not(.is-ended) #sectionCdRegister {
  display: none !important;
}
/* =========================================================
   CALENDAR HIDDEN DURING WAITING / LIVE
   In waiting-room e live non mostro mai "Aggiungi al calendario"
========================================================= */

body.is-waiting-room .drt-ui-calendar,
body.is-live .drt-ui-calendar,
body.is-waiting-room.logged.registered:not(.is-ended) .drt-ui-calendar,
body.is-live.logged.registered:not(.is-ended) .drt-ui-calendar,
body.is-waiting-room.logged.thanks:not(.is-ended) .drt-ui-calendar,
body.is-live.logged.thanks:not(.is-ended) .drt-ui-calendar {
  display: none !important;
}
body.is-ended .event-cta-countdown {
  display: none !important;
}
/*
body.is-waiting-room .event-cta-countdown,
body.is-live .event-cta-countdown,
body.is-waiting-room.logged.registered:not(.is-ended) .event-cta-countdown,
body.is-live.logged.registered:not(.is-ended) .event-cta-countdown,
body.is-waiting-room.logged.thanks:not(.is-ended) .event-cta-countdown,
body.is-live.logged.thanks:not(.is-ended) .event-cta-countdown {
  display: none !important;
}
*/


/* =========================================================
   STICKY BAR VISIBILITY
   La sticky bar resta visibile per utenti non loggati,
   anche in waiting-room/live. Si spegne solo in ended.
========================================================= */

/* Sticky sempre visibile fuori da ended */
body:not(.is-ended) #js-top-bar {
  display: flex !important;
}

/* In waiting/live, se NON logged, la sticky resta comunque accesa */
body.is-waiting-room:not(.logged):not(.is-ended) #js-top-bar,
body.is-live:not(.logged):not(.is-ended) #js-top-bar,
body.is-waiting-room.loginError:not(.logged):not(.is-ended) #js-top-bar,
body.is-live.loginError:not(.logged):not(.is-ended) #js-top-bar {
  display: flex !important;
}

/* Registrati sticky sempre visibile per non logged */
body:not(.logged):not(.is-ended) #summaryBarRegister {
  display: flex !important;
}

/* Il bottone interno del register deve restare visibile */
body:not(.logged):not(.is-ended) #summaryBarRegister .btn {
  display: inline-flex !important;
}

/* Login sticky SOLO se near + non logged */
body:not(.near):not(.logged):not(.is-ended) #summaryBarLogin {
  display: none !important;
}

body.near:not(.logged):not(.is-ended) #summaryBarLogin {
  display: flex !important;
}

/* Logged sticky SOLO se logged */
body:not(.logged) #summaryBarLogged {
  display: none !important;
}

body.logged:not(.is-ended) #summaryBarLogged {
  display: flex !important;
}

/* Calendario sticky spento in waiting/live */
body.is-waiting-room #summaryBarRegistered,
body.is-live #summaryBarRegistered {
  display: none !important;
}

/* Ended: sticky spenta */
body.is-ended #js-top-bar {
  display: none !important;
}

/* =========================================================
   ENDED
========================================================= */

body.is-ended .drt-ui-login,
body.is-ended .drt-ui-logged,
body.is-ended .drt-ui-register,
body.is-ended .drt-ui-calendar,
body.is-ended .drt-ui-countdown-prelive,
body.is-ended .drt-ui-countdown-waiting,
body.is-ended .drt-ui-countdown-thankyou,
body.is-ended .drt-ui-player,
body.is-ended .drt-ui-player-waiting,
body.is-ended .drt-ui-player-live,
body.is-ended .drt-ui-laststep,
body.is-ended .drt-ui-thankyou {
  display: none !important;
}


/* STATUS CSS*/
#smartsupp-widget-container {visibility:hidden !important;}
body.is-live.logged.registered #smartsupp-widget-container {
    visibility:visible !important;
}
/*
body:not(.logged) #js-top-bar #summaryBarLogged.drt-ui-logged {
  display: none !important;
}

body.logged:not(.is-ended) #js-top-bar #summaryBarLogged.drt-ui-logged {
  display: var(--drt-display) !important;
}
  */

  /* =========================================================
   LOGIN SEMPRE DISPONIBILE PER UTENTI NON LOGGATI
   Stati: pre-live, waiting-room, live
   Non visibile se utente logged o evento ended
========================================================= */

/* Default: login nascosta, poi la riaccendiamo nei casi corretti */
#login.drt-ui-login,
#summaryBarLogin.drt-ui-login {
  display: none !important;
}

/* Utente NON loggato / loginError: login visibile in pre-live */
body:not(.logged):not(.is-ended) #login.drt-ui-login,
body:not(.logged):not(.is-ended) #summaryBarLogin.drt-ui-login,
body.loginError:not(.is-ended) #login.drt-ui-login,
body.loginError:not(.is-ended) #summaryBarLogin.drt-ui-login {
  display: var(--drt-display) !important;
}

/* Utente NON loggato / loginError: login visibile anche in waiting-room */
body.is-waiting-room:not(.logged):not(.is-ended) #login.drt-ui-login,
body.is-waiting-room:not(.logged):not(.is-ended) #summaryBarLogin.drt-ui-login,
body.is-waiting-room.loginError:not(.is-ended) #login.drt-ui-login,
body.is-waiting-room.loginError:not(.is-ended) #summaryBarLogin.drt-ui-login {
  display: var(--drt-display) !important;
}

/* Utente NON loggato / loginError: login visibile anche in live */
body.is-live:not(.logged):not(.is-ended) #login.drt-ui-login,
body.is-live:not(.logged):not(.is-ended) #summaryBarLogin.drt-ui-login,
body.is-live.loginError:not(.is-ended) #login.drt-ui-login,
body.is-live.loginError:not(.is-ended) #summaryBarLogin.drt-ui-login {
  display: var(--drt-display) !important;
}

/* Se l’utente è loggato, la login non deve mai vedersi */
body.logged #login.drt-ui-login,
body.logged #summaryBarLogin.drt-ui-login {
  display: none !important;
}

/* A evento ended, login nascosta */
body.is-ended #login.drt-ui-login,
body.is-ended #summaryBarLogin.drt-ui-login {
  display: none !important;
}
