/* ── Reset & base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy:    #1e3a5f;
  --navy-dk: #152c47;
  --blue:    #2563eb;
  --blue-lt: #eff6ff;
  --green:   #16a34a;
  --green-lt:#f0fdf4;
  --red:     #dc2626;
  --red-lt:  #fef2f2;
  --amber:   #d97706;
  --amber-lt:#fffbeb;
  --gray-50: #f9fafb;
  --gray-100:#f3f4f6;
  --gray-200:#e5e7eb;
  --gray-400:#9ca3af;
  --gray-600:#4b5563;
  --gray-800:#1f2937;
  --radius:  12px;
  --shadow:  0 4px 24px rgba(0,0,0,.08);
}

html { font-size: 16px; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
  min-height: 100vh;
}

/* ── Header ────────────────────────────────────────────────── */
.header {
  position: sticky; top: 0; z-index: 100;
  background: var(--navy);
  box-shadow: 0 2px 12px rgba(0,0,0,.18);
}
.header-inner {
  max-width: 720px; margin: 0 auto;
  padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  color: #fff; font-weight: 700; font-size: 1.05rem;
}

/* Step indicator */
.step-indicator {
  display: flex; align-items: center; gap: 6px;
}
.step-indicator .step {
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(255,255,255,.18);
  color: rgba(255,255,255,.6);
  font-size: .75rem; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  transition: all .3s;
}
.step-indicator .step.active {
  background: #fff; color: var(--navy);
}
.step-indicator .step.done {
  background: var(--green); color: #fff;
}
.step-indicator .divider {
  width: 20px; height: 2px; background: rgba(255,255,255,.2); border-radius: 2px;
}

/* Progress bar */
.progress-bar {
  height: 3px; background: rgba(255,255,255,.15);
}
.progress-fill {
  height: 100%; background: #60a5fa;
  transition: width .5s ease;
  width: 0%;
}

/* ── Main & cards ──────────────────────────────────────────── */
.main {
  max-width: 720px; margin: 0 auto;
  padding: 40px 20px 60px;
}
.card {
  background: #fff;
  border-radius: var(--radius);
  padding: 40px 36px;
  box-shadow: var(--shadow);
  max-width: 480px;
  margin: 0 auto;
}
.card-wide { max-width: 720px; }
.card-icon { font-size: 2.4rem; margin-bottom: 14px; }
h1 { font-size: 1.5rem; font-weight: 700; color: var(--navy); margin-bottom: 6px; }
.subtitle { color: var(--gray-600); font-size: .95rem; margin-bottom: 28px; line-height: 1.5; }

/* ── Pages ─────────────────────────────────────────────────── */
.page { display: none; }
.page.active { display: block; animation: fadeUp .35s ease both; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Form fields ───────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
label { font-size: .85rem; font-weight: 600; color: var(--gray-600); }
input[type=text], input[type=email], input[type=tel], input[type=password] {
  border: 1.5px solid var(--gray-200);
  border-radius: 8px;
  padding: 11px 14px;
  font-size: .95rem;
  font-family: inherit;
  transition: border-color .2s, box-shadow .2s;
  outline: none;
  width: 100%;
}
input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
input.error { border-color: var(--red); }

/* Password toggle */
.input-icon-wrap { position: relative; }
.input-icon-wrap input { padding-right: 42px; }
.toggle-pw {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; font-size: 1rem; line-height: 1;
}

/* Radio cards */
.radio-group { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.radio-card { cursor: pointer; }
.radio-card input { position: absolute; opacity: 0; pointer-events: none; }
.radio-body {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 16px 12px;
  border: 2px solid var(--gray-200);
  border-radius: 10px;
  font-size: .9rem; font-weight: 500;
  transition: all .2s;
}
.radio-icon { font-size: 1.6rem; }
.radio-card input:checked + .radio-body {
  border-color: var(--blue);
  background: var(--blue-lt);
  color: var(--blue);
}

/* File upload */
.upload-area {
  position: relative;
  border: 2px dashed var(--gray-200);
  border-radius: 10px;
  transition: border-color .2s;
  overflow: hidden;
}
.upload-area:hover { border-color: var(--blue); }
.upload-input {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; z-index: 2;
}
.upload-placeholder {
  padding: 28px 20px; text-align: center;
  pointer-events: none;
}
.upload-icon { font-size: 2rem; }
.upload-placeholder p { margin: 8px 0 4px; font-size: .9rem; font-weight: 500; }
.upload-placeholder small { color: var(--gray-400); font-size: .8rem; }
.upload-preview {
  padding: 14px 16px;
  display: flex; align-items: center; gap: 10px;
  background: var(--green-lt);
  color: var(--green); font-size: .9rem; font-weight: 500;
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 13px 20px;
  border: none; border-radius: 8px;
  font-size: .95rem; font-weight: 600; font-family: inherit;
  cursor: pointer; transition: all .2s; margin-top: 8px;
}
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--navy-dk); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,.15); }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-full { margin-top: 20px; }
.btn-loader {
  width: 18px; height: 18px; border: 2.5px solid rgba(255,255,255,.4);
  border-top-color: #fff; border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Alert messages ─────────────────────────────────────────── */
.alert {
  padding: 13px 16px; border-radius: 8px;
  font-size: .9rem; line-height: 1.5; margin-bottom: 16px;
}
.alert-error { background: var(--red-lt); color: var(--red); border: 1px solid #fecaca; }
.alert-success { background: var(--green-lt); color: var(--green); border: 1px solid #bbf7d0; }
.alert-warn { background: var(--amber-lt); color: var(--amber); border: 1px solid #fde68a; }

/* ── Votação ────────────────────────────────────────────────── */
#votacao-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 20px; gap: 16px;
}
.deliberacao-meta { flex: 1; }
.badge {
  display: inline-block; padding: 3px 10px;
  background: var(--blue-lt); color: var(--blue);
  border-radius: 20px; font-size: .78rem; font-weight: 600;
  margin-bottom: 8px;
}
.deliberacao-titulo {
  display: block; font-size: 1.15rem; font-weight: 700;
  color: var(--navy); line-height: 1.4;
}
.deliberacao-descricao {
  font-size: .9rem; color: var(--gray-600);
  line-height: 1.6; margin-bottom: 24px;
  padding: 14px 16px; background: var(--gray-50);
  border-radius: 8px; border-left: 3px solid var(--blue);
}

/* Timer ring */
.timer-wrap {
  position: relative; width: 64px; height: 64px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.timer-ring { position: absolute; width: 64px; height: 64px; transform: rotate(-90deg); }
.timer-track { fill: none; stroke: var(--gray-100); stroke-width: 4; }
.timer-arc {
  fill: none; stroke: var(--blue); stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 150.8; /* 2π × 24 */
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear, stroke .5s;
}
.timer-arc.urgent { stroke: var(--red); }
.timer-display {
  font-size: .85rem; font-weight: 700; color: var(--navy);
  position: relative; z-index: 1;
}

/* Opções de voto */
.opcoes-grid {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px;
  margin-bottom: 20px;
}
.opcao-btn {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 18px 10px;
  border: 2px solid var(--gray-200); border-radius: 10px;
  background: #fff; cursor: pointer;
  font-size: .85rem; font-weight: 600; font-family: inherit;
  transition: all .2s; text-align: center;
}
.opcao-btn .opcao-icon { font-size: 1.8rem; }
.opcao-btn:hover { border-color: var(--blue); background: var(--blue-lt); }
.opcao-btn.selected { border-color: var(--blue); background: var(--blue-lt); color: var(--blue); }
.opcao-btn.selected-green { border-color: var(--green); background: var(--green-lt); color: var(--green); }
.opcao-btn.selected-red { border-color: var(--red); background: var(--red-lt); color: var(--red); }
.opcao-btn.selected-amber { border-color: var(--amber); background: var(--amber-lt); color: var(--amber); }

/* ── Resultados ─────────────────────────────────────────────── */
.resultados-lista { display: flex; flex-direction: column; gap: 20px; margin: 28px 0; }
.resultado-item { border: 1.5px solid var(--gray-200); border-radius: 10px; padding: 18px 20px; }
.resultado-item-titulo { font-weight: 700; font-size: 1rem; margin-bottom: 12px; color: var(--navy); }
.resultado-barra-wrap { display: flex; flex-direction: column; gap: 8px; }
.resultado-linha { display: flex; align-items: center; gap: 10px; font-size: .88rem; }
.resultado-label { width: 120px; flex-shrink: 0; font-weight: 500; }
.resultado-barra-outer { flex: 1; height: 10px; background: var(--gray-100); border-radius: 20px; overflow: hidden; }
.resultado-barra-inner { height: 100%; border-radius: 20px; transition: width 1s ease; }
.barra-green { background: var(--green); }
.barra-red   { background: var(--red); }
.barra-amber { background: var(--amber); }
.barra-blue  { background: var(--blue); }
.resultado-pct { width: 36px; text-align: right; font-weight: 600; font-size: .85rem; }
.resultado-total { margin-top: 8px; font-size: .8rem; color: var(--gray-400); }
.meu-voto-resumo {
  margin-top: 12px; padding: 10px 14px;
  background: var(--gray-50); border-radius: 8px;
  font-size: .88rem;
}
.resultado-rodape { text-align: center; margin-top: 12px; color: var(--gray-400); font-size: .85rem; }
.protocolo { font-family: monospace; font-size: .9rem; color: var(--gray-600); margin-top: 4px; letter-spacing: .04em; }

/* ── Utilities ──────────────────────────────────────────────── */
.hidden { display: none !important; }

@media (max-width: 540px) {
  .card { padding: 28px 20px; }
  .field-row { grid-template-columns: 1fr; }
  .opcoes-grid { grid-template-columns: 1fr; }
  .header-inner { padding: 12px 16px; }
}

/* ── Abas de deliberação (Página 3) ─────────────────────────── */
.tabs-nav {
  display: flex;
  border-bottom: 2px solid var(--gray-200);
  margin-bottom: 1.5rem;
}
.tab-btn {
  flex: 1;
  padding: .65rem .5rem .55rem;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  font-size: .8rem;
  font-weight: 600;
  color: var(--gray-400);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .1rem;
  transition: color .18s, border-color .18s;
}
.tab-btn:hover { color: var(--navy); }
.tab-btn.active { color: var(--navy); border-bottom-color: var(--navy); }
.tab-btn.voted  { color: var(--green); }
.tab-btn.voted.active { border-bottom-color: var(--green); }
.tab-btn.closed { color: var(--gray-400); opacity: .7; }
.tab-status { font-size: .95rem; min-height: 1em; }

/* Estado: voto confirmado */
.voto-confirmado {
  background: var(--green-lt);
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  padding: 1rem 1.25rem;
  text-align: center;
  color: var(--green);
  font-size: .92rem;
  font-weight: 600;
  margin-bottom: 1rem;
  line-height: 1.6;
}
.voto-confirmado small {
  display: block;
  margin-top: .3rem;
  color: var(--gray-600);
  font-size: .78rem;
  font-weight: 400;
}

/* Estado: sessão encerrada */
.sessao-encerrada {
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  text-align: center;
  color: var(--gray-600);
  font-size: .92rem;
  margin-bottom: 1rem;
}

/* Botão encerrar sessão (Admin) */
.btn-encerrar {
  background: transparent;
  border: 1px solid rgba(255,255,255,.45);
  color: #fff;
  padding: .32rem .75rem;
  border-radius: 6px;
  font-family: inherit;
  font-size: .76rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: .01em;
  transition: background .2s, border-color .2s;
  white-space: nowrap;
}
.btn-encerrar:hover {
  background: rgba(220, 38, 38, .35);
  border-color: #fca5a5;
}

.btn-reabrir {
  background: transparent;
  border: 1px solid rgba(255,255,255,.45);
  color: #fff;
  padding: .32rem .75rem;
  border-radius: 6px;
  font-family: inherit;
  font-size: .76rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: .01em;
  transition: background .2s, border-color .2s;
  white-space: nowrap;
}
.btn-reabrir:hover {
  background: rgba(22, 163, 74, .35);
  border-color: #86efac;
}
