:root {
  --fm-bg: url('/static/images/city-bg-full.png') center center / 101% auto no-repeat fixed;
  --fm-nav-bg: rgba(255, 255, 255, 0.9);
  --fm-primary: #2997f5;
  --fm-primary-dark: #1a7bd8;
  --fm-text: #233445;
  --fm-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

* { box-sizing: border-box; }

body.site-theme {
  margin: 0;
  padding: 20px;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--fm-text);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: var(--fm-bg);
  background-color: #cbe6f7;
}

.top-nav {
  background: var(--fm-nav-bg);
  padding: 14px 30px;
  border-radius: 50px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  margin: 40px auto 56px;
  width: min(100%, 1120px);
  max-width: 100%;
  z-index: 10;
}

.top-nav a {
  text-decoration: none;
  color: #0077cc;
  padding: 8px 16px;
  border-radius: 30px;
  font-weight: 600;
  font-size: 1.1rem;
  transition: all 0.2s ease;
}

.top-nav a.active,
.top-nav a:hover {
  background: var(--fm-primary);
  color: #fff;
}

.page-shell {
  width: 100%;
  max-width: 920px;
  margin: 0 auto 50px;
}

.surface-card {
  background: rgba(255, 255, 255, 0.96);
  border-radius: 20px;
  box-shadow: var(--fm-shadow);
  padding: 34px;
  text-align: left;
  animation: fm-fade-up 0.5s ease-out both;
}

.page-title {
  text-align: center;
  color: #006699;
  margin: 0 0 12px;
}

.warning {
  margin: 0 auto 18px;
  max-width: 760px;
  background: #fff4d8;
  border: 1px solid #ffd46b;
  color: #7a5b00;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.95rem;
  text-align: center;
}

.reveal {
  animation: fm-fade-up 0.45s ease-out both;
}

@keyframes fm-fade-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 768px) {
  .top-nav {
    width: 100%;
    max-width: 100%;
    gap: 8px;
    padding: 12px;
    border-radius: 18px;
    margin-bottom: 30px;
  }

  .top-nav a {
    font-size: 1rem;
    padding: 8px 12px;
  }

  .surface-card {
    padding: 24px 16px;
  }
}


.interactive-toggle {
  background: #f5f9ff;
  border: 2px solid #d7e7ff;
  border-radius: 12px;
  padding: 14px 16px;
  margin-top: 12px;
  font-weight: 700;
  color: #0b67b2;
  cursor: pointer;
  position: relative;
  transition: all .2s ease;
}

.interactive-toggle:hover {
  background: #eaf3ff;
  transform: translateY(-1px);
}

.interactive-toggle::after {
  content: '+';
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  font-weight: 700;
  transition: transform .25s ease;
}

.interactive-toggle.active::after {
  content: '−';
  transform: translateY(-50%) rotate(180deg);
}

.expand-section {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .28s ease;
  margin-top: 10px;
  margin-bottom: 16px;
}

.expand-section > .expand-content {
  overflow: hidden;
}

.expand-section.active {
  grid-template-rows: 1fr;
}

.auth-theme {
  position: relative;
  overflow-x: hidden;
}

.auth-theme::before,
.auth-theme::after {
  content: '';
  position: fixed;
  width: 360px;
  height: 360px;
  border-radius: 999px;
  filter: blur(20px);
  opacity: 0.45;
  pointer-events: none;
  z-index: 0;
}

.auth-theme::before {
  top: 130px;
  left: max(24px, calc(50% - 620px));
  background: radial-gradient(circle, rgba(41, 151, 245, 0.34), rgba(41, 151, 245, 0));
}

.auth-theme::after {
  right: max(10px, calc(50% - 650px));
  bottom: 70px;
  background: radial-gradient(circle, rgba(39, 206, 160, 0.28), rgba(39, 206, 160, 0));
}

.auth-shell {
  width: min(100%, 620px);
  margin: 0 auto 60px;
  position: relative;
  z-index: 1;
}

.auth-card {
  width: 100%;
  padding: 42px;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 32px;
  text-align: left;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.97), rgba(239, 248, 255, 0.92));
  box-shadow: 0 24px 70px rgba(20, 83, 135, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(16px);
  animation: fm-fade-up 0.5s ease-out both;
}

.auth-card-wide {
  max-width: 680px;
}

.auth-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  padding: 8px 13px;
  border: 1px solid rgba(41, 151, 245, 0.22);
  border-radius: 999px;
  color: #0b67b2;
  background: rgba(41, 151, 245, 0.09);
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.auth-title {
  margin: 0;
  color: #123d63;
  font-size: clamp(2rem, 6vw, 3.1rem);
  line-height: 1;
  letter-spacing: -0.05em;
}

.auth-subtitle {
  margin: 16px 0 28px;
  color: #52708b;
  font-size: 1.05rem;
  line-height: 1.6;
}

.auth-form {
  display: grid;
  gap: 16px;
}

.auth-field {
  display: grid;
  gap: 8px;
  color: #244861;
  font-weight: 750;
}

.auth-field input {
  width: 100%;
  border: 1px solid #cfe2f4;
  border-radius: 18px;
  padding: 16px 18px;
  color: #17384f;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 24px rgba(28, 103, 165, 0.07);
  font: inherit;
  font-weight: 600;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.auth-field input:focus {
  border-color: rgba(41, 151, 245, 0.75);
  box-shadow: 0 0 0 4px rgba(41, 151, 245, 0.14), 0 10px 28px rgba(28, 103, 165, 0.1);
  transform: translateY(-1px);
}

.auth-submit {
  border: 0;
  border-radius: 18px;
  padding: 16px 20px;
  color: #fff;
  background: linear-gradient(135deg, #2997f5, #0d6fb8);
  box-shadow: 0 16px 36px rgba(41, 151, 245, 0.28);
  cursor: pointer;
  font: inherit;
  font-weight: 850;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.auth-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 42px rgba(41, 151, 245, 0.34);
}

.auth-status {
  min-height: 24px;
  margin-top: 16px;
  color: #2f5b80;
  font-weight: 700;
}

.auth-status.error {
  color: #b33a3a;
}

.auth-switch {
  margin: 22px 0 0;
  color: #526b7f;
  text-align: center;
}

.auth-switch a {
  color: #0b67b2;
  font-weight: 850;
  text-decoration: none;
}

.auth-switch a:hover {
  text-decoration: underline;
}

@media (max-width: 640px) {
  .auth-card {
    padding: 28px 18px;
    border-radius: 24px;
  }
}
