/* =========================================================
   GREKAD MET - Votaciones
   Hoja de estilos principal
   ========================================================= */

/* ----- Reset corto ----- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
img { max-width: 100%; display: block; }

/* ----- Base ----- */
:root{
  --bg: #0f172a;          /* azul muy oscuro */
  --card: #ffffff;        /* cartas blancas */
  --text: #0b1220;        /* texto principal oscuro */
  --muted: #6b7280;       /* gris */
  --accent: #1676ff;      /* azul vivo */
  --accent-2: #0ea5e9;    /* celeste */
  --border: #e5e7eb;
  --success: #16a34a;
  --danger: #b11f2b;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(2, 8, 23, .2);
}

body{
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Inter, sans-serif;
  color: var(--text);
  background: radial-gradient(1200px 700px at 50% -200px, #16223d 0, var(--bg) 60%, var(--bg) 100%);
  line-height: 1.35;
}

/* ----- Helpers ----- */
.container{ max-width:1080px; margin:28px auto; padding:0 18px; }
.container.narrow{ max-width:760px; }
.center{ text-align:center; }
.logo{ height:68px; margin:0 auto 10px; }

h1,h2,h3{ margin:0 0 14px; line-height:1.15; }
h1{ font-size: clamp(22px, 3.4vw, 34px); }
h2{ font-size: clamp(18px, 2.6vw, 28px); }
.muted{ color:var(--muted); }

.badge{
  display:inline-block;
  border:1px solid var(--danger);
  color:#fda4af;
  padding:6px 10px;
  border-radius:10px;
  background:#fff;
}

a{ color:var(--accent); text-decoration:none; }
a.back{ display:inline-block; margin-bottom:10px; }

/* ----- Card ----- */
.card{
  background:var(--card);
  border-radius:var(--radius);
  padding:clamp(16px, 2.3vw, 28px);
  box-shadow:var(--shadow);
}

/* ----- Botones y formularios ----- */
.btn{
  background:var(--accent);
  color:#fff;
  border:none;
  padding:10px 16px;
  border-radius:10px;
  cursor:pointer;
  font-weight:600;
  transition:.15s ease;
}
.btn:hover{ filter:brightness(1.05); }

.form-row{ display:flex; gap:10px; align-items:center; }
input[type="text"],input[type="password"],input[type="number"]{
  width:100%; max-width:340px;
  padding:10px 12px;
  border:1px solid var(--border);
  border-radius:10px;
  outline:none;
}

/* =========================================================
   Grilla de candidatos
   Escritorio: 3 por fila / Teléfono: 2 por fila
   ========================================================= */
.grid-cand{
  display:grid;
  gap:22px;
  grid-template-columns:repeat(3, minmax(220px, 1fr));
}
@media (max-width:1024px){
  .grid-cand{ grid-template-columns:repeat(3, minmax(200px, 1fr)); }
}
@media (max-width:768px){
  .grid-cand{ grid-template-columns:repeat(2, minmax(0, 1fr)); }
}
@media (max-width:380px){
  .grid-cand{ grid-template-columns:repeat(2, 1fr); }
}

/* Tarjeta de candidato */
.card-cand{
  background:#fff;
  border:1px solid var(--border);
  border-radius:14px;
  padding:14px;
  text-align:center;
  box-shadow:0 6px 16px rgba(2, 8, 23, .06);
}
.card-cand img{
  width:100%;
  height:280px;
  object-fit:cover;
  border-radius:10px;
  background:#f3f4f6;
  margin-bottom:10px;
}
@media (max-width:768px){
  .card-cand img{ height:220px; }
}

/* =========================================================
   Tabla (admin)
   ========================================================= */
.table-responsive{ width:100%; overflow:auto; }
.table{
  width:100%;
  border-collapse:collapse;
  background:#fff;
  border-radius:12px;
  overflow:hidden;
  box-shadow:0 8px 20px rgba(2, 8, 23, .06);
}
.table th,.table td{
  padding:12px 14px;
  border-bottom:1px solid var(--border);
  text-align:left;
  white-space:nowrap;
}
.table thead th{
  background:#f8fafc;
  font-weight:700;
}
.table tr:last-child td{ border-bottom:none; }

/* Fondos */
.bg-admin{ background: radial-gradient(1200px 700px at 50% -200px, #16223d 0, var(--bg) 60%, var(--bg) 100%); }
.bg-app{   background: radial-gradient(1200px 700px at 50% -200px, #16223d 0, var(--bg) 60%, var(--bg) 100%); }

@media (max-width:520px){
  .container{ margin-top:20px; }
  .card{ padding:14px; }
}
