/* ==========================================================================
   Voting Ketua — gaya bersama untuk halaman vote, hasil, dan admin.
   Palet: kertas krem, tinta hijau, aksen hijau tua dan kuning gading.
   ========================================================================== */

:root {
  --ink: #14251e;
  --ink-2: #23392f;
  --muted: #5f6f67;
  --muted-2: #7c8a83;
  --paper: #f5f4ed;
  --paper-2: #eeede4;
  --card: #fffdf8;
  --line: #dfe1d5;
  --line-strong: #c9cdbd;
  --accent: #0b6b4f;
  --accent-2: #084d39;
  --accent-soft: #e3f0e9;
  --warn: #9a5b07;
  --warn-soft: #fbf0dc;
  --danger: #b42318;
  --danger-soft: #fbe9e7;
  --success: #0b6b4f;
  --success-soft: #e3f0e9;
  --shadow-sm: 0 1px 2px rgb(20 37 30 / 5%);
  --shadow-md: 0 2px 4px rgb(20 37 30 / 4%), 0 18px 36px -24px rgb(20 37 30 / 32%);
  --shadow-lg: 0 4px 8px rgb(20 37 30 / 5%), 0 36px 70px -36px rgb(20 37 30 / 38%);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --font-sans: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --max: 1080px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 15% -10%, #e8f0e6 0%, transparent 60%),
    radial-gradient(900px 500px at 100% 0%, #f3ecd9 0%, transparent 55%),
    var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--accent-2);
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

img,
svg {
  display: block;
  max-width: 100%;
}

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

h1,
h2,
h3 {
  line-height: 1.15;
  letter-spacing: -0.015em;
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.shell {
  width: min(var(--max), calc(100% - 40px));
  margin-inline: auto;
}

/* Header ------------------------------------------------------------------ */

.demo-bar {
  background: var(--ink);
  color: #f3ecd9;
  font-size: 13px;
  letter-spacing: 0.01em;
  text-align: center;
  padding: 7px 18px;
}

.demo-bar strong {
  color: #ffe6a8;
  font-weight: 600;
}

.site-header {
  border-bottom: 1px solid var(--line);
  background: rgb(245 244 237 / 82%);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.brand:hover {
  color: var(--ink);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  box-shadow: inset 0 -2px 0 rgb(0 0 0 / 18%);
}

.brand-word {
  font-family: var(--font-display);
  font-size: 21px;
  letter-spacing: 0;
}

.brand-word span {
  color: var(--accent);
}

.nav {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.nav a {
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
}

.nav a:hover,
.nav a[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--accent-2);
}

/* Hero -------------------------------------------------------------------- */

.hero {
  padding: 64px 0 36px;
}

.hero-inner {
  max-width: 760px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  background: currentColor;
}

.display {
  margin-bottom: 18px;
  font-family: var(--font-display);
  font-size: clamp(38px, 6vw, 68px);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.lede {
  max-width: 62ch;
  margin-bottom: 26px;
  color: var(--muted);
  font-size: clamp(16px, 1.8vw, 19px);
}

.status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgb(255 253 248 / 70%);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
}

.status-chip .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px rgb(11 107 79 / 12%);
}

.status-chip.is-closed .dot {
  background: var(--muted-2);
  box-shadow: 0 0 0 4px rgb(95 111 103 / 12%);
}

.status-chip.is-live .dot {
  animation: pulse 2.4s ease-out infinite;
}

/* Panels & sections ------------------------------------------------------- */

.section {
  padding: 18px 0 56px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow-md);
}

.panel-pad {
  padding: clamp(22px, 4vw, 40px);
}

.panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px;
}

.panel-head h2 {
  margin-bottom: 6px;
  font-family: var(--font-display);
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 600;
}

.panel-head p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
}

.section-kicker {
  margin-bottom: 10px;
  color: var(--muted-2);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 13px;
}

/* Form -------------------------------------------------------------------- */

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field > label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.field-hint {
  color: var(--muted);
  font-size: 12.5px;
}

.input,
.textarea,
.select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  padding: 12px 14px;
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.input:focus,
.textarea:focus,
.select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgb(11 107 79 / 12%);
}

.textarea {
  min-height: 84px;
  resize: vertical;
}

.input-color {
  width: 52px;
  height: 44px;
  padding: 4px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}

.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.form-row .input {
  flex: 1 1 220px;
}

.form-stack {
  display: grid;
  gap: 16px;
}

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

/* Buttons ----------------------------------------------------------------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  padding: 10px 20px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  text-decoration: none;
  transition: transform 120ms ease, background 150ms ease, box-shadow 150ms ease, opacity 150ms ease;
  box-shadow: 0 1px 2px rgb(8 77 57 / 22%);
}

.button:hover {
  background: var(--accent-2);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px -8px rgb(8 77 57 / 60%);
}

.button:active {
  transform: translateY(0);
}

.button:focus-visible,
.vote-btn:focus-visible,
.icon-btn:focus-visible {
  outline: 3px solid rgb(11 107 79 / 30%);
  outline-offset: 2px;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
  box-shadow: none;
}

.button-secondary {
  border-color: var(--line-strong);
  background: var(--card);
  color: var(--ink);
  box-shadow: none;
}

.button-secondary:hover {
  border-color: var(--ink-2);
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.button-ghost {
  background: transparent;
  color: var(--accent);
  box-shadow: none;
}

.button-ghost:hover {
  background: var(--accent-soft);
  color: var(--accent-2);
  box-shadow: none;
}

.button-danger {
  background: var(--danger);
  color: #fff;
}

.button-danger:hover {
  background: #92190f;
}

.button-small {
  min-height: 36px;
  padding: 7px 14px;
  font-size: 13px;
}

.button-wide {
  width: 100%;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  transition: color 150ms ease, border-color 150ms ease, background 150ms ease;
}

.icon-btn:hover {
  border-color: var(--line-strong);
  background: var(--paper);
  color: var(--ink);
}

/* Name gate --------------------------------------------------------------- */

.gate {
  display: grid;
  gap: 22px;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  align-items: center;
}

.gate h2 {
  margin-bottom: 8px;
  font-family: var(--font-display);
  font-size: clamp(26px, 3.4vw, 36px);
  font-weight: 600;
}

.gate p {
  margin-bottom: 0;
  color: var(--muted);
}

.gate-form {
  display: grid;
  gap: 10px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.gate-form .field-hint {
  text-align: center;
}

.voter-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 24px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.voter-strip strong {
  font-family: var(--font-display);
  font-size: 18px;
}

/* Candidate cards --------------------------------------------------------- */

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

.candidate-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: hidden;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.candidate-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: var(--candidate, var(--accent));
}

.candidate-card:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
}

.candidate-avatar {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--candidate, var(--accent)) 14%, white);
  color: var(--candidate, var(--accent));
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.candidate-body {
  flex: 1;
}

.candidate-body h3 {
  margin-bottom: 8px;
  font-family: var(--font-display);
  font-size: 23px;
  font-weight: 600;
}

.candidate-body p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
}

.vote-btn {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
}

.vote-btn:hover {
  border-color: var(--candidate, var(--accent));
  background: var(--candidate, var(--accent));
  color: #fff;
}

.vote-btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.candidate-empty {
  grid-column: 1 / -1;
  padding: 36px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

/* Notices ----------------------------------------------------------------- */

.notice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  font-size: 14px;
}

.notice-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.notice strong {
  display: block;
  margin-bottom: 2px;
}

.notice p {
  margin: 0;
}

.notice-success {
  border-color: #b9d9c9;
  background: var(--success-soft);
}

.notice-success .notice-icon {
  background: var(--success);
}

.notice-warn {
  border-color: #ecd6ad;
  background: var(--warn-soft);
}

.notice-warn .notice-icon {
  background: var(--warn);
}

.notice-danger {
  border-color: #efc4bf;
  background: var(--danger-soft);
}

.notice-danger .notice-icon {
  background: var(--danger);
}

.notice + .notice {
  margin-top: 12px;
}

/* Closed state ------------------------------------------------------------ */

.closed-card {
  padding: clamp(28px, 5vw, 52px);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(600px 280px at 100% 0%, rgb(255 230 168 / 14%), transparent 70%),
    var(--ink);
  color: #f5f4ed;
  text-align: center;
}

.closed-card h2 {
  margin-bottom: 12px;
  font-family: var(--font-display);
  font-size: clamp(30px, 5vw, 48px);
  font-weight: 600;
}

.closed-card p {
  max-width: 52ch;
  margin: 0 auto 24px;
  color: #c9d2cb;
}

.closed-card .button-secondary {
  border-color: rgb(255 255 255 / 22%);
  background: transparent;
  color: #fff;
}

.closed-card .button-secondary:hover {
  background: rgb(255 255 255 / 10%);
  color: #fff;
}

/* Results ----------------------------------------------------------------- */

.winner-card {
  position: relative;
  overflow: hidden;
  padding: clamp(28px, 5vw, 52px);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(700px 320px at 100% 0%, rgb(255 230 168 / 18%), transparent 65%),
    linear-gradient(135deg, var(--ink) 0%, #1b3a2e 100%);
  color: #f7f4e9;
  box-shadow: var(--shadow-lg);
}

.winner-card .section-kicker {
  color: #a7c7b4;
}

.winner-card h2 {
  margin-bottom: 10px;
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 54px);
  font-weight: 600;
}

.winner-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.winner-chip {
  padding: 7px 13px;
  border: 1px solid rgb(255 255 255 / 16%);
  border-radius: 999px;
  background: rgb(255 255 255 / 7%);
  font-size: 13px;
  font-weight: 600;
}

.trophy {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin-bottom: 22px;
  border: 1px solid rgb(255 230 168 / 35%);
  border-radius: 50%;
  background: rgb(255 230 168 / 12%);
  color: #ffe6a8;
}

.result-list {
  display: grid;
  gap: 18px;
}

.result-row {
  display: grid;
  gap: 9px;
}

.result-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.result-name {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
}

.result-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--candidate, var(--accent));
}

.result-numbers {
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.result-numbers strong {
  color: var(--ink);
  font-size: 15px;
}

.bar-track {
  overflow: hidden;
  height: 12px;
  border-radius: 999px;
  background: var(--paper-2);
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--candidate, var(--accent));
  transform-origin: left;
  animation: grow 900ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.result-total {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

.result-total strong {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
}

.waiting-card {
  padding: clamp(28px, 5vw, 52px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(600px 300px at 100% 0%, #eef5ea 0%, transparent 65%),
    var(--card);
  box-shadow: var(--shadow-md);
}

.waiting-status {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 20px;
  padding: 7px 13px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-2);
  font-size: 13px;
  font-weight: 700;
}

.waiting-status .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2.4s ease-out infinite;
}

.waiting-card h2 {
  margin-bottom: 12px;
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 600;
}

.waiting-card > p {
  max-width: 58ch;
  color: var(--muted);
}

.lineup {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.lineup-item {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 14px;
  font-weight: 600;
}

.lineup-item .dot {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  background: var(--candidate, var(--accent));
}

/* Admin ------------------------------------------------------------------- */

.admin-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 52px 0 28px;
}

.admin-hero h1 {
  margin-bottom: 8px;
  font-family: var(--font-display);
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 600;
}

.admin-hero p {
  margin-bottom: 0;
  color: var(--muted);
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.stat-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 20px;
}

.stat {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

.stat-label {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 600;
  line-height: 1.1;
}

.stat-note {
  margin-top: 4px;
  color: var(--muted-2);
  font-size: 12.5px;
}

.admin-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  align-items: start;
}

.stack {
  display: grid;
  gap: 20px;
}

.card-block {
  padding: clamp(20px, 3vw, 28px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

.card-block-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.card-block-head h2 {
  margin-bottom: 0;
  font-family: var(--font-display);
  font-size: 23px;
  font-weight: 600;
}

.card-block-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.candidate-rows {
  display: grid;
  gap: 10px;
}

.candidate-row {
  display: grid;
  gap: 12px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.color-dot {
  width: 12px;
  height: 12px;
  border-radius: 4px;
  background: var(--candidate, var(--accent));
}

.candidate-row-name {
  font-weight: 700;
  line-height: 1.3;
}

.candidate-row-tagline {
  overflow: hidden;
  color: var(--muted);
  font-size: 12.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.candidate-row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.vote-count {
  margin-right: 6px;
  color: var(--muted);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.status-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
}

.status-toggle .button {
  flex: 0 0 auto;
  white-space: nowrap;
}

.status-toggle strong {
  display: block;
  font-size: 15px;
}

.status-toggle span {
  color: var(--muted);
  font-size: 12.5px;
}

.danger-zone {
  padding-top: 15px;
  border-top: 1px solid var(--line);
}

.danger-zone h3 {
  margin-bottom: 6px;
  font-size: 15px;
}

.danger-zone p {
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 13px;
}

.login-wrap {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 160px);
  padding: 40px 0 64px;
}

.login-card {
  width: min(420px, 100%);
  padding: clamp(24px, 5vw, 38px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow-lg);
}

.login-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 20px;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent);
}

.login-card h1 {
  margin-bottom: 8px;
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 600;
}

.login-card > p {
  margin-bottom: 24px;
  color: var(--muted);
  font-size: 14px;
}

/* Dialog ------------------------------------------------------------------ */

.dialog {
  width: min(480px, calc(100% - 32px));
  padding: 0;
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
}

.dialog::backdrop {
  background: rgb(20 37 30 / 48%);
  backdrop-filter: blur(3px);
}

.dialog-inner {
  padding: clamp(22px, 4vw, 32px);
}

.dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.dialog-head h2 {
  margin-bottom: 6px;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
}

.dialog-head p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13.5px;
}

.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 22px;
}

.dialog-candidate {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
}

.dialog-candidate .candidate-avatar {
  width: 46px;
  height: 46px;
  font-size: 18px;
}

.dialog-candidate strong {
  display: block;
  font-family: var(--font-display);
  font-size: 19px;
}

.dialog-candidate span {
  color: var(--muted);
  font-size: 13px;
}

/* Toast ------------------------------------------------------------------- */

.toast {
  position: fixed;
  z-index: 60;
  left: 50%;
  bottom: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(440px, calc(100% - 32px));
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease, transform 200ms ease;
}

.toast.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
}

.toast.is-error {
  background: var(--danger);
}

/* Footer ------------------------------------------------------------------ */

.site-footer {
  margin-top: 36px;
  border-top: 1px solid var(--line);
  padding: 26px 0 34px;
  color: var(--muted);
  font-size: 13px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--accent);
}

/* Loading ----------------------------------------------------------------- */

.loading {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
  vertical-align: -2px;
}

.skeleton {
  border-radius: 8px;
  background: linear-gradient(90deg, var(--paper-2) 25%, #f6f5ee 50%, var(--paper-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}

/* Animations -------------------------------------------------------------- */

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgb(11 107 79 / 35%);
  }
  70% {
    box-shadow: 0 0 0 8px rgb(11 107 79 / 0%);
  }
  100% {
    box-shadow: 0 0 0 0 rgb(11 107 79 / 0%);
  }
}

@keyframes grow {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

/* Responsive -------------------------------------------------------------- */

@media (max-width: 900px) {
  .candidate-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gate {
    grid-template-columns: 1fr;
  }

  .admin-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .shell {
    width: calc(100% - 28px);
  }

  .hero {
    padding: 42px 0 26px;
  }

  .candidate-grid {
    grid-template-columns: 1fr;
  }

  .stat-grid {
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .candidate-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .candidate-row-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  .header-inner {
    min-height: 60px;
  }

  .nav a {
    padding: 7px 9px;
    font-size: 13px;
  }

  .brand-word {
    font-size: 19px;
  }

  .result-top {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .toast {
    bottom: 14px;
    border-radius: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
