/*
 * Estilos de la aplicación (popup de avisos y página de streaming).
 * styles.css (página de acceso) no se modifica.
 */
:root {
  --leti-navy: #071b4a;
  --leti-deep-navy: #1d2241;
  --leti-cyan: #0a77a5;
  --leti-blue: #58afe8;
  --leti-light-blue: #6bb6e8;
  --leti-white: #ffffff;
  --field-border: #cad5e1;
  --field-placeholder: #818ba0;
  --soft-blue: #eef7fd;
  --live-red: #e5484d;
  --card-shadow: 0 18px 55px rgba(7, 27, 74, 0.14);
  --font-family: Arial, Helvetica, sans-serif;
}

/* ========== Popup de avisos ========== */

.app-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(7, 27, 74, 0.55);
  animation: app-fade 160ms ease-out;
}

.app-modal[hidden] {
  display: none;
}

.app-modal__box {
  width: min(100%, 460px);
  padding: clamp(28px, 3vw, 40px);
  border-radius: 18px;
  background: var(--leti-white);
  box-shadow: var(--card-shadow);
  color: var(--leti-navy);
  font-family: var(--font-family);
  animation: app-pop 200ms ease-out;
}

.app-modal__icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 18px;
  border-radius: 50%;
  background: var(--soft-blue);
  color: var(--leti-cyan);
  font-size: 28px;
  font-weight: 700;
}

.app-modal__box h3 {
  margin: 0 0 12px;
  font-size: 24px;
  line-height: 1.15;
}

.app-modal__body {
  margin: 0 0 26px;
  font-size: 17px;
  line-height: 1.45;
}

.app-modal__body ul {
  margin: 0;
  padding-left: 20px;
}

.app-modal__body li + li {
  margin-top: 6px;
}

.app-modal__btn {
  width: 100%;
  min-height: 54px;
  border: 0;
  border-radius: 12px;
  background: var(--leti-blue);
  color: var(--leti-white);
  cursor: pointer;
  font: 700 17px/1 var(--font-family);
  letter-spacing: 0.02em;
}

.app-modal__btn:hover {
  filter: brightness(0.94);
}
.app-modal__btn:focus-visible {
  outline: 3px solid var(--leti-navy);
  outline-offset: 3px;
}

.access-form button[disabled] {
  cursor: wait;
  opacity: 0.7;
}

@keyframes app-fade {
  from {
    opacity: 0;
  }
}
@keyframes app-pop {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
}

/* ========== Página de streaming ========== */

.stream-page {
  position: relative;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: var(--leti-white);
  color: var(--leti-navy);
  font-family: var(--font-family);
}

.stream-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.stream-cat {
  position: fixed;
  right: 0;
  bottom: 0;
  z-index: 0;
  width: min(22vw, 420px);
  height: auto;
  pointer-events: none;
}

.stream-header,
.stream-main {
  position: relative;
  z-index: 10;
}

.stream-header__inner {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(18px, 2.4vw, 40px);
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(20px, 3.2vh, 40px) 24px 0;
}

.stream-logo {
  order: 2;
  display: block;
  width: clamp(150px, 12vw, 230px);
  height: auto;
}

.stream-user {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 16px;
}

.btn-logout {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 1.5px solid var(--leti-navy);
  border-radius: 10px;
  background: var(--leti-white);
  color: var(--leti-navy);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background 160ms ease,
    color 160ms ease;
}

.btn-logout svg,
.btn-fullscreen svg,
.fs-exit svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn-logout:hover,
.btn-logout:focus-visible {
  background: var(--leti-navy);
  color: var(--leti-white);
}

.stream-main {
  max-width: 1200px;
  margin: 0 auto;
  margin-top: -80px;
  padding: clamp(18px, 3vh, 36px) 24px 56px;
  z-index: 0;
}

.stream-intro {
  margin-bottom: clamp(18px, 2.6vh, 30px);
}

.stream-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
  color: var(--leti-blue);
  font-size: clamp(15px, 1.2vw, 20px);
  font-weight: 700;
  letter-spacing: 0.055em;
}

.live-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--live-red);
  box-shadow: 0 0 0 0 rgba(229, 72, 77, 0.5);
  animation: live-pulse 1.8s infinite;
}

.stream-intro h1 {
  margin: 0 0 6px;
  font-size: clamp(30px, 3.2vw, 56px);
  line-height: 1;
  letter-spacing: -0.025em;
}

.stream-subtitle {
  margin: 0;
  font-size: clamp(18px, 1.5vw, 26px);
  line-height: 1.2;
}

/* Reproductor */

.player-shell {
  position: relative;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 16px;
  background: #000;
  box-shadow: var(--card-shadow);
}

.player-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
}

.player-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.player-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 8px;
  padding: 24px;
  background: var(--leti-deep-navy);
  color: var(--leti-white);
  text-align: center;
  font-size: clamp(15px, 1.3vw, 20px);
}

.player-empty[hidden] {
  display: none;
}
.player-empty p {
  margin: 0;
}

.player-empty__title {
  font-size: clamp(20px, 2.2vw, 36px);
  font-weight: 700;
}

.player-shell.is-fullscreen {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100vw;
  max-width: none;
  height: 100vh;
  border-radius: 0;
}

.player-shell.is-fullscreen .player-frame {
  width: min(100vw, 177.78vh);
}

.fs-exit {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 5;
  display: none;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 10px;
  background: rgba(7, 27, 74, 0.7);
  color: var(--leti-white);
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 160ms ease;
}

.fs-exit:hover,
.fs-exit:focus-visible {
  opacity: 1;
}
.player-shell.is-fullscreen .fs-exit {
  display: grid;
}

.player-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  margin-top: 16px;
}

.player-bar__info {
  margin: 0;
  color: var(--leti-navy);
  font-size: 16px;
  font-weight: 700;
}

.btn-fullscreen {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 10px;
  background: var(--leti-blue);
  color: var(--leti-white);
  cursor: pointer;
  font: 700 15px/1 var(--font-family);
}

.btn-fullscreen[hidden] {
  display: none;
}
.btn-fullscreen:hover {
  filter: brightness(0.94);
}

.stream-help {
  max-width: 760px;
  margin: 14px 0 0;
  color: #4a5876;
  font-size: 15px;
  line-height: 1.45;
}

/* Preguntas en directo (capa fija: funciona en página y en pantalla completa) */

.question-layer {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(7, 27, 74, 0.72);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  animation: app-fade 180ms ease-out;
}

.question-layer[hidden] {
  display: none;
}

.question-card {
  width: min(100%, 660px);
  max-height: 100%;
  overflow-y: auto;
  padding: clamp(24px, 3vw, 44px);
  border-radius: 18px;
  background: var(--leti-white);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
  color: var(--leti-navy);
  font-family: var(--font-family);
  animation: app-pop 220ms ease-out;
}

.question-card__eyebrow {
  margin: 0 0 10px;
  color: var(--leti-blue);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.question-card__title {
  margin: 0 0 22px;
  font-size: clamp(21px, 2vw, 30px);
  line-height: 1.2;
}

.question-card__options {
  display: grid;
  gap: 12px;
}

.question-option {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 60px;
  padding: 12px 18px;
  border: 1.5px solid var(--field-border);
  border-radius: 12px;
  background: var(--leti-white);
  color: var(--leti-navy);
  cursor: pointer;
  text-align: left;
  font: 400 clamp(16px, 1.3vw, 19px)/1.3 var(--font-family);
  transition:
    border-color 140ms ease,
    background 140ms ease,
    transform 140ms ease;
}

.question-option:hover:not(:disabled),
.question-option:focus-visible {
  border-color: var(--leti-blue);
  background: var(--soft-blue);
  outline: none;
}

.question-option:active:not(:disabled) {
  transform: translateY(1px);
}
.question-option:disabled {
  cursor: default;
}
.question-option:disabled:not(.is-selected) {
  opacity: 0.5;
}

.question-option__letter {
  display: grid;
  flex: none;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--soft-blue);
  color: var(--leti-cyan);
  font-weight: 700;
}

.question-option.is-selected {
  border-color: var(--leti-blue);
  background: var(--leti-blue);
  color: var(--leti-white);
}

.question-option.is-selected .question-option__letter {
  background: var(--leti-white);
  color: var(--leti-blue);
}

.question-card__msg {
  min-height: 1.4em;
  margin: 18px 0 0;
  font-size: 17px;
  font-weight: 700;
}

.question-card.is-done .question-card__msg {
  color: var(--leti-cyan);
}
.question-card.is-closed .question-card__msg {
  color: #8a4b00;
}

.question-card__later {
  margin-top: 8px;
  padding: 8px 0;
  border: 0;
  background: none;
  color: #4a5876;
  cursor: pointer;
  text-decoration: underline;
  font: 400 15px/1 var(--font-family);
}

.question-card__later[hidden] {
  display: none;
}

.question-pill {
  position: fixed;
  bottom: 24px;
  left: 50%;
  z-index: 999;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100vw - 32px);
  padding: 14px 22px;
  border: 0;
  border-radius: 999px;
  background: var(--leti-navy);
  box-shadow: 0 12px 34px rgba(7, 27, 74, 0.35);
  color: var(--leti-white);
  cursor: pointer;
  transform: translateX(-50%);
  font: 400 16px/1.2 var(--font-family);
  animation: app-pop 220ms ease-out;
}

.question-pill[hidden] {
  display: none;
}

.question-pill__dot {
  width: 10px;
  height: 10px;
  flex: none;
  border-radius: 50%;
  background: var(--leti-blue);
  animation: live-pulse 1.6s infinite;
}

@keyframes live-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(229, 72, 77, 0.5);
  }
  70% {
    box-shadow: 0 0 0 9px rgba(229, 72, 77, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(229, 72, 77, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .live-dot,
  .question-pill__dot,
  .app-modal,
  .app-modal__box,
  .question-layer,
  .question-card,
  .question-pill {
    animation: none;
  }
}

@media (max-width: 1080px) {
  .stream-cat {
    width: 200px;
    opacity: 0.35;
  }
}

@media (max-width: 720px) {
  .stream-bg,
  .stream-cat {
    display: none;
  }

  .stream-header__inner {
    justify-content: space-between;
    padding: 16px 16px 0;
  }

  .stream-logo {
    order: 0;
    width: 130px;
  }
  .stream-user__name {
    display: none;
  }
  .btn-logout {
    min-height: 40px;
    padding: 0 14px;
    font-size: 14px;
  }
  .stream-main {
    padding: 20px 16px 40px;
  }
  .player-shell:not(.is-fullscreen) {
    border-radius: 10px;
  }
  .player-bar__info {
    font-size: 14px;
  }
  .btn-fullscreen {
    width: 100%;
    justify-content: center;
  }
  .question-option {
    min-height: 54px;
  }

  .stream-main {
    margin-top: 0px;
  }
}

/* ========== Preguntas del público a los ponentes ========== */

.player-bar__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ask-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 10px;
  background: var(--leti-blue);
  color: var(--leti-white);
  cursor: pointer;
  font: 700 15px/1 var(--font-family);
  transition: filter 160ms ease, transform 160ms ease;
}

.ask-btn:hover { filter: brightness(0.94); }
.ask-btn:active { transform: translateY(1px); }
.ask-btn:focus-visible { outline: 3px solid var(--leti-navy); outline-offset: 3px; }

.ask-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linejoin: round;
}

.ask-form {
  position: relative;
  width: min(100%, 540px);
  max-height: calc(100vh - 32px);
  margin: 0;
  overflow-y: auto;
}

.ask-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--leti-navy);
  cursor: pointer;
  font: 400 28px/1 var(--font-family);
}

.ask-close:hover { background: var(--soft-blue); }

.ask-intro {
  margin: 0 0 22px;
  color: #4a5876;
  font-size: 16px;
}

.ask-field {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
  font-size: 15px;
  font-weight: 700;
}

.ask-field select,
.ask-field textarea {

  padding: 14px 16px;
  border: 1px solid var(--field-border);
  border-radius: 12px;
  background: var(--leti-white);
  color: var(--leti-navy);
  font: 400 16px/1.4 var(--font-family);
}

.ask-field select { min-height: 54px; cursor: pointer; }
.ask-field textarea { min-height: 130px; resize: vertical; }

.ask-field select:focus,
.ask-field textarea:focus {
  border-color: var(--leti-blue);
  outline: none;
  box-shadow: 0 0 0 4px rgba(88, 175, 232, 0.18);
}

.ask-count {
  justify-self: end;
  color: var(--field-placeholder);
  font-size: 13px;
  font-weight: 400;
}

.ask-msg {
  min-height: 1.4em;
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 700;
}

.ask-msg.is-error { color: #b3261e; }
.ask-msg.is-ok { color: var(--leti-cyan); }

@media (max-width: 720px) {
  .player-bar__actions { width: 100%; }
  .player-bar__actions > button { flex: 1 1 100%; justify-content: center; }
}
