/* === GLOBAL === */

:root {
  --bg-color: #ffffff;
  --text-color: #1a1a1a;
  --accent-color: #8b5cf6;
  --accent-hover: #7c3aed;
  --accent-soft: rgba(139, 92, 246, 0.07);

  /* Alias internos (compatibilidad con el resto del stylesheet) */
  --bg: var(--bg-color);
  --ink: var(--text-color);
  --muted: #717171;
  --faint: #9a9a9a;
  --line: #e7e7e7;
  --line-strong: #d4d4d4;
  --field: #fafafa;
  --space: clamp(20px, 4vw, 56px);
  --space-shell: clamp(16px, 4vw, 32px);
  --header-h: 64px;
  --max-w: 980px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 12px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-color: #0f0f0f;
    --text-color: #f5f5f5;
    --accent-color: #a78bfa;
    --accent-hover: #8b5cf6;
    --accent-soft: rgba(167, 139, 250, 0.12);

    --bg: var(--bg-color);
    --ink: var(--text-color);
    --muted: #a3a3a3;
    --faint: #737373;
    --line: #2a2a2a;
    --line-strong: #3a3a3a;
    --field: #1a1a1a;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 4px 12px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.45);
  }
}

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

html,
body {
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Schibsted Grotesk", system-ui, -apple-system, sans-serif;
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  letter-spacing: -0.01em;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

a {
  color: inherit;
}

/* === LAYOUT === */

.itap-page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.itap-main {
  flex: 1;
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--space-shell);
  padding-top: calc(var(--header-h) + var(--space-shell));
  padding-bottom: var(--space-shell);
}

/* === LOGO === */

.itap-logo {
  display: inline-flex;
  align-items: baseline;
  text-decoration: none;
  color: var(--ink);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
}

.itap-logo__i {
  font-size: inherit;
  text-transform: lowercase;
}

.itap-logo__tap {
  font-size: inherit;
  text-transform: uppercase;
}

.itap-logo--header {
  font-size: clamp(1.75rem, 5vw, 2.25rem);
}

.itap-logo--footer {
  font-size: clamp(1.125rem, 3vw, 1.375rem);
}

/* === HEADER === */

.itap-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-h);
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding-top: env(safe-area-inset-top);
}

.itap-header__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  height: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--space-shell);
}

/* === FOOTER === */

.itap-footer {
  border-top: 1px solid var(--line);
  background: var(--bg);
  padding: var(--space-shell);
  padding-bottom: max(var(--space-shell), env(safe-area-inset-bottom));
}

.itap-footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: var(--max-w);
  margin: 0 auto;
  flex-wrap: wrap;
}

.itap-footer__copy {
  font-size: 0.875rem;
  color: var(--muted);
  margin: 0;
}

.itap-footer__legal {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 8px;
  width: 100%;
}

.itap-footer__legal button,
.itap-footer__link {
  font-size: 0.8125rem;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
  padding: 0;
}

.itap-footer__legal button:hover,
.itap-footer__link:hover {
  color: var(--accent-hover);
}

.itap-setup-guides-hint {
  font-size: 0.78rem;
  color: var(--faint);
  text-align: center;
  margin-top: 24px;
}

.itap-setup-guides-hint a {
  color: var(--accent-color);
  text-decoration: underline;
}

@media (max-width: 600px) {
  .itap-footer__inner {
    flex-direction: column;
    justify-content: center;
    text-align: center;
  }

  .itap-footer__legal {
    justify-content: center;
  }
}

/* === VOTE COUNTER APP === */

.app {
  width: 100%;
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.screen {
  display: none;
  flex: 1;
  flex-direction: column;
}

.screen.active {
  display: flex;
  animation: fade 0.26s ease both;
}

@keyframes fade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.eyebrow {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
}

.display {
  font-size: clamp(34px, 6vw, 58px);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.035em;
}

.lede {
  font-size: clamp(16px, 2.2vw, 19px);
  color: var(--muted);
  max-width: 46ch;
  margin-top: 14px;
}

.setup-head {
  margin-bottom: clamp(28px, 5vw, 48px);
}

.setup-head .eyebrow {
  display: block;
  margin-bottom: 16px;
}

@media (max-width: 768px) {
  .header-text-container {
    text-align: center;
  }

  .header-text-container .lede {
    margin-left: auto;
    margin-right: auto;
  }
}

.candidates-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cand-row {
  display: flex;
  align-items: center;
  gap: 12px;
  animation: fade 0.2s ease both;
}

.cand-index {
  width: 26px;
  flex: none;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--faint);
  font-size: 15px;
}

.cand-input {
  flex: 1;
  font: inherit;
  font-size: clamp(18px, 2.4vw, 22px);
  font-weight: 500;
  padding: 16px 18px;
  background: var(--field);
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  color: var(--ink);
  transition: border-color 0.18s ease, background 0.18s ease;
  min-width: 0;
}

.cand-input::placeholder {
  color: var(--faint);
  font-weight: 400;
}

.cand-input:focus {
  outline: none;
  border-color: var(--ink);
  background: var(--bg);
  box-shadow: none;
}

.row-remove {
  width: 48px;
  height: 48px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: var(--faint);
  font-size: 22px;
  line-height: 1;
  transition: color 0.18s ease, background 0.18s ease, opacity 0.18s ease;
}

.row-remove:hover {
  color: var(--ink);
  background: var(--field);
}

.row-remove:disabled {
  opacity: 0;
  pointer-events: none;
}

.add-btn {
  align-self: flex-start;
  margin-top: 20px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 4px;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  transition: opacity 0.18s ease;
}

.add-btn:hover {
  opacity: 0.62;
}

.add-btn .plus {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  font-size: 18px;
  line-height: 1;
  color: var(--ink);
}

/* === VOTOS ESPECIALES (toggles) === */

.itap-special-votes {
  margin-top: 24px;
  padding: 18px 20px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: var(--field);
}

.itap-special-votes__title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}

.itap-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.itap-toggle-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.itap-toggle-row__label {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  flex: 1;
}

.itap-toggle-row__hint {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
}

.itap-toggle {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.itap-toggle__track {
  flex-shrink: 0;
  width: 44px;
  height: 26px;
  background: var(--line);
  border-radius: 999px;
  position: relative;
  transition: background 0.2s ease;
}

.itap-toggle__track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff; /* intencional — el pulgar siempre contrasta sobre el track de color */
  box-shadow: 0 1px 4px rgba(0,0,0,0.18);
  transition: transform 0.2s ease;
}

.itap-toggle:checked + .itap-toggle__track {
  background: var(--accent-color, #8b5cf6);
}

.itap-toggle:checked + .itap-toggle__track::after {
  transform: translateX(18px);
}

.setup-footer {
  margin-top: auto;
  padding-top: clamp(32px, 6vw, 56px);
}

.btn-primary {
  width: 100%;
  padding: 22px;
  background: var(--ink);
  color: var(--bg);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
  border-radius: 14px;
  transition: transform 0.16s ease, background 0.18s ease, opacity 0.18s ease;
}

.btn-primary:hover {
  opacity: 0.85;
}

.btn-primary:active {
  transform: scale(0.99);
}

.btn-primary:disabled {
  background: var(--line);
  color: var(--faint);
  cursor: not-allowed;
}

.hint {
  text-align: center;
  color: var(--faint);
  font-size: 14px;
  margin-top: 14px;
  min-height: 18px;
  transition: opacity 0.18s ease;
}

.vote-bar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 22px;
  margin-bottom: clamp(20px, 4vw, 32px);
  border-bottom: 1px solid var(--line);
}

.vote-bar .totals {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.vote-bar .total-num {
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.vote-bar .total-lbl {
  font-size: 14px;
  color: var(--muted);
}

.end-btn {
  min-height: 48px;
  padding: 12px 24px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  transition: border-color 0.18s ease, color 0.18s ease;
}

.end-btn:hover {
  border-color: var(--ink);
}

.tiles {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}

@media (min-width: 620px) {
  .tiles {
    grid-template-columns: repeat(2, 1fr);
  }

  .tiles.single {
    grid-template-columns: 1fr;
  }
}

.tile {
  position: relative;
  text-align: left;
  background: var(--bg);
  border: 1.5px solid var(--line-strong);
  border-radius: 18px;
  padding: clamp(22px, 3vw, 30px);
  min-height: clamp(150px, 22vw, 190px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.13s ease, border-color 0.16s ease, background 0.16s ease;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

.tile:hover {
  border-color: var(--ink);
}

.tile:active {
  transform: scale(0.985);
  background: var(--accent-soft);
  border-color: var(--accent-hover);
}

.tile.bump {
  animation: bump 0.18s ease;
}

.vote-tile--special {
  opacity: 0.75;
  border-style: dashed;
}

.vote-tile--special .tile-name {
  color: var(--muted);
  font-style: italic;
}

@keyframes bump {
  50% {
    background: var(--accent-soft);
  }
}

.tile-name {
  font-size: clamp(20px, 3vw, 26px);
  font-weight: 700;
  letter-spacing: -0.02em;
  padding-right: 48px;
  overflow-wrap: anywhere;
}

.tile-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.tile-count {
  font-size: clamp(46px, 9vw, 68px);
  font-weight: 800;
  line-height: 0.9;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
  transition: transform 0.13s ease;
}

.tile-count.tick {
  transform: scale(1.12);
}

.minus-btn {
  width: 48px;
  height: 48px;
  flex: none;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  font-size: 24px;
  font-weight: 500;
  color: var(--muted);
  transition: border-color 0.16s ease, color 0.16s ease, background 0.16s ease, opacity 0.16s ease;
}

.minus-btn:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.minus-btn:disabled {
  opacity: 0.3;
  pointer-events: none;
}

.tap-hint {
  position: absolute;
  top: 18px;
  right: 22px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}

.result-doc {
  animation: fade 0.3s ease both;
}

.result-head {
  border-bottom: 2px solid var(--ink);
  padding-bottom: 22px;
  margin-bottom: 8px;
}

.result-head .display {
  margin-top: 12px;
}

.result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 28px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 15px;
}

.result-meta b {
  color: var(--ink);
  font-weight: 600;
}

.result-list {
  margin-top: 8px;
}

.result-item {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.result-rank {
  font-size: 17px;
  font-weight: 700;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.result-name {
  font-size: clamp(19px, 2.6vw, 24px);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.result-name .winner-tag {
  margin-left: 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-color);
  vertical-align: middle;
}

.result-num {
  text-align: right;
}

.result-votes {
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  line-height: 1;
}

.result-pct {
  font-size: 14px;
  color: var(--muted);
  margin-top: 4px;
}

.result-item.is-winner .result-name {
  color: var(--ink);
}

.result-item.is-winner .result-votes {
  color: var(--accent-color);
}

.meter {
  grid-column: 2 / 4;
  height: 4px;
  background: var(--line);
  border-radius: 99px;
  margin-top: 14px;
  overflow: hidden;
}

.meter > span {
  display: block;
  height: 100%;
  background: var(--line-strong);
  border-radius: 99px;
  transition: width 0.5s ease;
}

.result-item.is-winner .meter > span {
  background: var(--accent-color);
}

.result-item--special {
  opacity: 0.7;
  border-top-style: dashed;
}

.result-item--special .result-name,
.result-item--special .result-votes {
  color: var(--muted);
  font-style: italic;
}

.result-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: clamp(32px, 5vw, 48px);
}

.result-actions button {
  flex: 1 1 200px;
}

.btn-ghost {
  padding: 22px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  font-size: 17px;
  font-weight: 600;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.btn-ghost:hover {
  border-color: var(--ink);
}

@media (max-width: 480px) {
  body {
    font-size: 16px;
  }

  .result-item {
    grid-template-columns: 28px 1fr auto;
    gap: 12px;
  }
}

/* === COOKIES === */

.itap-cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  padding: var(--space-shell);
  padding-bottom: max(var(--space-shell), env(safe-area-inset-bottom));
  pointer-events: none;
  opacity: 0;
  transform: translateY(100%);
  transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.itap-cookie-banner.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.itap-cookie-banner.is-visible .itap-cookie-banner__panel {
  pointer-events: auto;
}

body.cookie-banner-visible {
  padding-bottom: 120px;
}

.itap-cookie-banner.is-hidden {
  display: none;
}

.itap-cookie-banner__panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 20px 24px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
}

.itap-cookie-banner__text {
  flex: 1;
  min-width: 0;
  font-size: 0.9375rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.55;
}

.itap-cookie-banner__text button {
  color: var(--accent-color);
  text-decoration: underline;
  text-underline-offset: 2px;
  font: inherit;
  padding: 0;
}

.itap-cookie-banner__actions {
  display: flex;
  flex-shrink: 0;
  gap: 10px;
}

.itap-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1;
  border-radius: 8px;
  cursor: pointer;
  border: none;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}

.itap-btn--primary {
  background: var(--accent-color);
  color: #ffffff;
}

.itap-btn--primary:hover {
  background: var(--accent-hover);
  color: #ffffff;
}

.itap-btn--ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

.itap-btn--ghost:hover {
  background: var(--accent-soft);
  border-color: var(--accent-hover);
  color: var(--accent-hover);
}

.itap-btn--secondary {
  background: var(--field);
  color: var(--ink);
  border: 1.5px solid var(--line-strong);
}

.itap-btn--secondary:hover {
  background: var(--accent-soft);
  border-color: var(--accent-color);
  color: var(--accent-color);
}

@media (max-width: 720px) {
  .itap-cookie-banner__panel {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .itap-cookie-banner__actions {
    flex-direction: column;
  }

  .itap-btn {
    width: 100%;
  }
}

/* === LEGAL MODALS === */

.itap-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-shell);
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.itap-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.itap-modal__dialog {
  width: 100%;
  max-width: 680px;
  max-height: min(85dvh, 720px);
  overflow-y: auto;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: clamp(24px, 4vw, 36px);
  transform: translateY(12px);
  transition: transform 0.25s ease;
}

.itap-modal.is-open .itap-modal__dialog {
  transform: translateY(0);
}

.itap-modal__close {
  display: inline-flex;
  align-items: center;
  margin-top: 2rem;
  padding: 10px 18px;
  font-size: 0.875rem;
  font-weight: 600;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  transition: border-color 0.15s ease, color 0.15s ease;
}

.itap-modal__close:hover {
  border-color: var(--accent-hover);
  color: var(--accent-hover);
}

.itap-legal h1 {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
  line-height: 1.15;
}

.itap-legal__updated {
  font-size: 0.875rem;
  color: var(--faint);
  margin-bottom: 2rem;
}

.itap-legal h2 {
  font-size: 1.125rem;
  font-weight: 700;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}

.itap-legal p {
  color: var(--muted);
  margin-bottom: 1rem;
}

.itap-legal ul {
  color: var(--muted);
  margin: 0 0 1rem 1.25rem;
}

.itap-legal li {
  margin-bottom: 0.35rem;
}

.itap-legal code {
  font-size: 0.875em;
  background: var(--field);
  padding: 2px 6px;
  border-radius: 4px;
}

/* === MODAL: VOTACIÓN SIN MODO SEGURO === */

.itap-unsafe-modal {
  max-width: 520px;
}

.itap-unsafe-modal__title {
  font-size: clamp(1.5rem, 4vw, 1.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
  line-height: 1.15;
  color: var(--ink);
}

.itap-unsafe-modal__lede {
  color: var(--muted);
  font-size: 0.9375rem;
  margin-bottom: 1rem;
  line-height: 1.55;
}

.itap-unsafe-modal__list {
  color: var(--muted);
  font-size: 0.9375rem;
  margin: 0 0 1.5rem 1.25rem;
  line-height: 1.55;
}

.itap-unsafe-modal__list li {
  margin-bottom: 0.35rem;
}

.itap-unsafe-modal__actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 0.5rem;
}

.itap-unsafe-modal__actions .btn-primary,
.itap-unsafe-modal__actions .btn-ghost {
  width: 100%;
}

@media (max-width: 480px) {
  #unsafeVotingModal .itap-modal__dialog {
    padding: clamp(20px, 5vw, 28px);
    border-radius: 14px;
  }
}

/* === MODAL: SELECCIÓN MODO SEGURO === */

.itap-secure-choice-modal {
  max-width: 440px;
}

.itap-secure-choice-modal__title {
  font-size: clamp(1.5rem, 4vw, 1.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.35rem;
  line-height: 1.15;
  color: var(--ink);
}

.itap-secure-choice-modal__subtitle {
  font-size: 0.9375rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.itap-secure-choice-modal__options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 1.25rem;
}

.itap-choice-card {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 18px 20px;
  border-radius: 14px;
  text-align: left;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.13s ease;
}

.itap-choice-card:active {
  transform: scale(0.99);
}

.itap-choice-card__label {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.25;
  color: inherit;
}

.itap-choice-card__hint {
  font-size: 0.8125rem;
  font-weight: 400;
  opacity: 0.75;
  line-height: 1.35;
  color: inherit;
}

.itap-choice-card--primary {
  background: var(--ink);
  color: var(--bg);
  border: 1px solid var(--ink);
}

.itap-choice-card--primary:hover {
  opacity: 0.85;
}

.itap-choice-card--primary .itap-choice-card__hint {
  color: inherit;
  opacity: 0.75;
}

.itap-choice-card--outline {
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--line-strong);
}

.itap-choice-card--outline:hover {
  border-color: var(--ink);
  background: var(--field);
}

.itap-choice-card--outline .itap-choice-card__hint {
  color: var(--muted);
  opacity: 0.85;
}

.itap-secure-choice-modal__cancel {
  display: block;
  width: 100%;
  padding: 12px;
  font-size: 0.875rem;
  color: var(--muted);
  text-align: center;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.itap-secure-choice-modal__cancel:hover {
  color: var(--accent-hover);
}

/* === MODAL: INICIAR SESIÓN === */

.itap-login-modal {
  max-width: 480px;
}

.itap-login-step.is-hidden {
  display: none;
}

.itap-login-modal__title {
  font-size: clamp(1.5rem, 4vw, 1.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
  line-height: 1.15;
  color: var(--ink);
}

.itap-login-modal__lede {
  color: var(--muted);
  font-size: 0.9375rem;
  margin-bottom: 1.5rem;
  line-height: 1.55;
}

.itap-login-modal__note {
  color: var(--faint);
  font-size: 0.8125rem;
  margin: -0.75rem 0 1.25rem;
  line-height: 1.45;
}

.itap-login-modal__hint {
  color: var(--muted);
  font-size: 0.875rem;
  margin: 0 0 10px;
  text-align: center;
}

.itap-login-notfound-prompt {
  margin-bottom: 1rem;
}

.itap-login-notfound-prompt.is-hidden {
  display: none;
}

.itap-login-notfound-prompt__btn {
  width: 100%;
}

.itap-login-waiting__icon {
  font-size: 2.5rem;
  line-height: 1;
  text-align: center;
  margin-bottom: 0.75rem;
}

.itap-login-modal__actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.itap-login-modal__actions .btn-primary,
.itap-login-modal__actions .btn-ghost {
  width: 100%;
}

@media (max-width: 480px) {
  #secureModeChoiceModal .itap-modal__dialog,
  #secureLoginModal .itap-modal__dialog {
    padding: clamp(20px, 5vw, 28px);
    border-radius: 14px;
  }
}


/* === MODO REMOTO === */

.remote-mode-btn {
  width: 100%;
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-align: center;
}

.remote-mode-btn__label {
  display: block;
  font-size: inherit;
  font-weight: inherit;
  line-height: 1.2;
}

.remote-mode-btn__hint {
  display: block;
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--muted);
  opacity: 0.85;
  line-height: 1.35;
}

.remote-link-box {
  margin-top: 24px;
  padding: 20px;
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.remote-link-box.is-hidden {
  display: none;
}

.remote-link-box--modal {
  margin: 20px 0 24px;
}

.remote-link-box__label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 10px;
}

.remote-link-box__row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.remote-link-box__input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 14px;
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  color: var(--ink);
}

.remote-link-box__hint {
  font-size: 13px;
  color: var(--muted);
  margin-top: 12px;
  line-height: 1.5;
}

/* Modal remoto — misma estética que modales legales / resto de la app */
.itap-remote-modal {
  position: relative;
  max-width: 480px;
}

.itap-remote-modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  font-size: 24px;
  line-height: 1;
  color: var(--muted);
  transition: color 0.15s ease, background 0.15s ease;
}

.itap-remote-modal__close:hover {
  color: var(--ink);
  background: var(--field);
}

.itap-remote-modal__title {
  font-size: clamp(1.5rem, 4vw, 1.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
  padding-right: 36px;
  color: var(--ink);
  line-height: 1.15;
}

.itap-remote-modal__lede {
  color: var(--muted);
  font-size: 0.9375rem;
  margin-bottom: 1.5rem;
  line-height: 1.55;
}

.itap-remote-modal__lede strong {
  color: var(--ink);
  font-weight: 600;
}

.itap-remote-step.is-hidden {
  display: none;
}

.itap-remote-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.itap-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.itap-field__label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted);
}

.itap-field__input {
  font: inherit;
  font-size: 16px;
  padding: 14px 16px;
  background: var(--field);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  color: var(--ink);
  transition: border-color 0.18s ease, background 0.18s ease;
}

.itap-field__input::placeholder {
  color: var(--faint);
  font-weight: 400;
}

.itap-field__input:focus {
  outline: none;
  border-color: var(--ink);
  background: var(--bg);
}

.itap-field--invalid .itap-field__input {
  border-color: #ef4444;
}

.itap-field--invalid .itap-field__input:focus {
  border-color: #ef4444;
}

.itap-field__error {
  font-size: 0.8125rem;
  color: #ef4444;
  margin: 0;
  line-height: 1.4;
}

.itap-field__error.is-hidden {
  display: none;
}

.itap-field__input--otp {
  font-size: clamp(24px, 6vw, 28px);
  font-weight: 700;
  letter-spacing: 0.35em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.itap-remote-form__error {
  font-size: 0.875rem;
  color: #ef4444;
  margin: 0;
}

.itap-remote-form__error.is-hidden {
  display: none;
}

.itap-remote-form__submit {
  position: relative;
  margin-top: 4px;
  width: 100%;
}

.itap-remote-form__submit.is-loading .itap-remote-form__submit-text {
  visibility: hidden;
}

.itap-remote-form__submit.is-loading .itap-remote-form__submit-loading {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  position: absolute;
  inset: 0;
}

.itap-remote-form__submit-loading {
  display: none;
}

.itap-remote-form__submit-loading.is-hidden {
  display: none;
}

.itap-remote-form__legal {
  font-size: 0.6875rem;
  color: var(--faint);
  line-height: 1.55;
  margin: 0;
}

.itap-remote-form__back {
  font-size: 0.875rem;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
  padding: 8px 0;
  align-self: flex-start;
}

.itap-remote-form__back:hover {
  color: var(--accent-hover);
}

.itap-remote-form__back-btn {
  width: 100%;
  margin-top: 4px;
}

.itap-remote-form__resend {
  display: block;
  width: 100%;
  padding: 10px 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent-color);
  text-align: center;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.itap-remote-form__resend:hover:not(:disabled) {
  color: var(--accent-hover);
}

.itap-remote-form__resend:disabled {
  color: var(--faint);
  text-decoration: none;
  cursor: not-allowed;
}

.itap-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--line);
  border-top-color: var(--accent-color);
  border-radius: 50%;
  animation: itap-spin 0.7s linear infinite;
}

.itap-spinner--lg {
  width: 40px;
  height: 40px;
  border-width: 3px;
}

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

@media (max-width: 480px) {
  #remoteModal .itap-modal__dialog {
    padding: clamp(20px, 5vw, 28px);
    border-radius: 14px;
  }

  .itap-remote-form__submit,
  #remoteSuccessContinue,
  .remote-link-box__row .itap-btn,
  .remote-link-box__row .itap-btn--primary {
    width: 100%;
  }

  .remote-link-box__row {
    flex-direction: column;
  }
}

/* Variables solo para modo proyector */
:root {
  --loit-bg: #0f0f0f;
  --loit-text: #f5f5f5;
  --loit-accent: #a78bfa;
  --loit-accent-hover: #8b5cf6;
  --loit-border: #2a2a2a;
  --loit-field: #1a1a1a;
  --loit-muted: #a3a3a3;
}

/* === MODO PROYECTOR === */

body.itap-projector-mode {
  background: var(--loit-bg);
  color: var(--loit-text);
  --ink: #ffffff;
  --muted: rgba(255,255,255,0.6);
  --faint: rgba(255,255,255,0.35);
  --line: rgba(255,255,255,0.12);
  --line-strong: rgba(255,255,255,0.25);
  --field: rgba(255,255,255,0.06);
  --shadow: 0 1px 3px rgba(0,0,0,0.4);
}

body.itap-projector-mode .itap-logo {
  color: #ffffff !important;
}

body.itap-projector-mode .itap-header {
  background: rgba(0,0,0,0.6);
  border-bottom-color: rgba(255,255,255,0.1);
}

body.itap-projector-mode .itap-footer {
  background: transparent;
  border-top-color: rgba(255,255,255,0.1);
}

body.itap-projector-mode .itap-footer,
body.itap-projector-mode .itap-footer p,
body.itap-projector-mode .itap-footer a,
body.itap-projector-mode .itap-footer button,
body.itap-projector-mode .itap-footer nav {
  color: rgba(255,255,255,0.3) !important;
}

body.itap-projector-mode .projector-head,
body.itap-projector-mode .projector-head *,
body.itap-projector-mode #projectorEyebrow,
body.itap-projector-mode #projectorTitle,
body.itap-projector-mode #projectorSubtitle,
body.itap-projector-mode .totals,
body.itap-projector-mode .total-num,
body.itap-projector-mode .total-lbl {
  color: #ffffff !important;
}

body.itap-projector-mode .projector-live-badge {
  color: #22c55e !important;
}

body.itap-projector-mode .total-num {
  color: var(--accent-color) !important;
}

body.itap-projector-mode .itap-header,
body.itap-projector-mode .itap-footer {
  background: var(--loit-bg);
  border-color: var(--loit-border);
}

body.itap-projector-mode .itap-footer__legal,
body.itap-projector-mode #cookieBanner,
body.itap-projector-mode .remote-mode-btn,
body.itap-projector-mode .remote-link-box,
body.itap-projector-mode #setupScreen,
body.itap-projector-mode #voteScreen,
body.itap-projector-mode #resultScreen {
  display: none !important;
}

body.itap-projector-mode .itap-main {
  max-width: 1200px;
}

body.itap-projector-mode .itap-header {
  position: relative;
  box-shadow: none;
}

body.itap-projector-mode .itap-main {
  padding-top: var(--space-shell);
}

.projector-head {
  margin-bottom: clamp(24px, 4vw, 40px);
  text-align: center;
}

.projector-head .lede {
  margin-left: auto;
  margin-right: auto;
  color: var(--loit-muted);
}

.projector-waiting {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 48px 0;
  color: var(--loit-muted);
}

.projector-waiting.is-hidden {
  display: none;
}

.projector-vote-bar.is-hidden,
.projector-tiles.is-hidden,
.projector-results.is-hidden {
  display: none;
}

.projector-live-badge {
  font-size: 13px;
  font-weight: 600;
  color: #22c55e;
  letter-spacing: 0.04em;
  animation: projector-pulse 2s ease-in-out infinite;
}

@keyframes projector-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

.projector-tiles .tile,
.projector-tile {
  cursor: default;
  pointer-events: none;
  background: var(--loit-field);
  border-color: #3a3a3a;
}

.projector-tiles .tile:active,
.projector-tile:active {
  transform: none;
}

.projector-tiles .minus-btn,
.projector-tiles .tap-hint {
  display: none;
}

.projector-tile-meter {
  margin-top: 16px;
  height: 6px;
  background: #2a2a2a;
}

.projector-tile-meter > span {
  background: var(--loit-accent);
  transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.projector-tile-pct {
  font-size: 14px;
  font-weight: 600;
  color: var(--loit-muted);
  font-variant-numeric: tabular-nums;
}

body.itap-projector-mode .tile-count {
  font-size: clamp(56px, 12vw, 96px);
  transition: transform 0.18s ease;
}

body.itap-projector-mode .tile-count.tick {
  transform: scale(1.08);
  color: var(--loit-accent);
}

body.itap-projector-mode .total-num.tick {
  color: var(--loit-accent);
}

body.itap-projector-mode .tile-name {
  font-size: clamp(24px, 4vw, 36px);
}

body.itap-projector-mode .projector-results .meter > span {
  background: var(--loit-accent);
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

body.itap-projector-mode .projector-results .result-item.is-winner .result-votes {
  color: var(--loit-accent);
}

@media (min-width: 900px) {
  body.itap-projector-mode .projector-tiles {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }
}

/* === TOAST === */

.itap-toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  z-index: 10000;
  max-width: min(420px, calc(100vw - 32px));
  padding: 14px 20px;
  border-radius: 12px;
  background: var(--ink);
  color: var(--bg);
  font-size: 0.9375rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.4;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  transform: translate(-50%, 120%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.itap-toast.is-hidden {
  display: none;
}

.itap-toast.is-visible {
  display: block;
  transform: translate(-50%, 0);
  opacity: 1;
}

.remote-mode-btn.is-secure-active {
  opacity: 0.6;
  cursor: default;
}

.remote-mode-btn.is-secure-active .remote-mode-btn__hint::before {
  content: "✓ ";
}

/* === BOTÓN MI CUENTA (HEADER) === */

/* Botón Mi cuenta — minimalista, esquina derecha del header */
.itap-account-btn {
  position: absolute;
  right: var(--space-shell);
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: none;
  border: 1.5px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
  color: var(--ink);
  transition: background 0.15s, border-color 0.15s;
  padding: 0;
}

.itap-account-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.itap-account-btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent-color);
  color: var(--accent-color);
}

.itap-account-btn.is-hidden {
  display: none;
}

.itap-account-btn__label {
  display: none;
}

/* === MODAL MI CUENTA === */

.itap-account-modal {
  max-width: 480px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 32px 24px;
}

.itap-account-modal__header {
  text-align: center;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
}

.itap-account-modal__avatar {
  font-size: 3rem;
  margin-bottom: 12px;
}

.itap-account-modal__name {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 4px;
}

.itap-account-modal__email,
.itap-account-modal__phone {
  font-size: 0.875rem;
  opacity: 0.6;
  margin: 0;
}

.itap-account-modal__section-title {
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.5;
  margin: 0 0 16px;
}

.itap-account-modal__empty {
  font-size: 0.875rem;
  opacity: 0.5;
  text-align: center;
  padding: 24px 0;
}

.itap-account-modal__signout {
  width: 100%;
  margin-top: 24px;
  color: #e53e3e;
  border-color: #e53e3e;
}

/* Tarjetas de historial */
.itap-history-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 10px;
  background: var(--field);
}

.itap-history-item:last-child {
  margin-bottom: 0;
}

.itap-history-item__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.itap-history-item__info {
  flex: 1;
  min-width: 0;
}

.itap-history-item__date {
  font-size: 0.75rem;
  opacity: 0.5;
  margin-bottom: 4px;
}

.itap-history-item__winner {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.itap-history-item__meta {
  font-size: 0.78rem;
  opacity: 0.6;
}

.itap-history-item__pdf-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent-color);
  border: 1.5px solid var(--accent-color);
  border-radius: 8px;
  padding: 6px 12px;
  background: none;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}

.itap-history-item__pdf-btn:hover {
  background: var(--accent-soft);
}

.itap-history-item__candidates {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.itap-history-item__candidate {
  font-size: 0.72rem;
  background: var(--line);
  border-radius: 4px;
  padding: 2px 8px;
  color: var(--ink);
}

.remote-link-box__actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.itap-share-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 8px;
  padding: 7px 14px;
  border: 1.5px solid var(--line);
  background: none;
  cursor: pointer;
  color: var(--ink);
  transition: background 0.15s, border-color 0.15s;
}

.itap-share-btn--whatsapp:hover {
  background: #e7f8ee;
  border-color: #25d366;
  color: #128c3e;
}

.itap-share-btn--qr:hover {
  background: var(--accent-soft);
  border-color: var(--accent-color);
  color: var(--accent-color);
}

/* === CO-OPERADOR === */

.itap-cooperator-box {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.itap-cooperator-coming-soon {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 20px 16px;
  background: var(--field);
  border: 1px dashed var(--line);
  border-radius: 12px;
  gap: 8px;
}

.itap-cooperator-coming-soon__icon {
  font-size: 1.8rem;
  opacity: 0.5;
}

.itap-cooperator-coming-soon__text {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--muted);
}

.itap-cooperator-coming-soon__sub {
  font-size: 0.78rem;
  color: var(--faint);
  line-height: 1.4;
}

.itap-cooperator-box__hint {
  font-size: 0.8rem;
  opacity: 0.6;
  margin-bottom: 10px;
  line-height: 1.5;
}

.itap-cooperator-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-color);
  border: 1.5px solid var(--accent-color);
  border-radius: 999px;
  padding: 4px 12px;
  margin-bottom: 12px;
}

.itap-cooperator-badge::before {
  content: "👥";
  font-size: 0.85em;
}

.itap-qr-modal {
  max-width: 380px;
  width: 100%;
  padding: 40px 32px 32px;
  text-align: center;
  position: relative;
}

.itap-qr-modal__eyebrow {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--accent-color);
  margin-bottom: 12px;
}

.itap-qr-modal__title {
  font-size: clamp(1.4rem, 4vw, 1.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 28px;
  color: var(--ink);
}

.itap-qr-modal__canvas-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px;
  background: #ffffff; /* intencional — el QR siempre necesita fondo blanco para ser legible */
  border-radius: 16px;
  margin-bottom: 16px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.itap-qr-modal__canvas-wrap canvas {
  display: block;
  border-radius: 4px;
}

.itap-qr-modal__url {
  font-size: 0.7rem;
  opacity: 0.4;
  word-break: break-all;
  margin-bottom: 20px;
}

.itap-qr-modal__close-btn {
  width: 100%;
}

/* === PROYECTOR: SELECTOR DE VISTA === */

.projector-view-selector {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 16px 0;
}

.projector-view-selector.is-hidden {
  display: none;
}

.projector-view-btn {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}

.projector-view-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.5);
}

.projector-view-btn.is-active {
  background: rgba(255, 255, 255, 0.22);
  border-color: #ffffff;
  color: #ffffff;
}

/* === PROYECTOR: VISTA BARRAS === */

.projector-bars-view {
  width: 100%;
  max-width: 700px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.projector-bars-view.is-hidden {
  display: none;
}

.proj-bar-row__name {
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 8px;
}

.proj-bar-row--winner .proj-bar-row__name {
  color: #ffd700;
}

.proj-bar-row__track {
  width: 100%;
  height: 20px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  overflow: hidden;
}

.proj-bar-row__fill {
  height: 100%;
  background: #a78bfa;
  border-radius: 999px;
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.proj-bar-row--winner .proj-bar-row__fill {
  background: #ffd700;
}

.proj-bar-row__stats {
  font-size: clamp(0.85rem, 1.8vw, 1.1rem);
  color: rgba(255, 255, 255, 0.55);
  margin-top: 4px;
}

body.itap-projector-mode .vote-tile--special,
body.itap-projector-mode .proj-bar-row--special {
  opacity: 0.6;
}

.proj-bar-row--special .proj-bar-row__name {
  font-style: italic;
  color: rgba(255, 255, 255, 0.5);
}


.remote-otp-waiting-msg {
  text-align: center;
  padding: 16px 0;
  line-height: 1.6;
}

.remote-otp-waiting-hint {
  font-size: 0.85em;
  opacity: 0.65;
  margin-top: 8px;
}

/* === OFFLINE BADGE === */

.itap-offline-badge {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--ink);
  color: var(--bg);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 999px;
  z-index: 9999;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: opacity 0.2s;
  white-space: nowrap;
}

.itap-offline-badge.is-hidden {
  display: none;
}

.itap-offline-badge__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  flex-shrink: 0;
}

.itap-offline-badge.is-syncing .itap-offline-badge__dot {
  background: #f59e0b;
  animation: itap-pulse 1s infinite;
}

@keyframes itap-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* === PASSKEYS === */

.itap-passkey-modal {
  max-width: 360px;
  width: 100%;
  padding: 40px 28px 32px;
  text-align: center;
}

.itap-passkey-modal__icon {
  color: var(--accent-color);
  margin-bottom: 20px;
}

.itap-passkey-modal__title {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}

.itap-passkey-modal__body {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 24px;
}

.itap-passkey-modal__confirm {
  width: 100%;
  margin-bottom: 10px;
}

.itap-passkey-modal__skip {
  width: 100%;
  font-size: 0.85rem;
  opacity: 0.6;
}

.itap-passkey-login-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px;
  border: 1.5px solid var(--line-strong);
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
  background: var(--field);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  margin-bottom: 8px;
}

.itap-passkey-login-btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent-color);
  color: var(--accent-color);
}

.itap-passkey-login-btn.is-hidden {
  display: none;
}

.itap-passkey-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  color: var(--faint);
  font-size: 0.8rem;
}

.itap-passkey-divider.is-hidden {
  display: none;
}

.itap-passkey-divider::before,
.itap-passkey-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
/* ================================================================
   VOTACIONES PRIVADAS (POLL)
   ================================================================ */

/* Modal selección de modo */
.itap-mode-select-modal {
  max-width: 420px;
  width: 100%;
  padding: 36px 24px 28px;
  text-align: center;
}
.itap-mode-select-modal__title {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 6px;
}
.itap-mode-select-modal__sub {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 24px;
}
.itap-mode-card {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 18px 20px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--field);
  cursor: pointer;
  margin-bottom: 10px;
  text-align: left;
  transition: border-color 0.15s, background 0.15s;
}
.itap-mode-card:hover {
  border-color: var(--accent-color);
  background: var(--accent-soft);
}
.itap-mode-card__icon { font-size: 1.5rem; margin-bottom: 4px; }
.itap-mode-card__title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
}
.itap-mode-card__desc {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.4;
}
.itap-mode-select-modal__cancel {
  width: 100%;
  margin-top: 4px;
  font-size: 0.85rem;
  opacity: 0.6;
}

/* Poll setup screen */
.poll-setup-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 32px;
}
.poll-setup-back {
  font-size: 0.9rem;
  color: var(--muted);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}
.poll-setup-back:hover { color: var(--ink); }
.poll-setup-title {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.poll-options-section { margin: 24px 0; }
.poll-options-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.poll-option-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  align-items: center;
}
.poll-option-row .itap-field__input { flex: 1; }
.poll-option-remove {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  background: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.poll-option-remove:hover {
  border-color: #ef4444;
  color: #ef4444;
}
.poll-mode-section { margin: 24px 0; }
.poll-mode-section.is-hidden { display: none; }
.itap-radio-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  margin-bottom: 10px;
  transition: border-color 0.15s;
}
.itap-radio-card:has(input:checked) {
  border-color: var(--accent-color);
  background: var(--accent-soft);
}
.itap-radio-card input { margin-top: 2px; accent-color: var(--accent-color); }
.itap-radio-card__title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
  display: block;
  margin-bottom: 4px;
}
.itap-radio-card__desc {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.4;
}
.poll-setup-submit { width: 100%; margin-top: 24px; }

/* Poll active screen */
.poll-active-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.poll-active-title {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  flex: 1;
}
.poll-active-badge {
  font-size: 0.75rem;
  font-weight: 700;
  color: #22c55e;
}
.poll-results-live { margin: 24px 0; }
.poll-results-total {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 16px;
}
.poll-results-total__num {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent-color);
  margin-right: 4px;
}
.poll-result-row { margin-bottom: 16px; }
.poll-result-row--special { opacity: 0.65; }
.poll-result-row__name {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--ink);
}
.poll-result-row__bar-wrap {
  width: 100%;
  height: 8px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 4px;
}
.poll-result-row__bar {
  height: 100%;
  background: var(--accent-color);
  border-radius: 999px;
  transition: width 0.4s cubic-bezier(0.22,1,0.36,1);
}
.poll-result-row__stats {
  font-size: 0.78rem;
  color: var(--muted);
}
.poll-tokens-box {
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 20px;
}
.poll-tokens-box__label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}
.poll-tokens-box__count {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 12px;
}
.poll-tokens-download { font-size: 0.82rem; }
.poll-status-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--line);
  color: var(--muted);
}
.poll-status-badge--active {
  background: rgba(34,197,94,0.1);
  color: #22c55e;
}
.poll-close-btn { width: 100%; }

/* Pantallas del participante */
body.itap-participant-mode .itap-header,
body.itap-participant-mode .itap-footer,
body.itap-participant-mode .itap-main { display: none !important; }

/* Pantallas de participante — ocultas por defecto igual que .screen */
.itap-participant-screen {
  min-height: 100dvh;
  flex-direction: column;
}
.screen.itap-participant-screen.active {
  display: flex;
}

.participant-header {
  padding: 20px clamp(16px,4vw,32px);
  border-bottom: 1px solid var(--line);
}
.participant-body {
  flex: 1;
  max-width: 540px;
  margin: 0 auto;
  width: 100%;
  padding: 40px clamp(16px,4vw,32px);
}
.participant-body--center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.participant-eyebrow {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-color);
  margin-bottom: 12px;
}
.participant-title {
  font-size: clamp(1.5rem,4vw,2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
  line-height: 1.2;
}
.participant-hint {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 32px;
  line-height: 1.6;
}
.participant-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.participant-option-btn {
  width: 100%;
  padding: 18px 20px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--field);
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, background 0.15s;
}
.participant-option-btn:hover:not(:disabled) {
  border-color: var(--accent-color);
  background: var(--accent-soft);
  color: var(--accent-color);
}
.participant-option-btn--special {
  opacity: 0.7;
  font-style: italic;
}
.participant-option-btn--selected {
  border-color: #22c55e;
  background: rgba(34,197,94,0.08);
  color: #22c55e;
}
.participant-option-btn:disabled { cursor: not-allowed; opacity: 0.5; }
.participant-thanks-icon {
  font-size: 4rem;
  color: #22c55e;
  margin-bottom: 24px;
}
.participant-error-icon {
  font-size: 4rem;
  color: #ef4444;
  margin-bottom: 24px;
}
.participant-footer {
  padding: 16px clamp(16px,4vw,32px);
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 0.78rem;
  color: var(--faint);
}
.participant-footer a { color: var(--accent-color); }
/* ================================================================
   MODO SEGURO — 3 BOTONES + HINT GRATUITO
   ================================================================ */

.remote-mode-btn.is-hidden {
  display: none;
}

.secure-mode-actions.is-hidden {
  display: none;
}

.remote-mode-btn__hint--free {
  color: var(--accent-color);
  font-weight: 700;
  font-size: 0.7rem;
  margin-top: 2px;
}

/* Contenedor 3 botones — misma posición y ancho que remoteModeBtn */
.secure-mode-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
  margin-top: 12px;
}

@media (min-width: 600px) {
  .secure-mode-actions {
    display: flex;
    flex-direction: row;
    align-items: stretch;
  }

  /* Con 4 botones en fila, el texto descriptivo sobra */
  .secure-mode-actions .sma-btn__desc {
    display: none;
  }

  .secure-mode-actions .sma-btn {
    padding: 14px 8px;
  }
}

/* Botón base — hereda estética de btn-ghost */
.sma-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 14px 10px;
  border-radius: var(--radius, 12px);
  border: 1.5px solid var(--line);
  background: transparent;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  font-family: inherit;
}

.sma-btn:hover {
  border-color: var(--ink);
  background: var(--field);
}

.sma-btn__icon {
  font-size: 1.2rem;
  line-height: 1;
  margin-bottom: 2px;
}

.sma-btn__label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
}

.sma-btn__desc {
  font-size: 0.68rem;
  color: var(--muted);
  line-height: 1.3;
}

/* Botón central Modo Seguro activo */
.sma-btn--secure {
  border-color: var(--accent-color);
  background: var(--accent-soft);
}

.sma-btn--secure:hover {
  background: var(--accent-color);
  border-color: var(--accent-color);
}

.sma-btn--secure:hover .sma-btn__label,
.sma-btn--secure:hover .sma-btn__desc,
.sma-btn--secure:hover .sma-btn__secure-icon {
  color: #ffffff;
}

.sma-btn__secure-icon {
  font-size: 1rem;
  font-weight: 800;
  color: var(--accent-color);
  line-height: 1;
  margin-bottom: 2px;
}

.sma-btn--secure .sma-btn__label {
  color: var(--accent-color);
}

.sma-btn--secure .sma-btn__desc {
  color: var(--accent-color);
  opacity: 0.75;
}

/* Modal info Modo Seguro */
.secure-mode-info-modal {
  max-width: 400px;
  width: 100%;
  padding: 36px 28px 32px;
  text-align: center;
}

.secure-mode-info-modal__header {
  margin-bottom: 28px;
}

.secure-mode-info-modal__check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-color);
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 16px;
}

.secure-mode-info-modal__title {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
  color: var(--ink);
}

.secure-mode-info-modal__sub {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
}

.secure-mode-info-modal__list {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.secure-mode-info-modal__list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--ink);
  line-height: 1.4;
}

.secure-mode-info-modal__tick {
  color: var(--accent-color);
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.secure-mode-info-modal__link {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.5;
  border-top: 1px solid var(--line);
  padding-top: 20px;
  text-decoration: none;
}

.secure-mode-info-modal__link strong {
  color: var(--accent-color);
  display: block;
  margin-top: 4px;
}

.secure-mode-info-modal__link:hover strong {
  text-decoration: underline;
}
/* Aviso de términos para usuarios no registrados */
.itap-terms-notice {
  font-size: 0.72rem;
  color: var(--faint);
  text-align: center;
  margin-top: 8px;
  line-height: 1.4;
}

.itap-terms-notice.is-hidden {
  display: none;
}

.itap-terms-notice__link {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent-color);
  font-size: inherit;
  cursor: pointer;
  text-decoration: underline;
  font-family: inherit;
}

/* Checkbox de términos en registro */
.itap-terms-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 4px 0 12px;
  cursor: pointer;
}

.itap-terms-checkbox input[type="checkbox"] {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--accent-color);
  cursor: pointer;
}

.itap-terms-checkbox__text {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.5;
}

/* === BANNER PREMIUM === */

.itap-premium-banner {
  margin: 24px 0 0;
  padding: 20px;
  background: var(--field);
  border: 1.5px solid var(--line);
  border-radius: 14px;
}

.itap-premium-banner.is-hidden {
  display: none;
}

.itap-premium-banner__header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.itap-premium-banner__icon {
  font-size: 1.1rem;
}

.itap-premium-banner__title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink);
}

.itap-premium-banner__list {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.itap-premium-banner__list li {
  font-size: 0.82rem;
  color: var(--muted);
}

.itap-premium-banner__cta {
  width: 100%;
  font-size: 0.9rem;
}

/* PDF bloqueado */
.itap-result-pdf--locked {
  opacity: 0.5;
  cursor: pointer;
}

/* === MODAL PREMIUM === */

.itap-premium-modal {
  max-width: 380px;
  width: 100%;
  padding: 40px 28px 32px;
  text-align: center;
}

.itap-premium-modal__icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
}

.itap-premium-modal__title {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
  color: var(--ink);
}

.itap-premium-modal__body {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 16px;
}

.itap-premium-modal__list {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.itap-premium-modal__list li {
  font-size: 0.85rem;
  color: var(--ink);
  display: flex;
  gap: 8px;
}

.itap-premium-modal__cta {
  width: 100%;
  margin-bottom: 10px;
}

.itap-premium-modal__skip {
  width: 100%;
  font-size: 0.85rem;
  opacity: 0.6;
}

/* === CONTROL DE ASISTENCIA === */

.att-person-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius, 12px);
  border: 1px solid var(--border-color, rgba(0,0,0,0.08));
  margin-bottom: 8px;
  transition: background-color 0.25s ease;
}

.att-person-card.status-present  { background: rgba(34, 197, 94, 0.10); }
.att-person-card.status-online   { background: rgba(245, 158, 11, 0.10); }
.att-person-card.status-absent   { background: rgba(239, 68, 68, 0.10); }

.att-person-name {
  flex: 1;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.att-person-time {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

.att-btn-group {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.att-btn {
  padding: 6px 11px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  background: var(--bg-secondary, rgba(0,0,0,0.04));
  color: var(--text-secondary);
}

.att-btn:hover { opacity: 0.85; }

.att-btn.active-present {
  background: rgba(34, 197, 94, 0.20);
  border-color: rgba(34, 197, 94, 0.50);
  color: #166534;
}

.att-btn.active-online {
  background: rgba(245, 158, 11, 0.20);
  border-color: rgba(245, 158, 11, 0.50);
  color: #92400e;
}

.att-btn.active-absent {
  background: rgba(239, 68, 68, 0.20);
  border-color: rgba(239, 68, 68, 0.50);
  color: #7f1d1d;
}

.att-stats-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 16px;
}

.att-stat-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid transparent;
}

.att-stat-chip.chip-present  { background: rgba(34,197,94,0.12);  border-color: rgba(34,197,94,0.3);  color: #166534; }
.att-stat-chip.chip-online   { background: rgba(245,158,11,0.12); border-color: rgba(245,158,11,0.3); color: #92400e; }
.att-stat-chip.chip-absent   { background: rgba(239,68,68,0.12);  border-color: rgba(239,68,68,0.3);  color: #7f1d1d; }
.att-stat-chip.chip-pending  { background: var(--bg-secondary);   color: var(--text-tertiary); }

.att-upload-zone {
  border: 2px dashed var(--border-color, rgba(0,0,0,0.15));
  border-radius: 14px;
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s;
}

.att-upload-zone:hover,
.att-upload-zone.drag-over { border-color: #8b5cf6; }

.att-upload-icon {
  font-size: 40px;
  margin-bottom: 12px;
}

.att-projector-filter-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
}

.att-filter-btn {
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  font-size: 13px;
  cursor: pointer;
  background: transparent;
  color: var(--text-secondary);
  transition: all 0.15s;
}

.att-filter-btn.active { background: #8b5cf6; border-color: #8b5cf6; color: #fff; }

@media (max-width: 600px) {
  .att-btn { padding: 5px 8px; font-size: 12px; }
  .att-person-name { font-size: 14px; }
}
.att-intent-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  background: rgba(139, 92, 246, 0.10);
  border: 1px solid rgba(139, 92, 246, 0.25);
  color: #6d28d9;
  white-space: nowrap;
  flex-shrink: 0;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 600px) {
  .att-intent-badge {
    max-width: 110px;
    font-size: 11px;
  }
}

/* =====================================================================
   CONTROL DE ASISTENCIA — MÓVIL Y MODO NOCHE
   ===================================================================== */

/* ── Móvil: layout en columna ─────────────────────────────────────────── */
@media (max-width: 640px) {
  .att-person-card {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px 14px;
  }

  /* El bloque de info ocupa todo el ancho */
  .att-person-card > div:first-child {
    min-width: 0;
  }

  .att-person-name {
    font-size: 15px;
    white-space: normal;       /* permite wrap en nombres largos */
    overflow: visible;
    text-overflow: unset;
  }

  /* Los botones ocupan todo el ancho, distribuidos equitativamente */
  .att-btn-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    width: 100%;
  }

  .att-btn {
    padding: 8px 4px;
    font-size: 13px;
    text-align: center;
    width: 100%;
  }

  /* Badge de intención: ancho completo en móvil */
  .att-intent-badge {
    max-width: 100%;
    text-align: center;
  }

  /* Chips de estadísticas: más compactos */
  .att-stat-chip {
    font-size: 12px;
    padding: 3px 8px;
  }
}

/* ── Modo noche — variables de asistencia ─────────────────────────────── */
@media (prefers-color-scheme: dark) {

  /* Colores de fondo de cards */
  .att-person-card {
    border-color: rgba(255, 255, 255, 0.10);
    background: rgba(255, 255, 255, 0.03);
  }

  .att-person-card.status-present { background: rgba(34, 197, 94, 0.15); }
  .att-person-card.status-online  { background: rgba(245, 158, 11, 0.15); }
  .att-person-card.status-absent  { background: rgba(239, 68, 68, 0.15); }

  /* Nombre y hora */
  .att-person-name  { color: #f5f5f5; }
  .att-person-time  { color: #a3a3a3; }

  /* Botones inactivos */
  .att-btn {
    background: rgba(255, 255, 255, 0.07);
    color: #d4d4d4;
    border-color: rgba(255, 255, 255, 0.12);
  }

  /* Botones activos — colores claros para fondo oscuro */
  .att-btn.active-present {
    background: rgba(34, 197, 94, 0.25);
    border-color: rgba(34, 197, 94, 0.60);
    color: #86efac;
  }

  .att-btn.active-online {
    background: rgba(245, 158, 11, 0.25);
    border-color: rgba(245, 158, 11, 0.60);
    color: #fcd34d;
  }

  .att-btn.active-absent {
    background: rgba(239, 68, 68, 0.25);
    border-color: rgba(239, 68, 68, 0.60);
    color: #fca5a5;
  }

  /* Chips de estadísticas */
  .att-stat-chip.chip-present {
    background: rgba(34, 197, 94, 0.18);
    border-color: rgba(34, 197, 94, 0.40);
    color: #86efac;
  }

  .att-stat-chip.chip-online {
    background: rgba(245, 158, 11, 0.18);
    border-color: rgba(245, 158, 11, 0.40);
    color: #fcd34d;
  }

  .att-stat-chip.chip-absent {
    background: rgba(239, 68, 68, 0.18);
    border-color: rgba(239, 68, 68, 0.40);
    color: #fca5a5;
  }

  .att-stat-chip.chip-pending {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.12);
    color: #a3a3a3;
  }

  /* Badge de intención de voto */
  .att-intent-badge {
    background: rgba(167, 139, 250, 0.18);
    border-color: rgba(167, 139, 250, 0.35);
    color: #c4b5fd;
  }

  /* Zona de subida */
  .att-upload-zone {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.03);
  }

  .att-upload-zone:hover,
  .att-upload-zone.drag-over {
    border-color: #a78bfa;
    background: rgba(167, 139, 250, 0.08);
  }

  /* Filtros del proyector */
  .att-filter-btn {
    border-color: rgba(255, 255, 255, 0.15);
    color: #d4d4d4;
    background: rgba(255, 255, 255, 0.05);
  }

  .att-filter-btn.active {
    background: #7c3aed;
    border-color: #7c3aed;
    color: #fff;
  }

  /* Badge de estado en proyector */
  .att-status-label {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #d4d4d4 !important;
  }

  /* Quórum badge */
  #attendanceQuorumBadge {
    background: rgba(255, 255, 255, 0.06);
    color: #a3a3a3;
    border-color: rgba(255, 255, 255, 0.10);
  }
}
