* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
  color: rgba(3, 50, 82, 0.85);
  background: #FAF8F3;
}
a {
  color: #2E7A9E;
  text-decoration: none;
}
a:hover,
a:focus {
  color: #2F7B9F;
  text-decoration: underline;
}

/* Header */
.site-header {
  background-color: #033252;
  background-size: cover;
  background-position: center;
  min-height: 200px;
  position: relative;
  display: flex;
  align-items: center;
}
.header-overlay {
  background: rgba(3, 50, 82, 0.85);
  color: #FAF8F3;
  width: 100%;
  display: flex;
  gap: 1rem;
  align-items: center;
  padding: 1.5rem 2rem;
}
.logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
  background: rgba(250, 248, 243, 0.9);
  border-radius: 12px;
  padding: 6px;
}
.titles h1 {
  margin: 0;
  font-size: 2rem;
  color: #FAF8F3;
}
.subtitle {
  margin: 0.25rem 0 0;
  color: #FFFFF9;
}

/* Navigation */
.site-nav {
  background: #033252;
  position: sticky;
  top: 0;
  z-index: 10;
}
.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 1rem;
}
.menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1rem;
}
.menu > .menu-item { position: relative; }
.menu a {
  display: block;
  padding: 0.9rem 0.75rem;
  color: #FAF8F3;
  text-decoration: none;
  font-weight: 600;
}
.menu a:hover { color: #2E7A9E; }
.menu-item.active > a {
  color: #2E7A9E;
  border-bottom: 2px solid #2E7A9E;
}

.auth-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.auth-nav-label {
  color: #FAF8F3;
  font-weight: 600;
}
.logout-form {
  margin: 0;
}

/* Submenu */
.submenu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background: #033252;
  box-shadow: 0 6px 24px rgba(3, 50, 82, 0.25);
  padding: 0.25rem 0;
  list-style: none;
  margin: 0;
  border-radius: 0 0 12px 12px;
  z-index: 20;
  border: 1px solid #E0E0DC;
}
.submenu li a {
  padding: 0.75rem 1rem;
  color: #FAF8F3;
}
.submenu li a:hover {
  color: #2E7A9E;
  background: rgba(250, 248, 243, 0.08);
}
.submenu li.active > a {
  color: #2E7A9E;
  background: rgba(250, 248, 243, 0.12);
}
.menu-item.has-children:hover > .submenu { display: block; }

/* Content */
.content {
  padding: 2rem 1.25rem;
  max-width: 1100px;
  margin: 0 auto;
  line-height: 1.7;
}
.content-wrapper {
  background: #FFFFF9;
  padding: 1.5rem;
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(3, 50, 82, 0.08);
  border: 1px solid #E0E0DC;
}
.content-wrapper h2 { margin-top: 0; }

/* Footer */
.site-footer {
  background: #033252;
  color: #FAF8F3;
  padding: 2rem 1.25rem 1rem;
  margin-top: 3rem;
}
.footer-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  max-width: 1100px;
  margin: 0 auto 1rem;
}
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin: 0.25rem 0; }
.footer-links a { color: #FAF8F3; }
.footer-links a:hover { color: #2E7A9E; }
.copyright {
  text-align: center;
  opacity: 0.85;
  font-size: 0.95rem;
  color: #FFFFF9;
}

/* Buttons (generic) */
.btn-primary {
  display: inline-block;
  background: #2E7A9E;
  color: #FAF8F3;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
}
.btn-primary:hover {
  background: #2F7B9F;
  color: #FFFFF9;
}
.btn-secondary {
  display: inline-block;
  background: transparent;
  color: #2E7A9E;
  border: 2px solid #2E7A9E;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
}
.btn-secondary:hover {
  background: #033252;
  color: #FAF8F3;
}

.btn-small {
  padding: 0.4rem 0.85rem;
  font-size: 0.9rem;
}

.btn-outline {
  display: inline-block;
  background: transparent;
  color: #033252;
  border: 2px solid #033252;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
}
.btn-outline:hover {
  background: rgba(3, 50, 82, 0.08);
  color: #033252;
}

/* Metadata */
small,
.meta,
.time-stamp {
  color: rgba(46, 122, 158, 0.85);
}

hr {
  border: none;
  border-top: 1px solid #E0E0DC;
}

.flash-messages {
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.flash {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: 1px solid transparent;
  font-weight: 600;
}
.flash-success {
  background: rgba(46, 158, 102, 0.12);
  border-color: rgba(46, 158, 102, 0.4);
  color: #1b5e3a;
}
.flash-info {
  background: rgba(46, 122, 158, 0.12);
  border-color: rgba(46, 122, 158, 0.4);
  color: #1c4860;
}
.flash-warning {
  background: rgba(255, 193, 7, 0.16);
  border-color: rgba(255, 193, 7, 0.45);
  color: #795200;
}
.flash-danger {
  background: rgba(176, 0, 32, 0.15);
  border-color: rgba(176, 0, 32, 0.4);
  color: #720019;
}

/* Cookie banner and modal */
#cookie-consent-banner[hidden],
#cookie-settings-modal[hidden] {
  display: none !important;
}

.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(3, 50, 82, 0.95);
  color: #FAF8F3;
  padding: 1.5rem;
  box-shadow: 0 -6px 24px rgba(3, 50, 82, 0.35);
  z-index: 999;
}
.cookie-banner a { color: #FFFFF9; text-decoration: underline; }
.cookie-banner-content {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.cookie-banner-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.cookie-modal {
  position: fixed;
  inset: 0;
  background: rgba(3, 50, 82, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 1000;
}
.cookie-modal-content {
  background: #FFFFF9;
  color: #033252;
  border-radius: 16px;
  max-width: 600px;
  width: 100%;
  box-shadow: 0 12px 36px rgba(3, 50, 82, 0.25);
  display: flex;
  flex-direction: column;
}
.cookie-modal-header,
.cookie-modal-footer {
  padding: 1.5rem;
  border-bottom: 1px solid #E0E0DC;
}
.cookie-modal-footer {
  border-bottom: none;
  border-top: 1px solid #E0E0DC;
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.cookie-modal-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.cookie-modal-close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #033252;
}
.cookie-category {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid #E0E0DC;
  border-radius: 12px;
  background: #FAF8F3;
}
.cookie-category-info h3 {
  margin: 0 0 0.5rem;
}
.cookie-category-info p {
  margin: 0;
}

.toggle {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
}
.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 34px;
}
.toggle-slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}
.toggle input:checked + .toggle-slider {
  background-color: #2E7A9E;
}
.toggle input:focus + .toggle-slider {
  box-shadow: 0 0 1px #2E7A9E;
}
.toggle input:checked + .toggle-slider:before {
  transform: translateX(24px);
}
.toggle.disabled .toggle-slider {
  background-color: #91A4B2;
  cursor: not-allowed;
}
.toggle.disabled .toggle-slider:before {
  background-color: #EAEEF2;
}

.modal-open {
  overflow: hidden;
}

@media (max-width: 680px) {
  .nav-inner {
    flex-direction: column;
    align-items: stretch;
    padding: 0.75rem 1rem 1rem;
    gap: 1rem;
  }
  .auth-nav {
    justify-content: flex-start;
  }
  .cookie-banner-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .cookie-modal-body {
    padding: 1.25rem;
  }
  .cookie-modal-header,
  .cookie-modal-footer {
    padding: 1.25rem;
  }
}

/* Auth forms */
.auth-wrapper {
  max-width: 480px;
  margin: 0 auto;
}
.auth-wrapper form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.input-control {
  padding: 0.75rem 1rem;
  border: 1px solid #E0E0DC;
  border-radius: 8px;
  font-size: 1rem;
}
.input-control:focus {
  outline: 2px solid #2E7A9E;
  border-color: #2E7A9E;
}
.form-error {
  margin: 0;
  color: #B00020;
  font-size: 0.9rem;
}
.form-help {
  margin: -0.25rem 0 0;
  font-size: 0.85rem;
  color: rgba(3, 50, 82, 0.7);
}
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}
