:root {
  --primary: #1A3A5C;
  --primary-light: #2D5F8A;
  --secondary: #00897B;
  --secondary-light: #B2DFDB;
  --error: #D32F2F;
  --success: #2E7D32;
  --bg: #F8F9FA;
  --text: #1C1C1E;
  --text-muted: #6B7280;
  --border: #E5E7EB;
  --card: #FFFFFF;
  --radius: 12px;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

/* Screens */
.screen {
  display: none;
  min-height: 100dvh;
  padding: 24px;
}

.screen.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.screen-content {
  width: 100%;
  max-width: 420px;
  text-align: center;
}

.vote-content {
  text-align: left;
}

/* Typography */
h1 { font-size: 28px; font-weight: 700; }
h2 { font-size: 22px; font-weight: 600; margin-bottom: 8px; }
.text-muted { color: var(--text-muted); font-size: 15px; line-height: 1.5; }

/* Brand */
.brand {
  color: var(--primary);
  margin-bottom: 32px;
}

.logo-icon {
  font-size: 56px;
  margin-bottom: 12px;
}

.icon-large {
  font-size: 48px;
  margin-bottom: 16px;
}

.error-icon { color: var(--error); }
.success-icon { color: var(--success); }

/* Spinner */
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 20px auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Buttons */
.btn {
  display: block;
  width: 100%;
  padding: 14px 24px;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 24px;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-light);
}

.btn-primary:disabled {
  background: #A0AEC0;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-secondary:hover {
  background: rgba(26, 58, 92, 0.05);
}

/* Vote screen */
.vote-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  margin: 0 auto 12px;
  font-size: 44px;
  background: rgba(26, 58, 92, 0.08);
  border-radius: 18px;
  line-height: 1;
}

/* Marca blanca: cuando el contenedor (org Business+) tiene logoUrl, el
   icono principal pasa a ser una <img>. El fondo se retira para que el
   logo no quede sobre un color que no combine con su diseno, y se recorta
   con el mismo border-radius que el emoji para coherencia visual. */
.vote-icon.has-logo {
  background: transparent;
  padding: 0;
  overflow: hidden;
}

.vote-icon.has-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 14px;
}

.vote-title {
  text-align: center;
  margin-bottom: 4px;
}

.vote-description {
  text-align: center;
  margin-bottom: 24px;
}

.options-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.option-card {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 12px;
}

.option-card:hover {
  border-color: var(--primary-light);
  background: rgba(26, 58, 92, 0.02);
}

.option-card.selected {
  border-color: var(--primary);
  background: rgba(26, 58, 92, 0.06);
}

.option-radio {
  width: 22px;
  height: 22px;
  border: 2px solid var(--border);
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.option-card.selected .option-radio {
  border-color: var(--primary);
  background: var(--primary);
}

.option-card.selected .option-radio::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: white;
}

.option-text {
  font-size: 16px;
  font-weight: 500;
}

/* Captcha */
.captcha-container {
  display: flex;
  justify-content: center;
  margin-top: 20px;
  min-height: 70px;
}

/* Google login */
.btn-google {
  background: #ffffff;
  color: #1f1f1f;
  border: 1px solid #dadce0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-google:hover {
  background: #f8f9fa;
}

.google-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(45deg, #ea4335, #fbbc05, #34a853, #4285f4);
  color: white;
  font-weight: 700;
  font-size: 14px;
  font-family: 'Arial', sans-serif;
}

/* Token input */
.token-input {
  width: 100%;
  padding: 18px;
  margin-top: 20px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 28px;
  text-align: center;
  letter-spacing: 8px;
  text-transform: uppercase;
  color: var(--primary);
  font-weight: 700;
  outline: none;
  transition: border-color 0.2s;
}

.token-input:focus {
  border-color: var(--primary);
}

.token-error {
  color: var(--error);
  font-size: 14px;
  margin-top: 8px;
  min-height: 20px;
}

/* Success badge */
.success-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(46, 125, 50, 0.1);
  color: var(--success);
  padding: 10px 20px;
  border-radius: 24px;
  font-weight: 600;
  font-size: 15px;
  margin-top: 24px;
}

.checkmark {
  font-size: 18px;
}

/* Results block (shown after voting when visibility allows) */
.results-block {
  margin-top: 24px;
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: left;
}

.results-block .results-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.results-block .results-total {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.results-block .result-row {
  margin-bottom: 12px;
}

.results-block .result-row:last-child {
  margin-bottom: 0;
}

.results-block .result-row-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-size: 14px;
}

.results-block .result-title {
  font-weight: 500;
  color: var(--text);
  flex: 1;
  margin-right: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.results-block .result-pct {
  font-weight: 700;
  color: var(--primary);
}

.results-block .result-count {
  color: var(--text-muted);
  font-size: 12px;
  margin-left: 4px;
}

.results-block .result-bar {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.results-block .result-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transition: width 400ms ease;
}

.results-pending {
  margin-top: 24px;
  padding: 12px;
  background: var(--card);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  font-size: 14px;
}

/* Evento multi-punto (voto libre con menu) */

/* Nota introductoria en la pantalla de bienvenida del evento */
.evento-intro-note {
  margin-top: 16px;
  padding: 12px 14px;
  background: rgba(26, 58, 92, 0.05);
  border-left: 3px solid var(--primary);
  border-radius: 6px;
  text-align: left;
  font-size: 14px;
  line-height: 1.55;
}

/* Lista de puntos del evento (agrupados por categoria) */
.evento-menu-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 16px;
  margin-bottom: 8px;
  text-align: left;
}

.evento-cat-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.evento-cat-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 0 2px;
  margin-bottom: 2px;
}

.evento-cat-icon {
  flex-shrink: 0;
  font-size: 24px;
  line-height: 1.1;
}

.evento-cat-text {
  flex: 1;
  min-width: 0;
}

.evento-cat-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.evento-cat-desc {
  margin-top: 2px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Tarjeta clickable de un punto dentro del menu */
.evento-punto-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}

.evento-punto-card:hover {
  border-color: var(--primary-light);
  background: rgba(26, 58, 92, 0.02);
  transform: translateY(-1px);
}

.evento-punto-card:active {
  transform: translateY(0);
}

.evento-punto-card.voted {
  cursor: default;
  background: rgba(46, 125, 50, 0.04);
  border-color: rgba(46, 125, 50, 0.25);
}

.evento-punto-card.voted:hover {
  transform: none;
  background: rgba(46, 125, 50, 0.04);
  border-color: rgba(46, 125, 50, 0.25);
}

.evento-punto-card.disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.evento-punto-card.disabled:hover {
  transform: none;
  background: var(--card);
  border-color: var(--border);
}

.evento-punto-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  font-size: 22px;
  background: rgba(26, 58, 92, 0.08);
  border-radius: 10px;
  line-height: 1;
}

.evento-punto-card.voted .evento-punto-icon {
  background: rgba(46, 125, 50, 0.1);
}

.evento-punto-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.evento-punto-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.evento-punto-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.evento-punto-status {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 600;
  padding-left: 8px;
  white-space: nowrap;
}

.evento-punto-status.pending {
  color: var(--primary);
}

.evento-punto-status.done {
  color: var(--success);
}

.evento-punto-status.muted {
  color: var(--text-muted);
  font-weight: 500;
}

/* Pantalla de resumen al terminar el evento */
.evento-finished-summary {
  margin-top: 24px;
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: left;
}

.evento-finished-summary .summary-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.evento-finished-summary .summary-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.evento-finished-summary .summary-row:last-child {
  border-bottom: none;
}

.evento-finished-summary .summary-check {
  color: var(--success);
  font-size: 16px;
  flex-shrink: 0;
  margin-top: 1px;
}

.evento-finished-summary .summary-text {
  flex: 1;
  color: var(--text);
  font-weight: 500;
}

.evento-finished-summary .summary-opt {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 2px;
}

/* Fila con boton "Volver al menu" encima del titulo de la votacion
   (solo se muestra en flujo de evento, hidden en flujo individual) */
.vote-back-row {
  margin-bottom: 12px;
  text-align: left;
}

.btn-link {
  background: none;
  border: none;
  padding: 4px 0;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  transition: color 0.15s;
}

.btn-link:hover {
  color: var(--primary-light);
  text-decoration: underline;
}

.btn-link:active {
  transform: scale(0.98);
}

/* Slogan + marca Votspot footer (solo free tier) */
.vj-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 10px 16px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  background: rgba(248, 249, 250, 0.9);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--border);
  z-index: 100;
}

.vj-footer a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.vj-footer a:hover {
  text-decoration: underline;
}

/* Cuando el footer esta visible, deja hueco al contenido */
body.vj-footer-visible .screen {
  padding-bottom: 48px;
}

/* Selector de idioma (flotante arriba a la derecha) */
.lang-selector-mount {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 200;
}

.vj-lang-selector {
  display: inline-flex;
  align-items: center;
}

.vj-lang-select {
  appearance: none;
  -webkit-appearance: none;
  padding: 6px 28px 6px 10px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  background-color: rgba(255, 255, 255, 0.9);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path fill='%23666' d='M3 4.5l3 3 3-3z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 8px center;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.vj-lang-select:hover {
  border-color: var(--primary);
}

.vj-lang-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26, 58, 92, 0.15);
}

/* Responsive */
@media (max-width: 480px) {
  .screen { padding: 16px; }
  h1 { font-size: 24px; }
  h2 { font-size: 20px; }
  .lang-selector-mount { top: 8px; right: 8px; }
  .vj-lang-select { padding: 4px 24px 4px 8px; font-size: 12px; }
}
