/* Votaciones Olocau · estilos
   Sistema visual moderno, compacto, con acento verde institucional
   (mismo verde que el lado público de la web). */

:root {
  --olocau: #0f7a3a;
  --olocau-600: #0c6531;
  --olocau-100: #e6f5ec;
  --ink: #1b1f23;
  --muted: #6b7280;
  --bg: #f5f6f8;
  --surface: #ffffff;
  --border: #e6e8ec;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(16,24,40,.04), 0 1px 3px rgba(16,24,40,.06);
  --shadow-md: 0 6px 16px rgba(16,24,40,.08);
  --shadow-lg: 0 18px 40px rgba(16,24,40,.12);
}

html, body { height: 100%; }
body {
  min-height: 100vh;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
body:has(.bottom-nav) { padding-bottom: 72px; }
@media (min-width: 992px) { body:has(.bottom-nav) { padding-bottom: 0; } }

/* ---------- Navbar ---------- */
.navbar.app-nav {
  background: var(--surface) !important;
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: .6rem 0;
}
.navbar.app-nav .navbar-brand { color: var(--ink); font-weight: 600; letter-spacing: -.01em; }
.navbar.app-nav .navbar-brand span { color: var(--olocau); }
.navbar.app-nav .nav-link {
  color: #4b5563 !important; padding: .45rem .8rem; border-radius: 999px;
  font-weight: 500; font-size: .92rem; display: inline-flex; align-items: center; gap: .4rem;
}
.navbar.app-nav .nav-link:hover { background: #f1f2f5; color: var(--ink) !important; }
.navbar.app-nav .nav-link.active { background: var(--olocau-100); color: var(--olocau) !important; }
.navbar.app-nav .user-chip {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .3rem .7rem .3rem .35rem; background: #f1f2f5; border-radius: 999px; font-size: .88rem;
}
.navbar.app-nav .user-chip .avatar {
  width: 28px; height: 28px; border-radius: 50%; background: var(--olocau);
  color: #fff; font-weight: 600; font-size: .78rem;
  display: inline-flex; align-items: center; justify-content: center;
}
.navbar.app-nav .btn-logout {
  border-radius: 999px; padding: .35rem .8rem; color: var(--muted);
  border: 1px solid var(--border); background: #fff;
}
.navbar.app-nav .btn-logout:hover { color: var(--olocau); border-color: var(--olocau); }

/* ---------- Bottom nav (móvil) ---------- */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030;
  background: rgba(255,255,255,.95); backdrop-filter: saturate(1.2) blur(8px);
  border-top: 1px solid var(--border); display: flex; justify-content: space-around;
  padding: .35rem .25rem calc(.35rem + env(safe-area-inset-bottom));
}
.bottom-nav a {
  flex: 1; text-align: center; text-decoration: none; color: var(--muted);
  font-size: .7rem; font-weight: 500; padding: .35rem .2rem; border-radius: 10px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.bottom-nav a .bi { font-size: 1.25rem; }
.bottom-nav a.active { color: var(--olocau); }
@media (min-width: 992px) { .bottom-nav { display: none; } }

/* ---------- Login / register card ---------- */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 1.5rem 1rem;
  background:
    radial-gradient(1200px 600px at 10% -10%, #e6f5ec 0%, transparent 60%),
    radial-gradient(900px 500px at 100% 110%, #e0f2ff 0%, transparent 60%),
    var(--bg);
}
.login-card {
  width: 100%; max-width: 400px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 20px;
  box-shadow: var(--shadow-lg); padding: 2rem 1.75rem 1.5rem;
}
.login-card .brand { text-align: center; margin-bottom: 1.25rem; }
.login-card .brand img { height: 72px; filter: drop-shadow(0 6px 16px rgba(15,122,58,.18)); }
.login-card .brand h1 { font-size: 1.15rem; font-weight: 600; margin: .75rem 0 .15rem; letter-spacing: -.01em; }
.login-card .brand p { color: var(--muted); font-size: .85rem; margin: 0; }
.login-card .form-label {
  font-size: .8rem; font-weight: 500; color: var(--muted);
  text-transform: uppercase; letter-spacing: .04em; margin-bottom: .3rem;
}
.login-card .input-wrap { position: relative; }
.login-card .input-wrap .bi { position: absolute; left: .9rem; top: 50%; transform: translateY(-50%); color: #9aa0a6; }
.login-card .input-wrap .form-control { padding-left: 2.4rem; height: 46px; border-radius: 12px; border-color: var(--border); background: #fafbfc; }
.login-card .input-wrap .form-control:focus { background: #fff; border-color: var(--olocau); box-shadow: 0 0 0 4px rgba(15,122,58,.12); }

.btn-olocau {
  background: var(--olocau); color: #fff; border: 0; border-radius: 12px;
  height: 46px; font-weight: 600; letter-spacing: .01em;
  transition: background .15s ease, transform .1s ease;
}
.btn-olocau:hover { background: var(--olocau-600); color: #fff; }
.btn-olocau:active { transform: translateY(1px); }
.btn-pill { border-radius: 999px; padding: .35rem .85rem; font-weight: 500; font-size: .85rem; }
.btn-ghost {
  background: var(--surface); border: 1px solid var(--border); color: var(--muted);
  border-radius: 10px; padding: .45rem .75rem; display: inline-flex; align-items: center; gap: .4rem;
}
.btn-ghost:hover { color: var(--olocau); border-color: var(--olocau); }

.login-links { display: flex; justify-content: space-between; margin-top: 1rem; font-size: .82rem; flex-wrap: wrap; gap: .5rem; }
.login-links--center { justify-content: center; }
.login-links a { color: var(--muted); text-decoration: none; }
.login-links a:hover { color: var(--olocau); }

/* Badge destacado «Darme de alta» bajo el botón Acceder */
.signup-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-top: 1.1rem;
  padding: .7rem .95rem;
  background: var(--olocau-100);
  border: 1px solid rgba(15,122,58,.22);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: background .15s ease, border-color .15s ease, transform .1s ease;
}
.signup-badge:hover { background: #d8efe0; border-color: rgba(15,122,58,.4); }
.signup-badge:active { transform: translateY(1px); }
.signup-badge__q { color: var(--olocau-600); font-size: .85rem; font-weight: 500; }
.signup-badge__cta {
  color: #fff;
  background: var(--olocau);
  padding: .32rem .7rem;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 600;
  white-space: nowrap;
}
.signup-badge:hover .signup-badge__cta { background: var(--olocau-600); }

/* ---------- Page header ---------- */
.page-header { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1.1rem; flex-wrap: wrap; }
.page-header h1 { font-size: 1.25rem; font-weight: 600; margin: 0; letter-spacing: -.01em; display: inline-flex; align-items: center; gap: .55rem; }
.page-header h1 .bi { width: 36px; height: 36px; border-radius: 10px; background: var(--olocau-100); color: var(--olocau); display: inline-flex; align-items: center; justify-content: center; font-size: 1rem; }

/* ---------- Cards genéricas ---------- */
.card { border-radius: var(--radius); border-color: var(--border); box-shadow: var(--shadow-sm); }
.btn { border-radius: 10px; }
.form-control, .form-select { border-radius: 10px; }

/* ---------- Tarjeta de votación (listado) ---------- */
.vote-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 768px) { .vote-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }

.vote-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); overflow: hidden; display: flex; flex-direction: column;
  transition: transform .18s ease, box-shadow .18s ease;
}
.vote-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.vote-card .vc-cover { height: 128px; background: linear-gradient(135deg, var(--olocau) 0%, #34a765 100%); position: relative; }
.vote-card .vc-cover img { width: 100%; height: 100%; object-fit: cover; }
.vote-card .vc-body { padding: 1rem 1.1rem 1.1rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.vote-card .vc-title { font-weight: 600; font-size: 1.05rem; margin: 0; letter-spacing: -.01em; }
.vote-card .vc-desc { font-size: .85rem; color: var(--muted); margin: 0; line-height: 1.4; }
.vote-card .vc-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding-top: .4rem; }

/* Chips de estado */
.chip { display: inline-flex; align-items: center; gap: .3rem; padding: .22rem .6rem; border-radius: 999px; font-size: .74rem; font-weight: 600; letter-spacing: .02em; background: #eef0f3; color: #475569; }
.chip--open   { background: #e6f5ec; color: #0f7a3a; }
.chip--soon   { background: #e6effd; color: #1a5fd0; }
.chip--closed { background: #f1f2f5; color: #6b7280; }
.chip--voted  { background: #fff4e0; color: #b7791f; }

/* ---------- Papeleta (opciones) ---------- */
.option-card {
  display: block; background: var(--surface); border: 2px solid var(--border);
  border-radius: var(--radius); padding: 1rem 1.1rem; cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
  position: relative;
}
.option-card:hover { border-color: #cfd4da; }
.option-card .oc-head { display: flex; align-items: flex-start; gap: .75rem; }
.option-card .oc-check {
  flex: 0 0 24px; width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid #cfd4da; display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: .8rem; margin-top: 2px; transition: all .15s ease;
}
.option-card input { position: absolute; opacity: 0; pointer-events: none; }
.option-card input:checked ~ .oc-head .oc-check { background: var(--olocau); border-color: var(--olocau); }
.option-card:has(input:checked) { border-color: var(--olocau); box-shadow: 0 0 0 4px rgba(15,122,58,.10); background: #fbfefc; }
.option-card .oc-title { font-weight: 600; font-size: 1rem; margin: 0; }
.option-card .oc-thumb { width: 100%; max-height: 200px; object-fit: cover; border-radius: 10px; margin-top: .75rem; }
.option-card .oc-desc { font-size: .88rem; color: #374151; margin: .6rem 0 0; line-height: 1.5; }
.option-card .oc-pdfs { margin-top: .7rem; display: flex; flex-wrap: wrap; gap: .4rem; }
.option-card .oc-pdf {
  display: inline-flex; align-items: center; gap: .35rem; font-size: .8rem;
  background: #fef2f2; color: #b91c1c; padding: .3rem .6rem; border-radius: 8px; text-decoration: none;
}
.option-card .oc-pdf:hover { background: #fee2e2; }

/* ---------- Countdown ---------- */
.countdown { display: inline-flex; flex-direction: column; padding: .4rem .7rem; background: #fff4e0; border: 1px solid #f5d9a8; border-radius: 10px; color: #b7791f; }
.countdown .cd-label { font-size: .68rem; text-transform: uppercase; letter-spacing: .04em; }
.countdown .cd-value { font-size: 1.05rem; font-weight: 700; line-height: 1.1; }
.countdown.cd-done { background: #f1f2f5; border-color: #e6e8ec; color: #6b7280; }

/* ---------- KPI / stat ---------- */
.stat-grid { display: grid; gap: .85rem; grid-template-columns: repeat(2, minmax(0,1fr)); }
@media (min-width: 768px) { .stat-grid { grid-template-columns: repeat(4, minmax(0,1fr)); } }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow-sm); display: flex; align-items: center; gap: .8rem; }
.stat .stat-icon { width: 42px; height: 42px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.25rem; background: var(--olocau-100); color: var(--olocau); }
.stat .stat-value { font-size: 1.4rem; font-weight: 700; letter-spacing: -.02em; line-height: 1; }
.stat .stat-label { font-size: .78rem; color: var(--muted); margin-top: .15rem; }

/* ---------- Empty state ---------- */
.empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty-state .bi { font-size: 2.4rem; opacity: .4; display: block; margin-bottom: .5rem; }
.empty-state p { margin: 0; font-size: .92rem; }

/* ---------- Ajustes móvil ---------- */
@media (max-width: 575.98px) {
  main.container { padding: 1rem .85rem; }
  .page-header h1 { font-size: 1.05rem; }
  .login-card { padding: 1.4rem 1.15rem 1.15rem; border-radius: 16px; }
  .vote-card .vc-cover { height: 108px; }
}
