*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
@font-face {
  font-family: "Amecum";
  src: url("fonts/amecum.woff2") format("woff2");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}
:root {
  --ink: #1a1a18;
  --ink-soft: #6b6b66;
  --ink-faint: #b0afa8;
  --paper: #faf9f6;
  --paper-warm: #f2f0eb;
  --paper-mid: #ffffff;
  --accent: #f56ec8;
  --accent-light: #e8f0eb;
  --accent-text: #55d5ae;
  --danger: #be2bc0;
  --danger-light: #fdf0ee;
  --radius: 10px;
}

body {
  font-family: "Amecum", sans-serif;
  background: var(--paper);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 1rem 4rem;
}

.container {
  width: 100%;
  max-width: 480px;
}

header {
  margin-bottom: 2.5rem;
  padding-top: 0.5rem;
}
.org {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 0.5rem;
}
h1 {
  font-family: sans-serif;
  font-size: 32px;
  font-weight: 400;
  line-height: 1.1;
  color: var(--ink);
}

.page {
  display: none;
}
.page.active {
  display: block;
}

/* Cards */
.card {
  background: white;
  border: 1px solid black;
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 0.75rem;
}

.card-label {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 0.75rem;
}

.card-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 1rem;
}

/* Search input */
.search-wrap {
  position: relative;
}
.search-wrap svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  stroke: black;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
}
#voter-search {
  width: 100%;
  padding: 10px 12px 10px 36px;
  font-family: "DM Sans", sans-serif;
  font-size: 14px;
  border: 1px solid black;
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s;
}
#voter-search:focus {
  border-color: var(--accent);
}

.dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: white;
  border: 1px solid black;
  border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  max-height: 220px;
  overflow-y: auto;
  z-index: 10;
}
.dropdown.open {
  display: block;
}
.dropdown-item {
  padding: 10px 14px;
  font-size: 14px;
  cursor: pointer;
  color: var(--ink);
  transition: background 0.1s;
}
.dropdown-item:hover {
  background: var(--paper-warm);
}
.dropdown-item.voted {
  color: var(--ink-faint);
  cursor: not-allowed;
}
.dropdown-item.voted::after {
  content: " · ya votó";
  font-size: 11px;
}
.dropdown-empty {
  padding: 10px 14px;
  font-size: 13px;
  color: var(--ink-faint);
}

.selected-voter {
  display: none;
  margin-top: 8px;
  font-size: 13px;
  color: var(--accent-text);
  background: var(--accent-light);
  padding: 6px 10px;
  border-radius: 6px;
}
.selected-voter.show {
  display: block;
}

/* Radio options */
.radio-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.radio-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid black;
  border-radius: 8px;
  cursor: pointer;
  transition:
    border-color 0.15s,
    background 0.15s;
}
.radio-opt:hover {
  background: var(--paper-warm);
}
.radio-opt.selected {
  border-color: var(--accent);
  background: var(--accent-light);
}
.radio-dot {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: 1.5px solid black;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    border-color 0.15s,
    background 0.15s;
}
.radio-opt.selected .radio-dot {
  border-color: var(--accent);
  background: var(--accent);
}
.radio-opt.selected .radio-dot::after {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: white;
}
.radio-label {
  font-size: 14px;
  color: var(--ink);
}
.radio-opt.selected .radio-label {
  color: var(--accent-text);
}

/* Buttons */
.btn {
  width: 100%;
  padding: 12px;
  font-family: "DM Sans", sans-serif;
  font-size: 14px;
  font-weight: 500;
  border-radius: var(--radius);
  cursor: pointer;
  transition:
    opacity 0.15s,
    transform 0.1s;
  margin-top: 0.5rem;
}
.btn:active {
  transform: scale(0.98);
}
.btn-primary {
  background: var(--accent);
  color: white;
  border: none;
}
.btn-primary:hover {
  opacity: 0.88;
}
.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid black;
}
.btn-ghost:hover {
  background: var(--paper-warm);
}

/* Error */
.error-msg {
  display: none;
  font-size: 12px;
  color: var(--danger);
  background: var(--danger-light);
  padding: 8px 12px;
  border-radius: 6px;
  margin-top: 0.5rem;
}
.error-msg.show {
  display: block;
}

/* Confirm page */
.confirm-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 9px 0;
  border-bottom: 1px solid var(--paper-warm);
  font-size: 14px;
  gap: 1rem;
}
.confirm-row:last-child {
  border-bottom: none;
}
.confirm-key {
  color: var(--ink-soft);
  flex-shrink: 0;
}
.confirm-val {
  font-weight: 500;
  text-align: right;
}
.confirm-val.abstain {
  color: var(--ink-faint);
  font-weight: 400;
  font-style: italic;
}

/* Success */
.success-wrap {
  text-align: center;
  padding: 1.5rem 0 2rem;
}
.checkmark {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
}
.checkmark svg {
  width: 24px;
  height: 24px;
  stroke: var(--accent);
  fill: none;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.success-wrap h2 {
  font-family: "DM Serif Display", serif;
  font-size: 24px;
  font-weight: 400;
  margin-bottom: 0.4rem;
}
.success-wrap p {
  font-size: 14px;
  color: var(--ink-soft);
}

.results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-top: 1rem;
}
.result-cell {
  background: var(--paper-warm);
  border-radius: 8px;
  padding: 0.75rem;
  text-align: center;
}
.result-num {
  font-size: 22px;
  font-weight: 500;
  color: var(--accent-text);
}
.result-label {
  font-size: 11px;
  color: var(--ink-soft);
  margin-top: 2px;
}

/* Loading */
.loading {
  text-align: center;
  padding: 3rem 0;
  color: var(--ink-faint);
  font-size: 14px;
}

@media (max-width: 400px) {
  h1 {
    font-size: 26px;
  }
  .results-grid {
    grid-template-columns: 1fr;
  }
}
svg {
  width: 149px;
  height: auto;
}
