/* ═══════════════════════════════════════════════════════════════════════
   termometros.css  —  Galería de Termómetros Financieros
   Paleta y tipografía coherentes con artefenix.web.app
   ═══════════════════════════════════════════════════════════════════════ */

/* ─── VARIABLES ─────────────────────────────────────────────────────── */
:root {
  --negro:          #1a1a1a;
  --negro-suave:    #2a2a2a;
  --negro-card:     #f5f0e8;
  --fondo-dorado:   #ffffff;
  --dorado:         #8a6a18;
  --dorado-claro:   #a8832a;
  --dorado-suave:   #C9A227;
  --dorado-hover:   #C9A227;
  --blanco:         #1a1a1a;
  --blanco-puro:    #000000;
  --gris:           #6a6a70;
  --gris-claro:     #4a4a50;
  --error:          #c0392b;
  --exito:          #27ae60;
  --borde:          rgba(139,105,20,.2);
  --borde-hover:    rgba(139,105,20,.5);
  --sombra-dorada:  0 4px 24px rgba(139,105,20,.06);
  --sombra-hover:   0 8px 36px rgba(139,105,20,.12);
}
html[data-theme="dark"] {
  --negro:          #0a0a0b;
  --negro-suave:    #111113;
  --negro-card:     #16161a;
  --fondo-dorado:   #120e00;
  --dorado:         #c9973a;
  --dorado-claro:   #e8b84b;
  --dorado-suave:   #f0d080;
  --dorado-hover:   #f5c84a;
  --blanco:         #f5f3ee;
  --blanco-puro:    #ffffff;
  --gris:           #9a9a9f;
  --gris-claro:     #d0d0d8;
  --error:          #e05c5c;
  --exito:          #5cb85c;
  --borde:          rgba(201,151,58,.20);
  --borde-hover:    rgba(201,151,58,.50);
  --sombra-dorada:  0 4px 24px rgba(201,151,58,.15);
  --sombra-hover:   0 8px 36px rgba(201,151,58,.28);
}
html[data-theme="dark"] .nav { background: rgba(10,10,11,.92); }
html[data-theme="dark"] .campo-input,
html[data-theme="dark"] .campo-textarea { background: rgba(255,255,255,.05); color: #f5f3ee; }
html[data-theme="dark"] .dropzone { background: rgba(255,255,255,.02); }
html[data-theme="dark"] .progreso-barra-fondo { background: rgba(255,255,255,.08); }

/* ─── RESET Y BASE ──────────────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--fondo-dorado);
  color: var(--blanco);
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 18px;
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: 'Cinzel', serif;
  letter-spacing: 0.05em;
}

a { color: var(--dorado-claro); text-decoration: none; }
a:hover { color: var(--dorado-suave); }

.hidden { display: none !important; }

/* ─── NAVEGACIÓN ────────────────────────────────────────────────────── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.85rem 2rem;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px);
  border-bottom: 0.5px solid var(--borde);
}

.nav-logo {
  display: flex; align-items: center; gap: 0.65rem;
  text-decoration: none;
}
.nav-logo img {
  width: 36px; height: 36px; border-radius: 8px;
  object-fit: cover;
}
.nav-logo span {
  font-family: 'Cinzel', serif;
  font-size: 0.95rem;
  color: var(--dorado);
  letter-spacing: 0.1em;
}

.nav-acciones {
  display: flex; align-items: center; gap: 1rem;
}
.nav-email {
  font-size: 0.85rem;
  color: var(--gris-claro);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.btn-nav {
  background: transparent;
  border: 1px solid var(--borde);
  color: var(--dorado);
  font-family: 'Cinzel', serif;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  padding: 0.4rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.btn-nav:hover {
  border-color: var(--borde-hover);
  color: var(--dorado-claro);
}

/* ─── HERO ──────────────────────────────────────────────────────────── */
.hero {
  padding: 8rem 2rem 4rem;
  text-align: center;
  background: linear-gradient(180deg, rgba(201,162,39,0) 0%, rgba(201,162,39,0.04) 100%);
  border-bottom: 0.5px solid var(--borde);
}
.hero-libro {
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  letter-spacing: 0.25em;
  color: var(--dorado);
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.hero-titulo {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  color: var(--dorado-claro);
  margin-bottom: 1.2rem;
}
.hero-subtitulo {
  font-size: 1.15rem;
  color: var(--gris-claro);
  max-width: 580px;
  margin: 0 auto;
  line-height: 1.8;
}

/* ─── CONTENEDOR PRINCIPAL ──────────────────────────────────────────── */
.contenedor-principal {
  max-width: 900px;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

/* ─── SECCIÓN DE ACCIÓN (bienvenida / subida) ───────────────────────── */
.seccion-accion {
  animation: fadeIn 0.5s ease;
}

.tarjeta-accion {
  background: var(--negro-card);
  border: 1px solid var(--borde);
  border-radius: 16px;
  padding: 2.5rem 2rem;
  box-shadow: var(--sombra-dorada);
}

.seccion-titulo {
  font-size: 1.5rem;
  color: var(--dorado-claro);
  margin-bottom: 0.75rem;
}

.seccion-texto {
  color: var(--gris-claro);
  font-size: 1rem;
  margin-bottom: 1.75rem;
  line-height: 1.8;
}

/* ─── FORMULARIOS ───────────────────────────────────────────────────── */
.campo-grupo {
  margin-bottom: 1.5rem;
}

.campo-label {
  display: block;
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  color: var(--dorado);
  margin-bottom: 0.5rem;
}
.campo-hint {
  font-family: 'Crimson Pro', serif;
  font-weight: 300;
  font-size: 0.85rem;
  color: var(--gris);
  letter-spacing: 0;
}

.campo-input {
  width: 100%;
  background: rgba(0,0,0,0.03);
  border: 1px solid var(--borde);
  border-radius: 8px;
  color: var(--blanco);
  font-family: 'Crimson Pro', serif;
  font-size: 1rem;
  padding: 0.75rem 1rem;
  transition: border-color 0.2s;
  outline: none;
}
.campo-input:focus { border-color: var(--dorado); }
.campo-input::placeholder { color: var(--gris); }

.campo-textarea {
  width: 100%;
  background: rgba(0,0,0,0.03);
  border: 1px solid var(--borde);
  border-radius: 8px;
  color: var(--blanco);
  font-family: 'Crimson Pro', serif;
  font-size: 1rem;
  padding: 0.75rem 1rem;
  resize: vertical;
  min-height: 130px;
  transition: border-color 0.2s;
  outline: none;
}
.campo-textarea:focus { border-color: var(--dorado); }
.campo-textarea::placeholder { color: var(--gris); }

.contador-chars {
  text-align: right;
  font-size: 0.85rem;
  color: var(--gris);
  margin-top: 0.35rem;
}

/* Checkbox de autorización */
.campo-checkbox {
  margin-bottom: 1.5rem;
}
.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  cursor: pointer;
}
.checkbox-label input[type="checkbox"] {
  flex-shrink: 0;
  margin-top: 0.25rem;
  width: 18px; height: 18px;
  accent-color: var(--dorado);
  cursor: pointer;
}
.checkbox-texto {
  font-size: 0.92rem;
  color: var(--gris-claro);
  line-height: 1.6;
}

/* ─── DROPZONE (subida de foto) ─────────────────────────────────────── */
.dropzone {
  border: 2px dashed var(--borde);
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.02);
}
.dropzone:hover {
  border-color: var(--dorado);
  background: rgba(201, 151, 58, 0.06);
}
#dropzone-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  color: var(--gris);
}
#dropzone-placeholder svg {
  width: 48px; height: 48px;
  color: var(--dorado);
  opacity: 0.6;
}
#dropzone-placeholder span { font-size: 0.95rem; }

#previsualizacion-foto {
  max-width: 100%;
  max-height: 300px;
  border-radius: 8px;
  object-fit: contain;
}

/* ─── BARRA DE PROGRESO ─────────────────────────────────────────────── */
#bloque-progreso {
  margin-bottom: 1.5rem;
}
.progreso-barra-fondo {
  background: rgba(0,0,0,0.1);
  border-radius: 8px;
  height: 10px;
  overflow: hidden;
}
.progreso-barra {
  height: 100%;
  background: linear-gradient(90deg, var(--dorado), var(--dorado-claro));
  border-radius: 8px;
  transition: width 0.3s ease;
}
.progreso-texto {
  text-align: center;
  font-size: 0.9rem;
  color: var(--gris-claro);
  margin-top: 0.5rem;
}

/* ─── BOTONES ───────────────────────────────────────────────────────── */
.btn-principal {
  display: inline-block;
  width: 100%;
  background: linear-gradient(135deg, var(--dorado), var(--dorado-claro));
  color: var(--negro);
  font-family: 'Cinzel', serif;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.9rem 2rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 2px 12px rgba(201, 151, 58, 0.3);
}
.btn-principal:hover:not(:disabled) {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(201, 151, 58, 0.4);
}
.btn-principal:active:not(:disabled) { transform: translateY(0); }
.btn-principal:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
}

/* ─── MENSAJES ──────────────────────────────────────────────────────── */
.mensaje-error {
  background: rgba(224, 92, 92, 0.12);
  border: 1px solid rgba(224, 92, 92, 0.35);
  color: #f08080;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  margin-bottom: 1rem;
}
.mensaje-exito {
  background: rgba(92, 184, 92, 0.12);
  border: 1px solid rgba(92, 184, 92, 0.35);
  color: #80d080;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  margin-top: 1rem;
}

/* ─── GALERÍA ───────────────────────────────────────────────────────── */
.seccion-galeria { }

.galeria-cabecera {
  margin-bottom: 2rem;
  text-align: center;
}

.galeria-estado {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--gris);
}
.galeria-vacia-texto {
  font-size: 1.05rem;
  font-style: italic;
}

.galeria-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
}

/* ─── TARJETA TERMÓMETRO ────────────────────────────────────────────── */
.tarjeta-termometro {
  background: var(--blanco-puro);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--sombra-dorada);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  animation: fadeIn 0.5s ease;
  display: flex;
  flex-direction: column;
}
.tarjeta-termometro:hover {
  transform: translateY(-4px);
  box-shadow: var(--sombra-hover);
}

.tarjeta-foto-wrap {
  background: #f8f8f6;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  overflow: hidden;
}
.tarjeta-foto {
  width: 100%;
  max-height: 340px;
  object-fit: contain;
  display: block;
}

/* ─── VOTACIÓN ──────────────────────────────────────────────────────── */
.tarjeta-votacion {
  padding: 1.1rem 1.2rem 0.6rem;
  border-bottom: 1px solid #f0ede5;
}

.votos-etiqueta {
  font-family: 'Cinzel', serif;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: #9a8a6a;
  margin-bottom: 0.6rem;
}

.votos-botones {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.voto-btn {
  flex: 1;
  min-width: 26px;
  height: 32px;
  background: #f5f2ea;
  border: 1.5px solid #e0d8c0;
  border-radius: 6px;
  font-family: 'Cinzel', serif;
  font-size: 0.8rem;
  font-weight: 700;
  color: #7a6a40;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
}
.voto-btn:hover:not(:disabled) {
  background: var(--dorado-claro);
  border-color: var(--dorado);
  color: var(--negro);
  transform: scale(1.08);
}
.voto-btn.seleccionado {
  background: var(--dorado);
  border-color: var(--dorado);
  color: var(--negro);
}
.voto-btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.votos-total {
  margin-top: 0.7rem;
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}
.votos-total-numero {
  font-family: 'Cinzel', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--dorado);
}
.votos-total-etiqueta {
  font-size: 0.82rem;
  color: #9a8a6a;
}

/* Tooltip */
.votos-botones[title]:hover::after {
  content: attr(title);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10,10,11,0.92);
  color: #f5f3ee;
  font-size: 0.78rem;
  padding: 0.35rem 0.7rem;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 10;
}
.votos-botones { position: relative; }

/* ─── EXPLICACIÓN ───────────────────────────────────────────────────── */
.tarjeta-explicacion {
  padding: 1rem 1.2rem 1.4rem;
  flex: 1;
}
.tarjeta-explicacion p {
  font-size: 0.95rem;
  color: #3a3020;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}
.tarjeta-sin-explicacion {
  color: #b0a080 !important;
  font-style: italic;
}

/* ─── SPINNER ───────────────────────────────────────────────────────── */
.spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--borde);
  border-top-color: var(--dorado);
  border-radius: 50%;
  margin: 0 auto 1rem;
  animation: girar 0.8s linear infinite;
}

/* ─── FOOTER ────────────────────────────────────────────────────────── */
.footer {
  text-align: center;
  padding: 2rem 1rem;
  border-top: 0.5px solid var(--borde);
  color: var(--gris);
  font-size: 0.9rem;
}
.footer-link {
  color: var(--dorado);
}
.footer-link:hover { color: var(--dorado-claro); }

/* ─── ANIMACIONES ───────────────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes girar {
  to { transform: rotate(360deg); }
}

/* ─── RESPONSIVE ────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .nav { padding: 0.75rem 1rem; }
  .hero { padding: 7rem 1.2rem 3rem; }
  .hero-titulo { font-size: 2rem; }
  .hero-subtitulo { font-size: 1rem; }
  .contenedor-principal { padding: 2rem 1rem 4rem; gap: 2rem; }
  .tarjeta-accion { padding: 1.75rem 1.25rem; }
  .galeria-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .voto-btn { min-width: 22px; height: 30px; font-size: 0.72rem; }
  .nav-email { display: none; }
}
