:root {
  color: #10233d;
  background: #f4f7fb;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
a { color: #1457c6; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .52; }

.top-nav {
  align-items: center;
  background: #10233d;
  display: flex;
  flex-wrap: wrap;
  gap: .25rem;
  padding: .75rem clamp(1rem, 4vw, 4rem);
}
.top-nav a, .link-button {
  background: transparent;
  border: 0;
  color: #fff;
  display: inline-block;
  padding: .7rem .85rem;
  text-decoration: none;
}
.top-nav a:hover, .top-nav a:focus-visible, .link-button:hover { background: #254566; border-radius: .5rem; }
.inline-form { display: inline; margin: 0; }
.top-nav .inline-form { margin-left: auto; }

.page-shell { margin: 0 auto; max-width: 1240px; padding: clamp(1rem, 3vw, 2.5rem); }
.page-header { align-items: end; display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; margin-bottom: 1.5rem; }
h1 { font-size: clamp(1.8rem, 4vw, 3rem); margin: 0 0 .5rem; }
h2 { margin-top: 2rem; }
.muted { color: #607086; }

.alert { border-radius: .7rem; margin-bottom: 1rem; padding: 1rem 1.25rem; }
.alert.success { background: #dff7e8; border: 1px solid #8bd4a8; color: #145c31; }
.alert.error { background: #ffebea; border: 1px solid #f4aaa6; color: #8a201b; }

.card, .auth-card {
  background: #fff;
  border: 1px solid #dce4ee;
  border-radius: 1rem;
  box-shadow: 0 8px 28px rgba(22, 49, 79, .08);
  padding: 1.25rem;
}
.auth-card { margin: 10vh auto 0; max-width: 440px; }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.metric { font-size: 2.5rem; font-weight: 800; margin: .4rem 0; }

label { display: block; font-weight: 700; margin: .8rem 0 .35rem; }
input, textarea, select {
  background: #fff;
  border: 1px solid #aab8c8;
  border-radius: .55rem;
  min-height: 46px;
  padding: .65rem .75rem;
  width: 100%;
}
textarea { min-height: 100px; resize: vertical; }
.form-row { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.button, button.button {
  background: #1457c6;
  border: 0;
  border-radius: .65rem;
  color: #fff;
  display: inline-block;
  font-weight: 800;
  min-height: 48px;
  padding: .75rem 1.1rem;
  text-decoration: none;
}
.button.secondary { background: #e6edf6; color: #17324f; }
.button.danger { background: #b62d25; }
.button.success { background: #147a42; }
.actions { align-items: center; display: flex; flex-wrap: wrap; gap: .65rem; margin-top: 1rem; }

table { background: #fff; border-collapse: collapse; width: 100%; }
th, td { border-bottom: 1px solid #dce4ee; padding: .85rem; text-align: left; vertical-align: top; }
th { background: #eef3f8; }
.table-wrap { border: 1px solid #dce4ee; border-radius: .8rem; overflow-x: auto; }

.status { border-radius: 999px; display: inline-block; font-size: .82rem; font-weight: 900; padding: .35rem .65rem; }
.status-open, .status-active, .status-online, .status-completed { background: #daf6e5; color: #126237; }
.status-ready { background: #fff0bd; color: #745400; }
.status-voting { background: #dceaff; color: #124d9d; }
.status-closed, .status-disabled, .status-offline, .status-aborted, .status-locked { background: #e8ebef; color: #536171; }
.status-draft { background: #eee4ff; color: #59359b; }

.booth-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.booth-tile { border-top: 7px solid #8190a2; }
.booth-tile.ready { border-top-color: #e5aa12; }
.booth-tile.voting { border-top-color: #216bd2; }
.booth-tile.success { border-top-color: #1a9252; }

.booth-page { background: #08243e; color: #fff; }
.booth-page .page-shell { align-items: center; display: flex; justify-content: center; max-width: none; min-height: 100vh; padding: 3vw; }
.kiosk-panel { max-width: 1500px; text-align: center; width: 100%; }
.kiosk-label { font-size: clamp(1.2rem, 2.5vw, 2rem); letter-spacing: .08em; text-transform: uppercase; }
.kiosk-title { font-size: clamp(2.2rem, 5vw, 5rem); margin: .3em 0; }
.kiosk-message { font-size: clamp(1.5rem, 3vw, 3rem); margin: 1rem 0 2rem; }
.kiosk-button { border-radius: 1.25rem; font-size: clamp(1.7rem, 3.5vw, 3.5rem); min-height: 110px; min-width: min(700px, 90vw); padding: 1.25rem 2rem; }

.candidate-grid { display: grid; gap: clamp(1rem, 2vw, 2rem); grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.candidate-card {
  background: #fff;
  border: 5px solid transparent;
  border-radius: 1.25rem;
  color: #10233d;
  min-height: 420px;
  overflow: hidden;
  padding: 0;
  width: 100%;
}
.candidate-card:focus-visible, .candidate-card:hover { border-color: #65a3ff; outline: none; }
.candidate-card img { aspect-ratio: 4 / 3; display: block; object-fit: cover; width: 100%; }
.candidate-number { background: #1457c6; border-radius: 999px; color: white; display: inline-block; font-size: 1.4rem; font-weight: 900; margin: 1rem .4rem .3rem; padding: .4rem .85rem; }
.candidate-name { display: block; font-size: clamp(1.5rem, 2.5vw, 2.4rem); font-weight: 900; padding: .5rem 1rem 1.3rem; }

.confirm-panel { background: #fff; border-radius: 1.25rem; color: #10233d; margin: 0 auto; max-width: 850px; padding: clamp(1rem, 3vw, 2rem); }
.confirm-panel[hidden], .candidate-grid[hidden] { display: none; }
.confirm-candidate { align-items: center; display: grid; gap: 1.5rem; grid-template-columns: minmax(180px, 40%) 1fr; text-align: left; }
.confirm-candidate img { border-radius: .9rem; max-height: 380px; object-fit: cover; width: 100%; }
.confirm-panel .button { font-size: clamp(1.2rem, 2.3vw, 2rem); min-height: 72px; }

.success-mark { color: #65e39a; font-size: 7rem; line-height: 1; }
.result-bar { background: #dce5ef; border-radius: 999px; height: 24px; overflow: hidden; }
.result-fill { background: #1457c6; height: 100%; min-width: 2px; }

@media (max-width: 650px) {
  .confirm-candidate { grid-template-columns: 1fr; }
  .candidate-card { min-height: 320px; }
  th, td { padding: .65rem; }
}
