:root {
  color-scheme: light;
  --emerald-950: #052d26;
  --emerald-900: #063f34;
  --emerald-700: #08765f;
  --mint: #70ffc6;
  --lime: #b7ff5d;
  --orange: #ffb35c;
  --paper: #f7fbf4;
  --ink: #0b1714;
  --muted: #64736d;
  --line: rgba(5, 45, 38, 0.14);
  --shadow: 0 22px 70px rgba(5, 45, 38, 0.18);
  --display-font: Outfit, ui-sans-serif, system-ui, sans-serif;
  --body-font: "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
  font-family: var(--body-font);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--paper);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 85% 10%, rgba(255, 179, 92, 0.18), transparent 24rem),
    radial-gradient(circle at 15% 0%, rgba(112, 255, 198, 0.22), transparent 30rem),
    linear-gradient(140deg, #fbfff8 0%, #edf8ef 44%, #dbf3ea 100%);
}

button {
  font: inherit;
}

[hidden] {
  display: none !important;
}

.app-shell {
  width: min(1180px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 22px 16px 42px;
}

.screen {
  animation: rise 480ms ease both;
}

.login-screen,
.result-screen {
  min-height: calc(100vh - 44px);
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  margin: 0 auto 18px;
  border-radius: 24px;
  color: var(--mint);
  font-size: 2.2rem;
  font-weight: 900;
  background: linear-gradient(145deg, var(--emerald-950), var(--emerald-700));
  box-shadow: 0 18px 42px rgba(5, 45, 38, 0.24);
}

.logo-frame {
  display: grid;
  place-items: center;
  border: 1px solid rgba(8, 118, 95, 0.16);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(224, 255, 242, 0.88)),
    #ffffff;
  box-shadow: 0 18px 48px rgba(5, 45, 38, 0.14);
}

.logo-frame img {
  display: block;
  width: 82%;
  height: 82%;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.hero-logo {
  width: clamp(118px, 28vw, 176px);
  height: clamp(118px, 28vw, 176px);
  margin: 0 auto 18px;
  border-radius: 32px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--emerald-700);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 8px;
  font-family: var(--display-font);
  font-size: clamp(2.35rem, 8vw, 5.9rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.school {
  margin-bottom: 24px;
  color: var(--muted);
  font-weight: 700;
}

.hint {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.status-pill,
.live-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--emerald-900);
  background: rgba(255, 255, 255, 0.74);
  font-size: 0.78rem;
  font-weight: 900;
}

.status-pill {
  margin-bottom: 18px;
}

.status-pill[data-tone="open"],
.live-badge {
  border-color: rgba(8, 118, 95, 0.24);
  background: rgba(112, 255, 198, 0.2);
}

.status-pill[data-tone="closed"],
.status-pill[data-tone="warning"] {
  border-color: rgba(255, 179, 92, 0.34);
  background: rgba(255, 179, 92, 0.17);
}

.google-slot {
  display: grid;
  place-items: center;
  min-height: 46px;
}

.vote-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0 18px;
  background: linear-gradient(180deg, rgba(247, 251, 244, 0.96), rgba(247, 251, 244, 0.82) 70%, transparent);
  backdrop-filter: blur(14px);
}

.vote-header h2 {
  margin: 0;
  font-family: var(--display-font);
  font-size: clamp(1.45rem, 4.5vw, 2.8rem);
  line-height: 1;
}

.candidate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(154px, 1fr));
  gap: 16px;
}

.candidate-card {
  position: relative;
  display: grid;
  gap: 0;
  width: 100%;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(5, 45, 38, 0.1);
  border-radius: 18px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 14px 38px rgba(5, 45, 38, 0.08);
  cursor: pointer;
  animation: rise 520ms ease both;
  animation-delay: var(--delay);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.candidate-card:hover,
.candidate-card:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(8, 118, 95, 0.34);
  outline: none;
}

.candidate-card.is-selected {
  border-color: var(--emerald-700);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(213, 255, 235, 0.88));
  box-shadow: 0 16px 40px rgba(8, 118, 95, 0.24);
  transform: scale(1.015);
}

.candidate-photo-wrap {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 0;
  aspect-ratio: 3 / 4;
  background: var(--emerald-950);
}

.candidate-photo-wrap img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.candidate-photo-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, transparent 54%, rgba(4, 31, 27, 0.62)),
    linear-gradient(135deg, rgba(112, 255, 198, 0.16), transparent 42%);
  pointer-events: none;
}

.candidate-check {
  position: absolute;
  right: 10px;
  top: 10px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: var(--emerald-950);
  background: var(--mint);
  font-weight: 900;
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 170ms ease, transform 170ms ease;
}

.candidate-card.is-selected .candidate-check {
  opacity: 1;
  transform: scale(1);
}

.candidate-meta {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  min-height: 54px;
  padding: 11px 12px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 14px;
  background: rgba(4, 31, 27, 0.68);
  backdrop-filter: blur(10px);
}

.candidate-name {
  color: white;
  overflow-wrap: anywhere;
  font-family: var(--display-font);
  font-size: clamp(1rem, 4.2vw, 1.2rem);
  font-weight: 900;
  line-height: 0.98;
  width: 100%;
  text-align: center;
}

.brand-filler {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  min-height: 100%;
  aspect-ratio: 3 / 4;
  border: 1px solid rgba(8, 118, 95, 0.14);
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 24%, rgba(112, 255, 198, 0.34), transparent 42%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(225, 250, 239, 0.66));
  box-shadow: 0 14px 38px rgba(5, 45, 38, 0.08);
}

.grid-logo {
  width: 68%;
  aspect-ratio: 1;
  border-radius: 50%;
}

.brand-filler span {
  max-width: 12ch;
  color: var(--emerald-900);
  font-family: var(--display-font);
  font-size: clamp(0.88rem, 3.6vw, 1.08rem);
  font-weight: 900;
  line-height: 0.98;
  text-align: center;
}

.vote-bar {
  position: static;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  min-height: 78px;
  margin: 18px 0 0;
  padding: 14px;
  border: 1px solid rgba(5, 45, 38, 0.12);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(5, 45, 38, 0.94), rgba(8, 118, 95, 0.88)),
    var(--emerald-950);
  box-shadow: var(--shadow);
  color: white;
}

.vote-bar small {
  display: block;
  color: rgba(255, 255, 255, 0.68);
  font-weight: 800;
}

.vote-bar strong {
  display: block;
  max-width: 52vw;
  overflow-wrap: anywhere;
  line-height: 1.05;
  font-family: var(--display-font);
  font-size: 1.1rem;
}

.primary-button,
.ghost-button,
.danger-button {
  min-height: 46px;
  border: 0;
  border-radius: 14px;
  padding: 0 16px;
  font-size: 0.82rem;
  font-weight: 900;
  cursor: pointer;
  transition: transform 160ms ease, opacity 160ms ease, background 160ms ease;
}

.primary-button {
  color: var(--emerald-950);
  background: linear-gradient(135deg, var(--mint), var(--lime));
  box-shadow: 0 10px 26px rgba(112, 255, 198, 0.24);
}

.danger-button {
  color: #fff8f1;
  background: #bb3f2b;
}

.ghost-button {
  border: 1px solid var(--line);
  color: var(--emerald-900);
  background: rgba(255, 255, 255, 0.82);
}

.primary-button:hover,
.ghost-button:hover,
.danger-button:hover {
  transform: translateY(-1px);
}

.primary-button:disabled,
.ghost-button:disabled,
.danger-button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
  transform: none;
}

.confirm-modal {
  width: min(420px, calc(100% - 28px));
  padding: 0;
  border: 0;
  border-radius: 22px;
  background: transparent;
}

.confirm-modal::backdrop {
  background: rgba(1, 20, 16, 0.62);
  backdrop-filter: blur(8px);
}

.modal-card {
  padding: 14px;
  border-radius: 22px;
  text-align: center;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.modal-card img {
  width: 100%;
  max-height: 360px;
  border-radius: 18px;
  object-fit: cover;
  aspect-ratio: 3 / 4;
}

.modal-choice {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 14px 0;
}

.modal-choice strong {
  overflow-wrap: anywhere;
  font-family: var(--display-font);
  font-size: 1.55rem;
  line-height: 1;
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 10px;
}

.result-screen {
  padding: 20px;
}

.success-mark {
  display: grid;
  place-items: center;
  width: 104px;
  height: 104px;
  margin-bottom: 22px;
  border-radius: 50%;
  color: var(--emerald-950);
  background: linear-gradient(135deg, var(--mint), var(--lime));
  box-shadow: 0 18px 48px rgba(8, 118, 95, 0.26);
  animation: pop 620ms cubic-bezier(.2, 1.3, .32, 1) both;
}

.success-mark span {
  font-size: 3.2rem;
  font-weight: 900;
}

.result-screen h2 {
  margin-bottom: 10px;
  font-size: clamp(2.2rem, 9vw, 5.2rem);
  line-height: 0.92;
}

.result-screen p {
  color: var(--muted);
  font-size: 1.1rem;
  font-weight: 700;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 12;
  width: min(460px, calc(100% - 28px));
  padding: 14px 16px;
  border-radius: 8px;
  color: white;
  background: var(--emerald-950);
  box-shadow: var(--shadow);
  transform: translateX(-50%);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pop {
  from {
    opacity: 0;
    transform: scale(0.68);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@media (min-width: 760px) {
  .app-shell {
    padding-inline: 26px;
  }

  .candidate-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
  }
}

@media (min-width: 1080px) {
  .candidate-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 430px) {
  .app-shell {
    padding-inline: 10px;
  }

  .candidate-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .candidate-card {
    border-radius: 16px;
  }

  .vote-bar {
    width: calc(100% - 16px);
    gap: 8px;
    padding: 10px;
    margin-inline: auto;
  }

  .vote-bar strong {
    max-width: 38vw;
    font-size: 0.92rem;
  }

  .primary-button,
  .ghost-button,
  .danger-button {
    padding-inline: 12px;
    font-size: 0.76rem;
  }
}
