/* ============================================================
   DTG VOTACIÓN — Diseña Tu Garra
   Identidad visual: Deportes Concepción (elconce.cl)
   Paleta: morado/violeta #5B2585 | amarillo dorado #F5C518
           negro violáceo #0E0A14 | blanco #FFFFFF
   Tipografía: Barlow Condensed (bold/italic) + Barlow
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:ital,wght@0,700;0,800;0,900;1,800&family=Barlow:wght@400;500;600&display=swap');

:root {
  --p:   #5B2585;
  --p2:  #4A1C70;
  --p3:  #3A1558;
  --p4:  #2A0F40;
  --pb:  #7B3BAB;
  --pg:  rgba(91,37,133,.22);
  --y:   #F5C518;
  --yd:  #D4A800;
  --yg:  rgba(245,197,24,.15);
  --n:   #0E0A14;
  --n2:  #180E26;
  --n3:  #221633;
  --gl:  #C0A8E0;
  --gm:  #7B5FAD;
  --w:   #FFFFFF;
  --fd:  'Barlow Condensed', sans-serif;
  --fb:  'Barlow', sans-serif;
  --r:   4px;
  --rl:  10px;
  --tr:  .2s ease;
}

/* ── Contenedor ── */
#dtg-vote-container {
  font-family: var(--fb);
  background:  var(--n);
  color:       var(--w);
  min-height:  500px;
  position:    relative;
  overflow:    hidden;
}

#dtg-vote-container::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none; z-index: 0;
}
#dtg-vote-container > * { position: relative; z-index: 1; }

/* ── HERO ── */
.dtg-hero {
  background: linear-gradient(135deg, var(--p3) 0%, var(--p2) 45%, var(--p4) 100%);
  padding: 36px 40px 64px;
  position: relative; overflow: hidden;
  clip-path: polygon(0 0, 100% 0, 100% 86%, 0 100%);
}
.dtg-hero-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
  background-size: 40px 40px;
}
.dtg-hero-glow {
  position: absolute; right: -80px; top: -80px;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(91,37,133,.5) 0%, transparent 65%);
  pointer-events: none;
}
.dtg-hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--y); color: var(--p4);
  font-family: var(--fd); font-size: 10px; font-weight: 800;
  letter-spacing: .2em; text-transform: uppercase;
  padding: 5px 14px; border-radius: 2px;
  margin-bottom: 14px; position: relative; z-index: 1;
}
.dtg-hero-title {
  font-family: var(--fd); font-size: clamp(48px, 8vw, 76px); font-weight: 900;
  text-transform: uppercase; line-height: .9;
  color: var(--w); position: relative; z-index: 1;
}
.dtg-hero-title em {
  display: block; font-style: italic;
  -webkit-text-stroke: 2px var(--y); color: transparent;
  font-size: clamp(54px, 9vw, 86px);
}
.dtg-hero-sub {
  font-size: 13px; color: rgba(255,255,255,.65);
  max-width: 420px; line-height: 1.55;
  margin-top: 14px; position: relative; z-index: 1;
}
.dtg-hero-accent {
  position: absolute; bottom: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--y) 0%, var(--pb) 50%, transparent 100%);
}

/* ── AUTH ── */
.dtg-auth-section { padding: 48px 40px 40px; }
.dtg-auth-card {
  background: var(--n2); border: 1px solid rgba(255,255,255,.07);
  border-radius: var(--rl); padding: 32px 36px;
  max-width: 460px; margin: 0 auto; position: relative; overflow: hidden;
}
.dtg-auth-card::before {
  content: ''; position: absolute; top: -60px; right: -60px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(91,37,133,.25) 0%, transparent 65%);
  pointer-events: none;
}
.dtg-section-label {
  font-family: var(--fd); font-size: 10px; font-weight: 700;
  letter-spacing: .2em; text-transform: uppercase; color: var(--y);
  display: flex; align-items: center; gap: 6px; margin-bottom: 8px;
}
.dtg-section-label::after {
  content: ''; width: 32px; height: 1px; background: var(--y); opacity: .4;
}
.dtg-auth-heading {
  font-family: var(--fd); font-size: 28px; font-weight: 800;
  text-transform: uppercase; margin-bottom: 4px;
}
.dtg-auth-desc {
  font-size: 13px; color: var(--gl); line-height: 1.5; margin-bottom: 24px;
}
.dtg-field { margin-bottom: 16px; }
.dtg-label {
  display: block; font-family: var(--fd); font-size: 10px; font-weight: 700;
  letter-spacing: .15em; text-transform: uppercase; color: var(--gl); margin-bottom: 6px;
}
.dtg-input {
  width: 100%; background: var(--n3);
  border: 1.5px solid rgba(255,255,255,.08); border-radius: var(--r);
  color: var(--w); font-family: var(--fd); font-size: 24px; font-weight: 700;
  letter-spacing: .04em; padding: 12px 14px; outline: none; transition: var(--tr);
  box-sizing: border-box;
}
.dtg-input:focus { border-color: var(--y); box-shadow: 0 0 0 3px var(--yg); }
.dtg-input::placeholder { color: rgba(255,255,255,.18); }

/* ── BOTÓN PRINCIPAL ── */
.dtg-btn-primary {
  display: block; width: 100%;
  background: var(--y); color: var(--p4);
  border: none; border-radius: var(--r);
  font-family: var(--fd); font-size: 17px; font-weight: 900;
  text-transform: uppercase; letter-spacing: .1em;
  padding: 14px 20px; cursor: pointer; margin-top: 20px;
  transition: var(--tr); position: relative; overflow: hidden;
}
.dtg-btn-primary:hover  { background: var(--yd); }
.dtg-btn-primary:active { transform: scale(.98); }
.dtg-btn-primary:disabled { background: #333; color: #666; cursor: not-allowed; }

/* ── INFO BAR ── */
.dtg-info-bar {
  background: rgba(91,37,133,.15);
  border-left: 3px solid var(--pb);
  padding: 10px 14px; font-size: 12px;
  color: var(--gl); margin-top: 14px;
  border-radius: 0 var(--r) var(--r) 0; line-height: 1.5;
}

/* ── ERRORES ── */
.dtg-error-msg {
  background: rgba(200,16,46,.1); border: 1px solid rgba(200,16,46,.3);
  border-radius: var(--r); color: #FF8096;
  font-size: 13px; padding: 10px 14px; margin-top: 12px; display: none;
}

/* ── GALERÍA ── */
.dtg-gallery-section { padding: 0 40px 48px; }
.dtg-gallery-header {
  padding: 32px 0 22px; border-bottom: 1px solid rgba(255,255,255,.05);
  margin-bottom: 26px; display: flex; align-items: flex-end;
  justify-content: space-between; flex-wrap: wrap; gap: 10px;
}
.dtg-gallery-title {
  font-family: var(--fd); font-size: clamp(30px,5vw,42px); font-weight: 900;
  text-transform: uppercase; margin: 0; line-height: 1;
}
.dtg-gallery-count {
  font-family: var(--fd); font-size: 11px; font-weight: 600;
  color: var(--gl); letter-spacing: .1em; text-transform: uppercase;
}
/* ── GRID: columnas fijas para consistencia visual ── */
.dtg-designs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);  /* 2 columnas siempre iguales */
  gap: 20px;
  align-items: start;                      /* tarjetas no se estiran entre sí */
}

/* ── TARJETA ── */
.dtg-design-card {
  background: var(--n2);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: var(--rl);
  overflow: hidden;
  cursor: pointer;
  transition: border-color var(--tr), transform var(--tr);
  position: relative;
  display: flex;
  flex-direction: column;       /* imagen arriba, body abajo, altura independiente */
}
.dtg-design-card:hover { border-color: rgba(91,37,133,.55); transform: translateY(-3px); }
.dtg-design-card.is-selected {
  border-color: var(--y);
  box-shadow: 0 0 0 1px var(--y), 0 8px 28px var(--yg);
}
.dtg-design-card.is-selected::after {
  content: '✓ SELECCIONADO';
  position: absolute; top: 10px; right: 10px;
  background: var(--y); color: var(--p4);
  font-family: var(--fd); font-size: 9px; font-weight: 900; letter-spacing: .1em;
  padding: 3px 9px; border-radius: 2px; z-index: 2;
}

/* ── CONTENEDOR DE IMAGEN: altura fija, imagen contenida sin recorte ── */
.dtg-card-img-wrap {
  background: var(--n3);
  width: 100%;
  height: 320px;                /* altura fija igual para TODAS las tarjetas */
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

/* object-fit: contain → imagen completa visible, sin recortar */
.dtg-card-img-wrap img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;          /* muestra la imagen COMPLETA, sin recortar */
  object-position: center;
  display: block;
  transition: opacity .35s ease, transform .4s ease;
  padding: 12px;                /* respira un poco si el fondo es oscuro */
  box-sizing: border-box;
}

/* Imagen trasera (hover) */
/* imagen trasera desactivada — solo una imagen por diseño */

/* Hint de zoom — aparece al pasar el cursor */
.dtg-card-zoom-hint {
  position: absolute; bottom: 10px; right: 10px;
  background: rgba(0,0,0,.65); color: rgba(255,255,255,.75);
  font-family: var(--fd); font-size: 9px; letter-spacing: .12em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 2px; white-space: nowrap;
  opacity: 0; transition: opacity .2s; z-index: 3;
  pointer-events: none;
}
.dtg-design-card:hover .dtg-card-zoom-hint { opacity: 1; }

/* Cursor lupa sobre la imagen */
.dtg-card-img-wrap { cursor: zoom-in; }

/* ── BODY DE LA TARJETA ── */
.dtg-card-body {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  flex: 1;                      /* ocupa el espacio restante */
}
.dtg-card-code {
  font-family: var(--fd); font-size: 9px; font-weight: 700;
  letter-spacing: .2em; text-transform: uppercase; color: var(--y); margin-bottom: 4px;
}
.dtg-card-name {
  font-family: var(--fd); font-size: 20px; font-weight: 800;
  text-transform: uppercase; margin-bottom: 8px; line-height: 1.05;
}
.dtg-card-desc {
  font-size: 12px; color: var(--gl); line-height: 1.4;
  margin-bottom: 12px; flex: 1;  /* empuja el botón hacia abajo */
}
.dtg-btn-votar {
  display: block; width: 100%; background: transparent; color: var(--w);
  border: 1.5px solid rgba(255,255,255,.1); border-radius: var(--r);
  font-family: var(--fd); font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .1em;
  padding: 10px; cursor: pointer; transition: var(--tr);
  margin-top: auto;             /* siempre pegado al fondo del body */
}
.dtg-btn-votar:hover,
.dtg-design-card.is-selected .dtg-btn-votar {
  background: var(--p); border-color: var(--p);
}


/* ── LIGHTBOX ── */
.dtg-lightbox-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,.92);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden;
  transition: opacity .25s ease, visibility .25s ease;
  cursor: zoom-out;
}
.dtg-lightbox-overlay.open {
  opacity: 1; visibility: visible;
}
.dtg-lightbox-inner {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex; align-items: center; justify-content: center;
}
.dtg-lightbox-inner img {
  max-width: 90vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(0,0,0,.6);
  display: block;
  /* animación de entrada */
  transform: scale(.92);
  transition: transform .25s ease;
}
.dtg-lightbox-overlay.open .dtg-lightbox-inner img {
  transform: scale(1);
}
.dtg-lightbox-caption {
  position: absolute; bottom: -36px; left: 0; right: 0;
  text-align: center;
  font-family: var(--fd); font-size: 13px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  color: rgba(255,255,255,.6);
}
.dtg-lightbox-close {
  position: absolute; top: -44px; right: 0;
  background: none; border: none;
  color: rgba(255,255,255,.7); font-size: 28px; line-height: 1;
  cursor: pointer; padding: 4px 8px;
  transition: color .15s;
}
.dtg-lightbox-close:hover { color: var(--y); }

/* ── BARRA CONFIRMACIÓN ── */
.dtg-confirm-bar {
  position: sticky; bottom: 0;
  background: var(--n2); border-top: 2px solid var(--y);
  padding: 14px 40px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; z-index: 100;
  opacity: 0; transform: translateY(100%); pointer-events: none;
  transition: opacity .3s, transform .3s;
}
.dtg-confirm-bar.visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.dtg-confirm-bar-label {
  font-family: var(--fd); font-size: 10px; letter-spacing: .15em;
  text-transform: uppercase; color: var(--gl); margin-bottom: 2px;
}
.dtg-confirm-bar-name {
  font-family: var(--fd); font-size: 22px; font-weight: 800; text-transform: uppercase;
}
.dtg-btn-confirm {
  background: var(--y); color: var(--p4); border: none; border-radius: var(--r);
  font-family: var(--fd); font-size: 15px; font-weight: 900;
  text-transform: uppercase; letter-spacing: .08em;
  padding: 13px 28px; cursor: pointer; white-space: nowrap; transition: var(--tr);
}
.dtg-btn-confirm:hover  { background: var(--yd); }
.dtg-btn-confirm:active { transform: scale(.97); }
.dtg-btn-confirm:disabled { background: #333; color: #666; cursor: not-allowed; }
.dtg-btn-cancel {
  background: transparent; color: var(--gl);
  border: 1.5px solid rgba(255,255,255,.1); border-radius: var(--r);
  font-family: var(--fd); font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
  padding: 13px 18px; cursor: pointer; transition: var(--tr);
}
.dtg-btn-cancel:hover { color: var(--w); border-color: rgba(255,255,255,.3); }

/* ── SUCCESS ── */
.dtg-success-state { text-align: center; padding: 80px 40px; }
.dtg-success-icon {
  width: 80px; height: 80px; border-radius: 50%;
  background: linear-gradient(135deg, var(--p), var(--pb));
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 34px; margin-bottom: 20px;
  box-shadow: 0 0 36px var(--pg);
}
.dtg-success-title {
  font-family: var(--fd); font-size: clamp(40px,6vw,60px); font-weight: 900;
  text-transform: uppercase; line-height: .92; margin-bottom: 8px;
}
.dtg-success-title em { font-style: italic; color: var(--y); }
.dtg-success-sub { font-size: 14px; color: var(--gl); margin-bottom: 22px; line-height: 1.5; }
.dtg-success-design {
  display: inline-block; background: var(--n2);
  border: 1px solid var(--y); border-radius: var(--rl);
  padding: 12px 28px; font-family: var(--fd); font-size: 19px;
  font-weight: 700; text-transform: uppercase;
}
.dtg-success-design span { color: var(--y); }

/* ── YA VOTÓ ── */
.dtg-already-state {
  text-align: center; padding: 56px 40px;
  background: var(--n2); border: 1px solid rgba(255,255,255,.06);
  border-radius: var(--rl); margin: 48px 40px;
}
.dtg-already-state h2 {
  font-family: var(--fd); font-size: 32px; font-weight: 800;
  text-transform: uppercase; margin-bottom: 8px;
}
.dtg-already-state p { color: var(--gl); }

/* ── RESULTADOS ── */
.dtg-resultados-wrap {
  font-family: var(--fb); background: var(--n); color: var(--w); padding: 48px 40px;
}
.dtg-resultados-title {
  font-family: var(--fd); font-size: clamp(32px,5vw,52px); font-weight: 900;
  text-transform: uppercase; margin-bottom: 4px; line-height: 1;
}
.dtg-resultados-meta { font-size: 13px; color: var(--gl); margin-bottom: 24px; }
.dtg-rank-item {
  display: grid; grid-template-columns: 40px 1fr auto;
  align-items: center; gap: 14px;
  padding: 16px 0; border-bottom: 1px solid rgba(255,255,255,.05);
}
.dtg-rank-item:first-child { padding-top: 0; }
.dtg-rank-num-badge {
  font-family: var(--fd); font-size: 30px; font-weight: 900; color: var(--gm); line-height: 1;
}
.dtg-rank-item:first-child .dtg-rank-num-badge { color: var(--y); }
.dtg-rank-name {
  font-family: var(--fd); font-size: 22px; font-weight: 800;
  text-transform: uppercase; margin-bottom: 7px; line-height: 1;
}
.dtg-rank-progress {
  height: 5px; background: rgba(255,255,255,.06); border-radius: 3px; overflow: hidden;
}
.dtg-rank-fill {
  height: 5px;
  background: linear-gradient(90deg, var(--p), var(--pb));
  border-radius: 3px; transition: width 1.2s cubic-bezier(.4,0,.2,1);
}
.dtg-rank-item:first-child .dtg-rank-fill {
  background: linear-gradient(90deg, var(--y), var(--p));
}
.dtg-rank-stats { text-align: right; }
.dtg-rank-votos {
  font-family: var(--fd); font-size: 28px; font-weight: 800;
  display: block; line-height: 1;
}
.dtg-rank-pct { font-family: var(--fd); font-size: 13px; color: var(--gl); display: block; }

/* ── AVISO ── */
.dtg-notice {
  background: var(--n2); border-left: 3px solid var(--y);
  padding: 20px 24px; font-family: var(--fd); font-size: 18px;
  font-weight: 600; color: var(--gl);
  border-radius: 0 var(--rl) var(--rl) 0;
}

/* ── LOADING ── */
.dtg-loading {
  text-align: center; padding: 60px 20px;
  color: var(--gl); font-family: var(--fd);
  font-size: 13px; letter-spacing: .15em; text-transform: uppercase;
}
.dtg-spinner {
  width: 40px; height: 40px;
  border: 3px solid rgba(255,255,255,.07);
  border-top: 3px solid var(--y);
  border-radius: 50%; animation: dtg-spin .8s linear infinite; margin: 0 auto 16px;
}
@keyframes dtg-spin { to { transform: rotate(360deg); } }

/* ── ADMIN ── */
.dtg-card { background: #fff; border: 1px solid #ddd; border-radius: 6px; padding: 20px; text-align: center; }
.dtg-card h3 { font-size: 32px; font-weight: 700; margin: 0 0 4px; color: var(--p); }
.dtg-card p  { margin: 0; color: #666; font-size: 13px; }

/* ── RESPONSIVE ── */

/* Tablet/desktop: 3 columnas */
@media (min-width: 900px) {
  .dtg-designs-grid  { grid-template-columns: repeat(3,1fr); gap: 16px; }
  .dtg-card-img-wrap { height: 280px; }
}

/* Desktop grande */
@media (min-width: 1200px) {
  .dtg-card-img-wrap { height: 320px; }
}

/* Mobile: 1 columna */
@media (max-width: 640px) {
  .dtg-hero             { padding: 28px 20px 52px; }
  .dtg-auth-section     { padding: 32px 20px 28px; }
  .dtg-auth-card        { padding: 24px 20px; }
  .dtg-gallery-section  { padding: 0 16px 32px; }
  .dtg-confirm-bar      { padding: 14px 16px; }
  .dtg-designs-grid     { grid-template-columns: 1fr; gap: 14px; }
  .dtg-card-img-wrap    { height: 260px; }
  .dtg-card-img-wrap img{ padding: 8px; }
  .dtg-resultados-wrap  { padding: 32px 20px; }
  .dtg-rank-item        { grid-template-columns: 32px 1fr auto; gap: 10px; }
  .dtg-rank-name        { font-size: 17px; }
  .dtg-rank-votos       { font-size: 22px; }
}

/* ── MODO SIMULACIÓN — v1.3 ─────────────────────────────────────────────── */
.dtg-sim-banner {
  background: #F5A623;
  color: #000;
  font-family: var(--fd);
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .1em;
  text-align: center;
  padding: 10px 20px;
  position: sticky;
  top: 0;
  z-index: 999;
}

/* ── WCAG AA: Focus visible ─────────────────────────────────────────────── */
:focus-visible {
  outline: 3px solid var(--y);
  outline-offset: 2px;
}

/* WCAG AA: contraste mínimo 4.5:1 en textos importantes */
.dtg-card-desc { color: #C0A8E0; } /* ratio ~5.2:1 sobre #180E26 */
.dtg-section-label { color: #F5C518; } /* ratio ~9.1:1 */
.dtg-auth-desc { color: #C0A8E0; }
.dtg-confirm-bar-label { color: #C0A8E0; }

/* Skip link para teclado (WCAG 2.4.1) */
.dtg-skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.dtg-skip-link:focus {
  position: static;
  width: auto;
  height: auto;
  background: var(--y);
  color: var(--p4);
  padding: 8px 16px;
  font-family: var(--fd);
  font-weight: 700;
  text-decoration: none;
}

/* Recaptcha badge override */
.dtg-recaptcha-note a { color: var(--gl); }