/* Global layout primitives shared by all routes. */
:root {
  --bxc-color-primary: #1d87f8;
  --bxc-color-primary-dark: #0056b3;
  --bxc-color-border: #dbe3ef;
  --bxc-color-surface: #ffffff;
  --bxc-color-surface-muted: #f8fafc;
  --bxc-color-text: #0f172a;
  --bxc-color-muted: #64748b;
  --bxc-radius: 8px;
  --bxc-radius-sm: 6px;
  --bxc-touch-target: 44px;
  --bxc-page-gutter: clamp(0.72rem, 2vw, 1.25rem);
  --bxc-section-gap: clamp(0.75rem, 1.6vw, 1.25rem);
  --bxc-card-padding: clamp(0.78rem, 1.5vw, 1.1rem);
  --bxc-shadow-soft: 0 10px 24px rgba(15, 23, 42, 0.06);
  --bxc-page-max-width: 1920px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  line-height: 1.5;
  background-color: #ffffff;
  color: #1f2933;
  overflow-x: clip;
}

a {
  color: inherit;
}

a:hover {
  color: inherit;
}

img,
svg,
video {
  max-width: 100%;
  height: auto;
}

.glider-display {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  vertical-align: middle;
}

.glider-display__logo-link {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}

.glider-display__logo {
  width: 68px;
  height: 24px;
  object-fit: contain;
  flex: 0 0 auto;
}

.glider-display__text {
  display: inline;
  min-width: 0;
}

.glider-display__manufacturer {
  font-weight: 650;
  text-decoration: none;
}

a.glider-display__manufacturer:hover,
a.glider-display__manufacturer:focus {
  text-decoration: underline;
}

.glider-display__model {
  overflow-wrap: anywhere;
}

input,
button,
select,
textarea {
  font: inherit;
  max-width: 100%;
}

textarea {
  max-width: 100%;
}

button,
[role="button"],
input[type="button"],
input[type="submit"],
input[type="reset"],
a[class*="button"],
a[class*="__button"],
a[class*="__action"],
button[class*="button"],
button[class*="__button"],
button[class*="__action"] {
  touch-action: manipulation;
}

input[type="button"],
input[type="submit"],
input[type="reset"],
select {
  min-height: var(--bxc-touch-target);
}

@media (max-width: 768px), (pointer: coarse) {
  button,
  input[type="button"],
  input[type="submit"],
  input[type="reset"],
  select {
    min-height: var(--bxc-touch-target);
  }
}

:where(table) {
  max-width: 100%;
}

:where(
  .table-responsive,
  .table-wrapper,
  .table-wrap,
  [class$="__table-wrapper"],
  [class$="-table-wrapper"],
  [class$="__table-wrap"],
  [class$="-table-wrap"],
  [class*="table-scroll"]
) {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-inline: contain;
}

:where(
  .btn,
  .button-link,
  .link-button,
  .nav-button,
  .contest-button,
  .public-flights__action,
  .public-flights__header-action,
  .school-hub__button,
  .school-hub__action,
  .schools__btn,
  .courses__btn,
  .clubs__btn,
  .club-admin__btn,
  .profile-btn,
  .pilot-directory__action,
  .pilot-directory__row-action,
  .quests-btn,
  .my-quests__btn,
  .org-join__btn,
  .flight-view__action,
  .live-tracking__button,
  .email-preferences-btn,
  .account-delete-status__button,
  .flight-upload__submit,
  .flight-upload__action
) {
  display: inline-flex;
  min-height: var(--bxc-touch-target);
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  line-height: 1.2;
  text-align: center;
  text-wrap: balance;
}

:focus-visible {
  outline: 2px solid #1d87f8 !important;
  outline-offset: 2px;
}

@media (prefers-color-scheme: dark) {
  .sticky-header {
    background: #222;
    color: #fff;
  }

  .modus-aktivierung {
    background: #43a047 !important;
  }

  .modus-verlaengerung {
    background: #66bb6a !important;
  }

  .modus-ablehnung {
    background: #e53935 !important;
  }

  .modus-deaktivierung {
    background: #ffa726 !important;
    color: #222 !important;
  }

  .modus-speichern {
    background: #43a047 !important;
  }

}

.hint {
  font-size: 0.9rem;
  font-style: italic;
  color: #666;
  margin-top: 0.3rem;
}

body.dark-mode .hint {
  color: #e8b02e;
}

.warntext {
  margin-top: 0.3rem;
  color: red;
  font-size: 0.95rem;
  margin: 1rem 0;
}

body.dark-mode .warntext {
  color: #ff6b6b;
}

.nav-button, .nav-dropdown .nav-button {
  background-color: #3498ff;
  color: #fff;
  border: none;
  padding: 8px 12px;
  text-decoration: none;
  cursor: pointer;
  border-radius: 4px;
  font-size: 14px;
  transition: background 0.2s;
  margin: 0;
}

.nav-button:hover,
.nav-button:focus-visible {
  background-color: #1976d2;
  color: #fff;
}

.nav-dropdown .nav-button:hover,
.nav-dropdown .nav-button:focus-visible {
  background: #0056b3;
  color: #fff;
}

body.dark-mode .nav-dropdown .nav-button {
  background: #444;
  color: #fff;
}

body.dark-mode .nav-dropdown .nav-button:hover,
body.dark-mode .nav-dropdown .nav-button:focus-visible {
  background: #666;
  color: #fff;
}

.nav-button:disabled,
.nav-button[aria-disabled="true"] {
  background-color: #8ea8c2;
  color: #f5f7fa;
  cursor: not-allowed;
}

body.dark-mode .nav-button {
  background-color: #444;
  color: #fff;
}

body.dark-mode .nav-button:hover,
body.dark-mode .nav-button:focus-visible {
  background-color: #666;
  color: #fff;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

.link-button {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  background: #1d87f8;
  color: #fff !important;
  border: none;
  border-radius: 5px;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.3s;
}

.link-button:hover, .link-button:focus {
  background: #0056b3;
  color: #fff !important;
  text-decoration: none;
}

body.dark-mode .link-button {
  background: #444;
  color: #fff !important;
}

body.dark-mode .link-button:hover, body.dark-mode .link-button:focus {
  background: #666;
  color: #fff !important;
}

.user-dropdown.open .user-dropdown-content {
  display: block;
}

.cancel-button {
  background: #bbb;
  color: #222;
  border: none;
  border-radius: 4px;
  padding: 8px 12px;
  min-width: 120px;
  cursor: pointer;
  transition: background 0.2s;
}

.cancel-button:hover {
  background: #999;
}

.dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 7px;
  vertical-align: middle;
}

.dot.green {
  background: #4caf50;
}

.dot.gray {
  background: #bbb;
}

body.dark-mode .dot.green {
  background: #7fff7f;
}

body.dark-mode .dot.gray {
  background: #555;
}

.tower-dropdown.open .tower-dropdown-content {
  display: block;
}

.pagination {
  margin-top: 1.5rem;
  text-align: center;
}

.pagination a {
  display: inline-block;
  margin: 0 5px;
  padding: 0.5rem 1rem;
  border-radius: 5px;
  background: #ddd;
  color: #333;
  text-decoration: none;
  transition: background 0.2s ease;
}

@media (max-width: 640px) {
  .pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.45rem;
    margin-top: 1rem;
  }

  .pagination a {
    margin: 0;
    flex: 1 1 8rem;
    max-width: 14rem;
  }
}

.pagination a:hover {
  background: #bbb;
}

body.dark-mode .pagination a {
  background: #333;
  color: #eee;
}

body.dark-mode .pagination a:hover {
  background: #555;
}

.history-list-header, .user-list-header, .history-list-row, .user-list-row {
  background: #fff;
  color: #222;
}

.history-list-header, .user-list-header {
  font-weight: bold;
  background: #f0f0f0;
  border-bottom: 2px solid #ccc;
}

body.dark-mode .history-list-header, body.dark-mode .audit-list-header, body.dark-mode .user-list-header {
  background: #2a3b5a !important;
  color: #fff !important;
  border-bottom: 2px solid #1a2233 !important;
}

body.dark-mode .history-list-row, body.dark-mode .audit-list-row, body.dark-mode .user-list-row {
  background: #23272e !important;
  color: #eee !important;
  border-bottom: 1px solid #333 !important;
}

.col-user, .col-verein {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

@media (max-width: 700px) {
  .col-id, .col-status, .col-verein, .col-user {
    display: none;
  }

  .history-list-header > .col-id, .history-list-header > .col-status, .history-list-header > .col-verein, .history-list-header > .col-user {
    display: none;
  }

  .history-list-row > .col-id, .history-list-row > .col-status, .history-list-row > .col-verein, .history-list-row > .col-user {
    display: none;
  }

}

@media (max-width: 900px) {
  .col-user, .col-verein {
    max-width: 80px;
  }

}

.statistic-center-wrapper form, .statistic-center-wrapper > h2, .statistic-center-wrapper > canvas, .statistic-center-wrapper .history-list {
  width: 100%;
  max-width: 100%;
  margin-left: 0;
  margin-right: 0;
  text-align: left;
}

.tra-aktivierung-reiter {
  display: block;
  font-weight: 600;
  background: #fafafa;
  padding: 0.7em 1.5em 0.5em 1.5em;
  color: #1a4a7a;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
  letter-spacing: 0.01em;
  text-align: left;
  position: relative;
  z-index: 2;
  min-width: 140px;
}

body.dark-mode .tra-aktivierung-reiter {
  background: #23272e;
  border-color: #333;
  color: #7fc1ff;
}

.zeltweg-manned-flex {
  display: flex;
  flex-direction: row;
  align-items: stretch;
}

.zeltweg-manned-input-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.zeltweg-manned-title {
  font-size: 1.1em;
  font-weight: 600;
  margin-bottom: 0.7em;
  color: #0d2a4a;
}

body.dark-mode .zeltweg-manned-title {
  color: #b3d1ff;
}

.zeltweg-manned-input-row {
  display: flex;
  gap: 1.2em;
  margin-bottom: 0.7em;
}

.zeltweg-manned-input-wrap {
  flex: 1;
}

.zeltweg-manned-input {
  background: #eaf3fb;
  border: 1px solid #b3c6e0;
  border-radius: 6px;
  padding: 0.4em 0.7em;
  font-size: 1em;
  color: #0d2a4a;
  width: 100%;
  box-sizing: border-box;
  margin-top: 0.2em;
}

body.dark-mode .zeltweg-manned-input {
  background: #22304a;
  border: 1px solid #3a4a6a;
  color: #b3d1ff;
}

.zeltweg-manned-aupinfo {
  background: #e3f2fd;
  color: #1565c0;
  padding: 0.8em 1em;
  margin: 1em 0 1em 0;
}

body.dark-mode .zeltweg-manned-aupinfo {
  background: #1b2a3a;
  color: #7bb6ff;
}

.aup-archive-list-row a.link-button {
  padding: 0.4em 1em;
  font-size: 1rem;
  background: #1d87f8;
  color: #fff;
  border-radius: 4px;
  text-decoration: none;
  transition: background 0.2s;
}

.aup-archive-list-row a.link-button:hover, .aup-archive-list-row a.link-button:focus {
  background: #0056b3;
}

body.dark-mode .aup-archive-list-row a.link-button {
  background: #0056b3;
  color: #fff;
}

body.dark-mode .aup-archive-list-row a.link-button:hover, body.dark-mode .aup-archive-list-row a.link-button:focus {
  background: #1d87f8;
}

.history-list-header, .user-list-header, .tra-list-header, .verein-list-header, .tower-list-header, .sys-pages-list-header, .audit-list-header {
  display: grid;
  align-items: center;
  padding: 0.7rem 1rem;
  font-weight: bold;
  background: #f0f0f0;
  color: #222;
  border-bottom: 2px solid #ccc;
  border-radius: 8px 8px 0 0;
}

.history-list-row, .user-list-row, .tra-list-row, .verein-list-row, .tower-list-row, .audit-list-row {
  display: grid;
  align-items: center;
  padding: 0.7rem 1rem;
  background: #fff;
  color: #222;
  border-bottom: 1px solid #eee;
  border-radius: 0;
  transition: background 0.2s;
}

.history-list-row:last-child, .user-list-row:last-child, .tra-list-row:last-child, .verein-list-row:last-child, .tower-list-row:last-child, .audit-list-row:last-child {
  border-bottom: none;
}

.history-list-row:hover, .user-list-row:hover, .tra-list-row:hover, .verein-list-row:hover, .tower-list-row:hover, .audit-list-row:hover {
  background: #f5faff;
}

body.dark-mode .history-list-header, body.dark-mode .user-list-header, body.dark_mode .tra-list-header, body.dark_mode .verein-list-header, body.dark_mode .tower-list-header, body.dark_mode .audit-list-header {
  background: #2a3b5a !important;
  color: #fff !important;
  border-bottom: 2px solid #1a2233 !important;
}

body.dark-mode .history-list-row, body.dark-mode .user-list-row, body.dark-mode .tra-list-row, body.dark-mode .verein-list-row, body.dark-mode .tower-list-row, body.dark-mode .audit-list-row {
  background: #23272e !important;
  color: #eee !important;
  border-bottom: 1px solid #333 !important;
}

body.dark-mode .history-list-row:hover, body.dark-mode .user-list-row:hover, body.dark-mode .tra-list-row:hover, body.dark-mode .verein-list-row:hover, body.dark-mode .tower-list-row:hover, body.dark-mode .audit-list-row:hover {
  background: #28304a !important;
}

.sponsor-banner {
  width: 100vw;
  max-width: 100vw;
  background: #e6edf7;
  padding: 0.5rem 0 0.46rem;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

body.dark-mode .sponsor-banner {
  background: #0f172a;
}

.sponsor-banner__inner {
  width: 100%;
  margin: 0 auto;
  position: relative;
  padding: 0 2.5vw;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
}

.sponsor-banner__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem 0.8rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #0b2e4e;
}

.sponsor-banner__legend-item {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

body.dark-mode .sponsor-banner__legend {
  color: #d7e2f7;
}

.sponsor-banner__track {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-start;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  overflow: hidden;
}

.sponsor-banner__item {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex: 0 0 auto;
}

.sponsor-banner__item img {
  display: block;
  max-height: 64px;
  height: 48px;
  width: auto;
  min-width: 72px;
}

.sponsor-banner__item:focus-visible {
  outline: 2px solid rgba(29, 135, 248, 0.45);
  outline-offset: 4px;
}

.cookie-hint {
  position: fixed;
  bottom: 0.8rem;
  right: 0.8rem;
  left: auto;
  z-index: 9999;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  justify-content: flex-start;
  width: min(440px, calc(100vw - 1.6rem));
  padding: 0.48rem 0.66rem;
  background: rgba(15, 23, 42, 0.96);
  color: #fff;
  text-align: left;
  box-shadow: 0 -6px 18px rgba(15, 23, 42, 0.2);
  font-size: 0.8rem;
  line-height: 1.28;
  border-radius: 10px;
}

.cookie-hint__link {
  color: #fff;
  text-decoration: underline;
}

.cookie-hint__button {
  margin-left: 0.25rem;
}

.cookie-hint[hidden] {
  display: none;
}

@media (max-width: 680px) {
  .sponsor-banner__inner {
    align-items: stretch;
    gap: 1.2rem;
  }

  .sponsor-banner__legend {
    justify-content: center;
    text-align: center;
  }

  .sponsor-banner__track {
    justify-content: center;
  }

  .cookie-hint {
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    border-radius: 0;
    flex-direction: column;
    text-align: center;
    justify-content: center;
  }
}

.site-footer {
  background: linear-gradient(0deg, #253446 0%, #2f4560 100%);
  color: #f5f8ff;
  padding: 0.78rem 0.82rem 0.9rem;
}

body.dark-mode .site-footer {
  background: linear-gradient(0deg, #131c2a 0%, #1c2d3e 100%);
  color: #d7e2f7;
}

.site-footer__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.62rem;
}

.site-footer__section {
  display: flex;
  flex-direction: column;
  gap: 0.36rem;
  font-size: 0.86rem;
  line-height: 1.45;
}

.site-footer__nav {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  color: rgba(222, 231, 247, 0.88);
}

body.dark-mode .site-footer__nav {
  color: rgba(207, 219, 244, 0.82);
}

.site-footer__links {
  font-weight: 500;
  font-size: 0.82rem;
  line-height: 1.35;
}

.site-footer__links-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
  justify-content: center;
  margin: 0;
  text-align: center;
}

.site-footer__links-row a {
  color: inherit;
  text-decoration: underline;
}

.site-footer__divider {
  color: rgba(219, 231, 255, 0.35);
}

body.dark-mode .site-footer__divider {
  color: rgba(210, 222, 247, 0.25);
}

.site-footer__columns {
  display: grid;
  gap: 0.58rem;
  width: 100%;
}

.site-footer__columns .site-footer__section {
  background: rgba(247, 250, 255, 0.92);
  color: #1b2736;
  padding: 0.62rem 0.7rem;
  border-radius: 8px;
  box-shadow: 0 8px 16px rgba(9, 17, 30, 0.08);
}

body.dark-mode .site-footer__columns .site-footer__section {
  background: rgba(11, 20, 32, 0.55);
  color: #dfe8ff;
  box-shadow: 0 8px 18px rgba(3, 6, 12, 0.44);
}

.site-footer__columns .site-footer__section p,
.site-footer__columns .site-footer__section a {
  color: inherit;
}

.site-footer__disclaimer a {
  color: #aedbff;
}

body.dark-mode .site-footer__disclaimer a {
  color: #82b8ff;
}

.site-footer__support-text {
  margin: 0;
  font-weight: 600;
  font-size: 0.84rem;
  color: #aedbff;
}

body.dark-mode .site-footer__support-text {
  color: #aedb34;
}

.site-footer__donation-form {
  display: flex;
  align-items: center;
  gap: 0.28rem;
  justify-content: center;
}

.site-footer__donate-button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffc439 0%, #ffb347 100%);
  color: #1f2937;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.48rem;
  font: inherit;
  font-weight: 700;
  justify-content: center;
  line-height: 1;
  min-width: 132px;
  padding: 0.7rem 1.08rem;
  box-shadow: 0 10px 24px rgba(255, 196, 57, 0.28);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.site-footer__donate-button:hover,
.site-footer__donate-button:focus-visible {
  filter: brightness(1.03);
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(255, 196, 57, 0.34);
}

.site-footer__donate-button:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.52);
  outline-offset: 2px;
}

.site-footer__donate-button i {
  font-size: 1rem;
}

body.dark-mode .site-footer__donate-button {
  background: linear-gradient(135deg, #ffd86b 0%, #ffbf47 100%);
  color: #172033;
}

@media (max-width: 768px) {
  .sponsor-banner {
    padding: 0.54rem 0;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
  }

  .sponsor-banner__track {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.54rem 0.74rem;
  }

  .sponsor-banner__item img {
    height: auto;
    max-height: 72px;
    max-width: 170px;
    min-width: 92px;
    width: auto;
  }

  .site-footer {
    padding: 0.68rem 0.68rem 0.82rem;
  }

  .site-footer__links-row {
    justify-content: center;
    text-align: center;
  }

  .site-footer__support-text {
    text-align: center;
  }

  .site-footer__donation-form {
    flex-direction: column;
  }
}

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

  .site-footer__section {
    min-height: 100%;
    justify-content: center;
  }

  .site-footer__support {
    align-items: center;
    justify-content: center;
  }
}

@media (max-width: 899px) {
  .site-footer__columns {
    grid-template-columns: 1fr;
  }
}

.country-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.country-flag-icon {
  width: 20px;
  height: 14px;
  max-width: 20px;
  max-height: 14px;
  min-width: 20px;
  inline-size: 20px;
  block-size: 14px;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
  object-fit: cover;
  flex: 0 0 20px;
  display: inline-block;
}

.country-label__text {
  display: inline-flex;
  align-items: center;
}
