:root {
  --navy: #123047;
  --navy-dark: #0a2232;
  --navy-light: #1b435e;
  --blue: #237e9e;
  --turquoise: #36b7ad;
  --turquoise-dark: #238f88;
  --sand: #f1b65a;
  --light: #eef4f5;
  --white: #ffffff;
  --text: #23323b;
  --muted: #687983;
  --border: #d9e4e6;
  --green: #4b9b72;
  --green-light: #edf7f1;
  --red: #c6645a;
  --red-light: #fff1ef;
  --gold: #e5a93e;
  --shadow: 0 20px 55px rgba(18, 48, 71, 0.12);
  --small-shadow: 0 10px 30px rgba(18, 48, 71, 0.09);
  --radius-large: 28px;
  --radius-medium: 18px;
  --radius-small: 12px;
  --content-width: 1200px;
  --header-height: 76px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 20px);
}

body {
  margin: 0;
  background: var(--white);
  color: var(--text);
  font-family: "Aptos", "Segoe UI", Arial, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  color: var(--navy);
  line-height: 1.1;
}

h1 {
  margin-bottom: 22px;
  font-size: clamp(2.5rem, 6vw, 5rem);
  letter-spacing: -0.055em;
}

h2 {
  margin-bottom: 18px;
  font-size: clamp(1.7rem, 4vw, 2.7rem);
  letter-spacing: -0.035em;
}

h3 {
  margin-bottom: 10px;
}

.content-container {
  width: min(calc(100% - 48px), var(--content-width));
  margin-inline: auto;
}

.eyebrow {
  margin-bottom: 10px;
  color: var(--blue);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.hidden {
  display: none !important;
}

/* Navigation */

.site-header {
  position: sticky;
  z-index: 1000;
  top: 0;
  height: var(--header-height);
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(15px);
}

.navigation-container {
  width: min(calc(100% - 48px), var(--content-width));
  height: 100%;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--turquoise);
  color: var(--white);
  font-size: 0.78rem;
  font-weight: 900;
  transform: rotate(-4deg);
}

.brand-text {
  display: flex;
  flex-direction: column;
  color: var(--navy);
  line-height: 1.1;
}

.brand-text small {
  margin-top: 4px;
  color: var(--muted);
}

.main-navigation {
  display: flex;
  align-items: center;
  gap: 4px;
}

.main-navigation a {
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--navy);
  font-size: 0.88rem;
  font-weight: 800;
  text-decoration: none;
}

.main-navigation a:hover {
  background: var(--light);
}

.main-navigation .navigation-vote {
  background: var(--turquoise);
  color: var(--white);
}

.menu-button {
  display: none;
  border: 0;
  background: none;
  color: var(--navy);
  font-weight: 800;
}

.menu-icon {
  width: 23px;
  margin-left: 8px;
  display: inline-grid;
  gap: 4px;
}

.menu-icon i {
  height: 2px;
  background: currentColor;
}

/* Allgemeine Formulare */

input,
select {
  width: 100%;
  min-height: 50px;
  padding: 11px 14px;
  border: 1px solid #bdcdd1;
  border-radius: 10px;
  background: var(--white);
  color: var(--text);
}

input:focus,
select:focus {
  border-color: var(--turquoise);
  outline: 3px solid rgba(54, 183, 173, 0.18);
}

label {
  color: var(--navy);
  font-weight: 750;
}

.primary-button,
.secondary-button,
.text-button {
  min-height: 50px;
  padding: 12px 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
}

.primary-button {
  background: var(--turquoise);
  color: var(--white);
}

.primary-button:hover {
  background: var(--turquoise-dark);
}

.secondary-button {
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--navy);
}

.text-button {
  background: transparent;
  color: var(--blue);
}

.light-button {
  border-color: rgba(255, 255, 255, 0.45);
  background: transparent;
  color: var(--white);
}

.light-text {
  color: var(--white);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* Meldungen */

.alert {
  margin-bottom: 22px;
  padding: 16px 18px;
  border-radius: 12px;
  font-size: 0.92rem;
}

.alert-error {
  border-left: 5px solid var(--red);
  background: var(--red-light);
  color: #8b3932;
}

.alert-success {
  border-left: 5px solid var(--green);
  background: var(--green-light);
  color: #2d684b;
}

.alert-warning {
  border-left: 5px solid var(--sand);
  background: #fff8e9;
  color: #725a27;
}

.alert-info {
  border-left: 5px solid var(--blue);
  background: var(--light);
}

/* Abstimmung */

.voting-hero,
.results-hero,
.admin-hero {
  padding-block: 70px;
  background: linear-gradient(120deg, var(--navy-dark), var(--blue));
  color: var(--white);
}

.voting-hero h1,
.results-hero h1,
.admin-hero h1 {
  color: var(--white);
}

.voting-hero p,
.results-hero p,
.admin-hero p {
  max-width: 720px;
  color: rgba(255, 255, 255, 0.82);
}

.voting-hero .eyebrow,
.results-hero .eyebrow,
.admin-hero .eyebrow {
  color: var(--sand);
}

.voting-hero-content,
.results-hero-content,
.admin-hero > .content-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
}

.deadline-card {
  flex: 0 0 190px;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-medium);
  background: rgba(255, 255, 255, 0.1);
  text-align: center;
}

.deadline-card small,
.deadline-card strong,
.deadline-card span {
  display: block;
}

.deadline-card strong {
  margin-block: 5px;
  font-size: 1.5rem;
}

.voting-section,
.results-section,
.admin-section {
  padding-block: 70px;
  background: #f6f9f9;
}

.voting-container {
  max-width: 1100px;
}

.login-card,
.closed-card,
.thank-you-card,
.setup-card {
  max-width: 660px;
  margin-inline: auto;
  padding: 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius-large);
  background: var(--white);
  box-shadow: var(--shadow);
}

.code-form,
.setup-form {
  margin-top: 28px;
  display: grid;
  gap: 15px;
}

.authenticated-code {
  margin-bottom: 25px;
  padding: 17px 20px;
  display: flex;
  align-items: center;
  gap: 20px;
  border-radius: 15px;
  background: var(--navy);
  color: var(--white);
}

.authenticated-code div {
  flex: 1;
}

.authenticated-code small,
.authenticated-code strong {
  display: block;
}

.authenticated-code code {
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
}

.authenticated-code a {
  font-weight: 800;
}

.voting-form {
  display: grid;
  gap: 30px;
}

.voting-step,
.voting-submit {
  padding: 35px;
  border: 1px solid var(--border);
  border-radius: var(--radius-large);
  background: var(--white);
  box-shadow: var(--small-shadow);
}

.step-heading {
  margin-bottom: 30px;
  display: flex;
  gap: 18px;
}

.step-heading > span {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--turquoise);
  color: var(--white);
  font-weight: 900;
}

.step-heading h2 {
  margin-bottom: 8px;
}

.step-heading p:last-child {
  color: var(--muted);
}

.main-choice-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 17px;
}

.choice-card {
  position: relative;
  overflow: hidden;
  border: 3px solid transparent;
  border-radius: 18px;
  background: var(--light);
  cursor: pointer;
}

.choice-card:has(input:checked) {
  border-color: var(--turquoise);
  box-shadow: 0 0 0 4px rgba(54, 183, 173, 0.15);
}

.choice-card input {
  position: absolute;
  z-index: 2;
  top: 12px;
  right: 12px;
  width: 24px;
  min-height: 24px;
  accent-color: var(--turquoise);
}

.choice-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.choice-content {
  padding: 18px;
  display: grid;
  gap: 7px;
}

.choice-content strong {
  color: var(--navy);
  font-size: 1.25rem;
}

.choice-content small {
  min-height: 44px;
  color: var(--muted);
}

.choice-content b {
  color: var(--blue);
}

.ranking-grid {
  display: grid;
  gap: 16px;
}

.ranking-card {
  display: grid;
  grid-template-columns: 210px 1fr;
  overflow: hidden;
  border: 2px solid var(--border);
  border-radius: 16px;
}

.ranking-card img {
  width: 100%;
  height: 100%;
  min-height: 175px;
  object-fit: cover;
}

.ranking-card-content {
  padding: 21px;
}

.ranking-title {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.ranking-title p {
  color: var(--muted);
}

.ranking-title > strong {
  color: var(--blue);
  white-space: nowrap;
}

.ranking-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}

.ranking-options label {
  cursor: pointer;
}

.ranking-options input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.ranking-options span {
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-size: 0.82rem;
}

.ranking-options b {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--light);
}

.ranking-options input:checked + span {
  border-color: var(--turquoise);
  background: rgba(54, 183, 173, 0.1);
}

.ranking-options input:checked + span b {
  background: var(--turquoise);
  color: var(--white);
}

.voting-submit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
}

/* Danke */

.thank-you-section,
.protected-page {
  min-height: calc(100vh - var(--header-height));
  padding-block: 80px;
  background: var(--light);
}

.thank-you-card {
  text-align: center;
}

.success-icon {
  width: 70px;
  height: 70px;
  margin: 0 auto 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--green);
  color: var(--white);
  font-size: 2rem;
}

.vote-summary {
  margin-block: 30px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  text-align: left;
}

.vote-summary article {
  padding: 17px;
  border-radius: 12px;
  background: var(--light);
}

.vote-summary small,
.vote-summary strong {
  display: block;
}

.vote-summary small {
  color: var(--muted);
}

/* Ergebnisse */

.statistics-grid {
  margin-bottom: 25px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.statistics-grid article,
.result-card,
.admin-card {
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-medium);
  background: var(--white);
  box-shadow: var(--small-shadow);
}

.statistics-grid small,
.statistics-grid strong {
  display: block;
}

.statistics-grid small {
  color: var(--muted);
}

.statistics-grid strong {
  margin-top: 6px;
  color: var(--navy);
  font-size: 2rem;
}

.result-card + .result-card {
  margin-top: 24px;
}

.result-bars {
  display: grid;
  gap: 22px;
}

.result-label {
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  gap: 15px;
}

.result-label span {
  color: var(--muted);
  font-size: 0.85rem;
}

.bar-track {
  height: 15px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--light);
}

.bar-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--turquoise), var(--blue));
}

.finca-ranking-results {
  display: grid;
  gap: 16px;
}

.finca-result {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 17px;
}

.rank-number {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--gold);
  color: var(--white);
  font-weight: 900;
}

.points {
  color: var(--navy);
}

/* Admin */

.admin-grid {
  margin-bottom: 24px;
  display: grid;
  grid-template-columns: 1fr 0.7fr;
  gap: 24px;
}

.admin-card form {
  display: grid;
  gap: 15px;
}

.status-value {
  display: block;
  margin-block: 20px;
  color: var(--turquoise-dark);
  font-size: 2rem;
}

.admin-table-heading {
  display: flex;
  justify-content: space-between;
  gap: 30px;
}

.admin-table-scroll {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  min-width: 1250px;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  padding: 13px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 0.82rem;
}

.status-badge {
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
}

.status-badge.active {
  background: var(--green-light);
  color: var(--green);
}

.status-badge.inactive {
  background: var(--red-light);
  color: var(--red);
}

.inline-actions {
  display: flex !important;
  flex-direction: row;
  gap: 6px !important;
}

.small-button {
  padding: 7px 9px;
  border: 0;
  border-radius: 7px;
  background: var(--light);
  color: var(--navy);
  cursor: pointer;
}

.danger-button {
  background: var(--red-light);
  color: var(--red);
}

/* Setup */

.setup-page {
  min-height: 100vh;
  padding: 50px 20px;
  background: var(--light);
}

.setup-container {
  max-width: 760px;
  margin-inline: auto;
}

.setup-card pre {
  padding: 18px;
  overflow-x: auto;
  border-radius: 12px;
  background: var(--navy-dark);
  color: var(--white);
}

/* Footer */

.site-footer {
  padding-block: 35px;
  background: var(--navy-dark);
  color: var(--white);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  gap: 25px;
}

.footer-content p {
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.65);
}

.footer-content a {
  font-weight: 800;
}

/* Responsive */

@media (max-width: 900px) {
  .main-choice-grid,
  .statistics-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .main-choice-grid .choice-card:last-child {
    grid-column: 1 / -1;
  }

  .admin-grid {
    grid-template-columns: 1fr;
  }

  .ranking-card {
    grid-template-columns: 160px 1fr;
  }
}

@media (max-width: 700px) {
  :root {
    --header-height: 68px;
  }

  .content-container,
  .navigation-container {
    width: min(calc(100% - 30px), var(--content-width));
  }

  .brand-text {
    display: none;
  }

  .menu-button {
    display: flex;
    align-items: center;
  }

  .main-navigation {
    position: fixed;
    top: var(--header-height);
    right: 0;
    left: 0;
    padding: 18px 15px;
    display: grid;
    border-top: 1px solid var(--border);
    background: var(--white);
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
  }

  .main-navigation.navigation-open {
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .main-navigation a {
    padding: 13px;
    border-radius: 10px;
    background: var(--light);
  }

  .voting-hero,
  .results-hero,
  .admin-hero {
    padding-block: 45px;
  }

  .voting-hero-content,
  .results-hero-content,
  .admin-hero > .content-container {
    align-items: stretch;
    flex-direction: column;
  }

  .deadline-card {
    flex: auto;
  }

  .voting-section,
  .results-section,
  .admin-section {
    padding-block: 40px;
  }

  .login-card,
  .closed-card,
  .thank-you-card,
  .setup-card,
  .voting-step,
  .voting-submit {
    padding: 24px;
  }

  .authenticated-code {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .main-choice-grid,
  .statistics-grid,
  .vote-summary {
    grid-template-columns: 1fr;
  }

  .main-choice-grid .choice-card:last-child {
    grid-column: auto;
  }

  .choice-card img {
    height: 155px;
  }

  .ranking-card {
    grid-template-columns: 1fr;
  }

  .ranking-card img {
    height: 180px;
  }

  .ranking-title {
    flex-direction: column;
    gap: 5px;
  }

  .ranking-options {
    grid-template-columns: 1fr;
  }

  .voting-submit {
    align-items: stretch;
    flex-direction: column;
  }

  .voting-submit .primary-button {
    width: 100%;
  }

  .finca-result {
    grid-template-columns: 37px 1fr;
  }

  .finca-result .points {
    grid-column: 2;
  }

  .result-label {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .admin-table-heading,
  .footer-content {
    align-items: flex-start;
    flex-direction: column;
  }

  .button-row {
    width: 100%;
    flex-direction: column;
  }

  .button-row a {
    width: 100%;
  }
}

@media (max-width: 390px) {
  .content-container,
  .navigation-container {
    width: min(calc(100% - 22px), var(--content-width));
  }

  h1 {
    font-size: 2.4rem;
  }

  .ranking-card-content {
    padding: 17px;
  }
}