:root {
  --white: #ffffff;
  --ink: #202631;
  --muted: #697386;
  --line: #E2E8F0;
  --soft: #F6F8FB;
  --gold: #D9A441;
  --gold-soft: #FFF6DF;
  --red: #B91C1C;
  --green: #12805C;
  --shadow: 0 16px 36px rgba(32, 38, 49, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--soft);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  line-height: 1.45;
}

button,
input,
select,
textarea {
  font: inherit;
  min-width: 0;
}

button {
  cursor: pointer;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 72px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--gold);
  font-size: 14px;
  font-weight: 900;
}

.menu-toggle {
  display: none;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 999px;
  background: var(--ink);
}

.main-nav,
.hero-actions,
.candidate-actions,
.badge-row,
.action-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.main-nav button,
.primary,
.ghost,
.danger,
.candidate-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: var(--white);
  color: var(--ink);
  font-weight: 800;
}

.main-nav button.is-active,
.primary {
  border-color: var(--gold);
  background: var(--gold);
  color: #1b1b1b;
}

.danger {
  border-color: #FECACA;
  color: var(--red);
}

#app {
  width: 100%;
  margin: 0 auto;
  padding: 28px clamp(18px, 3vw, 48px) 56px;
}

.hero {
  position: relative;
  display: block;
}

.hero-copy,
.auth-screen {
  display: grid;
  align-content: center;
  min-height: 430px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(26px, 5vw, 56px);
  background:
    linear-gradient(120deg, rgba(32, 38, 49, 0.94), rgba(32, 38, 49, 0.66)),
    linear-gradient(135deg, #141820, #7A1D1D 58%, var(--gold));
  color: var(--white);
}

.hero-copy {
  min-height: clamp(460px, 42vw, 620px);
  padding-bottom: clamp(150px, 12vw, 190px);
}

.hero-copy h1,
.page-head h1,
.auth-screen h1,
.dashboard-head h1 {
  margin: 0;
  max-width: 860px;
  font-size: clamp(36px, 6vw, 76px);
  line-height: 1.02;
  font-weight: 850;
}

.hero-copy p,
.auth-screen p {
  max-width: 720px;
  color: rgba(255, 255, 255, 0.84);
  font-size: 17px;
}

.hero-panel,
.section,
.page-head,
.dashboard-head,
.candidate-card,
.stat-card,
.login-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.hero-panel {
  position: absolute;
  right: clamp(26px, 5vw, 56px);
  bottom: clamp(22px, 4vw, 42px);
  left: clamp(26px, 5vw, 56px);
  display: grid;
  gap: 10px;
  align-content: end;
  border: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  color: var(--white);
}

.hero-panel .kicker {
  color: var(--gold);
}

.hero-panel .stats-grid.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.hero-panel .stat-card {
  min-height: 92px;
  border-color: rgba(255, 255, 255, 0.20);
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
  box-shadow: none;
  backdrop-filter: blur(12px);
}

.hero-panel .stat-card span {
  color: rgba(255, 255, 255, 0.78);
}

.section,
.page-head,
.dashboard-head {
  margin-top: 18px;
  padding: 22px;
}

.page-head {
  display: grid;
  gap: 10px;
}

.page-head h1,
.dashboard-head h1 {
  color: var(--ink);
  font-size: clamp(32px, 5vw, 58px);
}

.page-head p,
.dashboard-note,
.lead {
  max-width: 760px;
  color: var(--muted);
}

.dashboard-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  margin-top: 0;
}

.dashboard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.kicker {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

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

.section-head h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.1;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}

.stats-grid.compact {
  grid-template-columns: 1fr;
  margin: 0;
}

.stat-card {
  display: grid;
  gap: 10px;
  min-height: 106px;
  align-content: space-between;
  padding: 16px;
}

.stat-card strong {
  overflow-wrap: anywhere;
  font-size: clamp(22px, 3vw, 32px);
}

.stat-card span,
.partner-grid span {
  color: var(--muted);
  font-size: 13px;
}

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

.candidate-card {
  overflow: hidden;
}

.candidate-media {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, var(--ink), #723019 58%, var(--gold));
  color: var(--white);
  font-size: 42px;
  font-weight: 900;
}

.candidate-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.candidate-body {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.candidate-body h3 {
  margin: 0;
  font-size: 20px;
}

.candidate-body p {
  margin: 0;
  color: var(--muted);
}

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

.candidate-actions button:first-child {
  background: var(--ink);
  color: var(--white);
}

.candidate-actions button:last-child {
  border-color: var(--gold);
  background: var(--gold);
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  background: var(--gold-soft);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.badge.is-ready {
  background: #DCFCE7;
  color: var(--green);
}

.rank-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rank-list li {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--white);
}

.rank-list b {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--white);
}

.partner-grid,
.contact-grid,
.info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.partner-grid article,
.contact-grid article,
.info-grid article,
.confirmation-list article {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--white);
}

.info-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 16px;
}

.info-grid span,
.confirmation-list span {
  color: var(--muted);
  font-size: 12px;
}

.rules-copy {
  margin-bottom: 0;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(32, 38, 49, 0.66);
}

.vote-modal {
  display: grid;
  gap: 14px;
  width: min(560px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  background: var(--white);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
}

.vote-modal h2 {
  margin: 0;
  font-size: 30px;
}

.checkout-modal {
  gap: 16px;
}

.checkout-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.checkout-head h2 {
  overflow-wrap: anywhere;
}

.icon-button {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
}

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

.checkout-recap article,
.checkout-total {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--soft);
}

.checkout-recap span,
.checkout-total span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.checkout-recap strong,
.checkout-total strong {
  overflow-wrap: anywhere;
}

.checkout-summary {
  margin: 0;
  color: var(--muted);
}

.checkout-total {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  background: var(--gold-soft);
}

.checkout-total strong {
  font-size: 20px;
}

.success-mark {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 999px;
  background: var(--green);
  color: var(--white);
  font-weight: 900;
}

.confirmation-list {
  display: grid;
  gap: 10px;
}

.participation-box,
.terms-list,
.success-panel {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--white);
}

.participation-box {
  background: var(--gold-soft);
}

.terms-list label {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  font-weight: 700;
}

.terms-list input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
  margin-top: 2px;
}

.success-panel {
  justify-items: start;
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.manual-panel {
  display: grid;
  gap: 16px;
}

.manual-panel[hidden],
.country-field[hidden],
[data-admin-applications][hidden] {
  display: none;
}

td textarea {
  min-width: 220px;
  min-height: 78px;
}

.auth-screen {
  grid-template-columns: minmax(0, 1fr) 400px;
  gap: 18px;
  align-items: start;
}

.login-card {
  display: grid;
  gap: 12px;
  padding: 20px;
  color: var(--ink);
}

.login-help,
small {
  color: var(--muted);
  font-size: 12px;
}

.form-error {
  margin: 0;
  padding: 10px;
  border-radius: 8px;
  background: #FEE2E2;
  color: var(--red);
  font-weight: 800;
}

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

label {
  display: grid;
  gap: 6px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  background: var(--white);
  color: var(--ink);
}

textarea {
  resize: vertical;
}

.wide {
  grid-column: 1 / -1;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.empty {
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-weight: 800;
}

@media (max-width: 960px) {
  .site-header,
  .section-head,
  .dashboard-head,
  .auth-screen {
    display: grid;
  }

  .site-header {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .main-nav {
    width: 100%;
  }

  .dashboard-head,
  .auth-screen {
    grid-template-columns: 1fr;
  }

  .hero {
    display: grid;
    grid-template-columns: 1fr;
  }

  .hero-copy {
    min-height: 360px;
    padding-bottom: 26px;
  }

  .hero-panel {
    position: static;
    border: 1px solid var(--line);
    padding: 18px;
    background: var(--white);
    color: var(--ink);
    box-shadow: var(--shadow);
  }

  .hero-panel .stats-grid.compact {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .hero-panel .stat-card {
    border-color: var(--line);
    background: var(--white);
    color: var(--ink);
    box-shadow: var(--shadow);
    backdrop-filter: none;
  }

  .hero-panel .stat-card span {
    color: var(--muted);
  }

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

  .partner-grid,
  .contact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .info-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  body {
    overflow-x: hidden;
  }

  .site-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px;
    gap: 12px;
    padding: 12px 16px;
  }

  .brand {
    min-width: 0;
  }

  .brand span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .menu-toggle {
    display: grid;
    gap: 4px;
  }

  .site-header.is-menu-open .menu-toggle {
    border-color: var(--gold);
    background: var(--gold-soft);
  }

  .main-nav {
    display: none;
    grid-template-columns: 1fr;
    grid-column: 1 / -1;
    width: 100%;
    gap: 6px;
  }

  .site-header.is-menu-open .main-nav {
    display: grid;
  }

  .main-nav button {
    width: 100%;
    min-height: 42px;
    padding: 0 12px;
    font-size: 14px;
    line-height: 1.2;
    white-space: normal;
  }

  #app {
    padding: 14px 10px 42px;
  }

  .hero-copy,
  .auth-screen,
  .section,
  .page-head,
  .dashboard-head {
    padding: 18px;
  }

  .auth-screen {
    min-height: auto;
    gap: 16px;
  }

  .login-card {
    padding: 16px;
  }

  .hero-copy {
    min-height: 330px;
  }

  .hero-copy h1,
  .page-head h1,
  .auth-screen h1,
  .dashboard-head h1 {
    font-size: 38px;
    overflow-wrap: anywhere;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .hero-actions button,
  .section-head .ghost,
  .dashboard-actions button,
  .candidate-actions button {
    width: 100%;
  }

  .dashboard-actions {
    justify-content: stretch;
  }

  .hero-panel {
    padding: 14px;
  }

  .hero-panel .stats-grid.compact {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .hero-panel .stat-card {
    min-height: 74px;
    padding: 12px;
  }

  .section-head {
    align-items: stretch;
  }

  .stats-grid,
  .candidate-grid,
  .form-grid,
  .partner-grid,
  .contact-grid,
  .info-grid,
  .checkout-recap,
  .candidate-actions {
    grid-template-columns: 1fr;
  }

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

  .rank-list li {
    grid-template-columns: 32px minmax(0, 1fr);
  }

  .rank-list strong {
    grid-column: 2;
  }
}

@media (max-width: 420px) {
  .site-header {
    padding: 10px 12px;
  }

  #app {
    padding: 12px 8px 36px;
  }

  .hero-copy,
  .auth-screen,
  .section,
  .page-head,
  .dashboard-head,
  .login-card,
  .vote-modal {
    padding: 14px;
  }

  .hero-copy h1,
  .page-head h1,
  .auth-screen h1,
  .dashboard-head h1 {
    font-size: 32px;
  }

  .candidate-body,
  .stat-card,
  .partner-grid article,
  .contact-grid article,
  .info-grid article,
  .participation-box,
  .terms-list {
    padding: 12px;
  }

  .main-nav button,
  .primary,
  .ghost,
  .danger,
  .checkout-total,
  .candidate-actions button {
    min-height: 44px;
  }

  .checkout-total {
    grid-template-columns: 1fr;
  }
}
