:root {
  --bg-page: #e8eaed;
  --bg-card: #ffffff;
  --bg-muted: #f3f4f6;
  --bg-countdown: #fef6e4;
  --text-primary: #1a1a1a;
  --text-secondary: #8a8f98;
  --text-countdown: #a67c2d;
  --progress: #3b82f6;
  --progress-track: #e5e7eb;
  --verified: #22c55e;
  --btn-x: #0f0f0f;
  --btn-email: #e53935;
  --shadow: 0 12px 40px rgba(15, 23, 42, 0.1), 0 2px 8px rgba(15, 23, 42, 0.04);
  --radius-card: 20px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --font: "Plus Jakarta Sans", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  min-height: 100%;
}

body {
  font-family: var(--font);
  color: var(--text-primary);
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, #f5f7fa 0%, transparent 55%),
    linear-gradient(165deg, #eceef2 0%, #e2e5ea 45%, #d8dce3 100%);
  -webkit-font-smoothing: antialiased;
}

.page {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
}

.vote-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-card);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  padding: 24px 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: card-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Header */
.card-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.avatar {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 0 0 2px #f0f0f0;
}

.avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.candidate-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding-top: 2px;
  min-width: 0;
}

.candidate-meta h1 {
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.candidate-id {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.badge.verified {
  display: inline-flex;
  align-items: center;
  margin-top: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--verified);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  animation: badge-pop 0.5s 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes badge-pop {
  from {
    opacity: 0;
    transform: scale(0.7);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Progress */
.progress-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-primary);
}

.progress-track {
  height: 8px;
  background: var(--progress-track);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--progress);
  border-radius: 999px;
  transform-origin: left;
  animation: fill-grow 0.9s 0.2s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes fill-grow {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

.progress-stats {
  display: flex;
  justify-content: space-between;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
}

/* Countdown */
.countdown-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 14px;
  background: var(--bg-countdown);
  border-radius: var(--radius-md);
  color: var(--text-countdown);
  font-size: 0.875rem;
  font-weight: 600;
}

.countdown-banner strong {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.icon-clock {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Activity */
.activity-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.activity-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-primary);
}

.icon-trend {
  width: 18px;
  height: 18px;
  color: var(--text-primary);
}

.activity-list {
  list-style: none;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-muted);
  border-radius: var(--radius-md);
}

.activity-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.activity-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 6px;
  font-size: 0.8125rem;
  line-height: 1.35;
}

.activity-name {
  font-weight: 700;
  color: var(--text-primary);
}

.activity-action {
  font-weight: 500;
  color: var(--text-secondary);
}

.activity-time {
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

/* Actions */
.actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px 20px;
  border: none;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 0.15s ease,
    filter 0.15s ease,
    box-shadow 0.15s ease;
}

.btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0) scale(0.985);
  filter: brightness(0.95);
}

.btn:focus-visible {
  outline: 2px solid var(--progress);
  outline-offset: 3px;
}

.btn-x {
  background: var(--btn-x);
}

.btn-email {
  background: var(--btn-email);
}

.icon-x {
  width: 18px;
  height: 18px;
}

.icon-mail {
  width: 20px;
  height: 20px;
}

/* Footer */
.card-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding-top: 4px;
  border-top: 1px solid #eceef1;
  margin-top: 2px;
  padding-top: 16px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.icon-clock-sm {
  width: 15px;
  height: 15px;
  color: var(--text-secondary);
}

@media (max-width: 420px) {
  .vote-card {
    padding: 20px 18px 16px;
    gap: 18px;
  }

  .candidate-meta h1 {
    font-size: 1.05rem;
  }

  .activity-info {
    flex-direction: column;
    gap: 2px;
  }
}
