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

:root {
  --font-main: Lato, "Trebuchet MS", Arial, sans-serif;
  --font-accent: "Roboto Condensed", sans-serif;
  --text: #131613;
  --muted: #666;
  --green: #4caf50;
  --bg: #fff;
  --border: #e1e7e1;
}

html,
body {
  min-height: 100%;
}

body {
  padding-top: 55px;
  background: var(--bg);
  font-family: var(--font-main);
  color: var(--text);
}

a {
  text-decoration: none;
  color: #fff;
}

header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 2rem;
  height: 55px;
  padding: 0.75rem 2rem;
  background: #f3f3f3;
  font-size: 14px;
}

header a {
  color: var(--text);
}

.left-part,
.center-part,
.right-part,
.header-nav {
  display: flex;
  align-items: center;
}

.right-part {
  gap: 0.75rem;
}

.header-nav {
  gap: 0.75rem;
  display: flex;
  flex: 1;
  flex-direction: row;
  justify-content: space-between;
}

.center-part {
  flex: 1;
  gap: 1rem;
  justify-content: center;
}

.right-part {
  margin-left: auto;
}

.img-logo {
  width: 40px;
  display: block;
}

.burger-button {
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  width: 36px;
  height: 36px;
  border: 1px solid #d8ddd8;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}

.burger-button span {
  width: 18px;
  height: 2px;
  background: var(--text);
  transition:
    transform 0.2s ease,
    opacity 0.2s ease;
}

.block-hero-video {
  position: relative;
  height: min(70vh, 560px);
  min-height: 380px;
  overflow: hidden;
}

.hero-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.block-hero-video::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(0, 0, 0, 0.5);
}

.hero-content {
  position: absolute;
  inset: 50% auto auto 50%;
  z-index: 2;
  transform: translate(-50%, -50%);
  width: min(92vw, 760px);
  padding: 0 1rem;
  text-align: center;
  color: #fff;
}

h1 {
  margin-bottom: 1rem;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
}

.hero-sub {
  font-size: clamp(1rem, 2.3vw, 1.2rem);
}

.hero-tagline {
  margin-top: 0.5rem;
  color: #b3b3b3;
  font-size: 0.8rem;
}

.hero-button {
  display: inline-block;
  cursor: pointer;
  margin: 1rem 0;
  padding: 0.75rem 1.5rem;
  border: 0;
  border-radius: 4px;
  background: var(--green);
  box-shadow: inset 0 -4px 2px rgba(0, 0, 0, 0.2);
  color: #fff;
  font-size: 1.1rem;
}

.block-how-participate,
.block-map-section,
.block-stats,
.block-how-participate-main {
  max-width: 1200px;
  margin: 0 auto;
}

.block-how-participate {
  padding: 2.5rem 2rem 1rem;
}

.block-how-participate-main {
  padding: 1.4rem 1rem 1rem;
}

.how-header {
  margin: 0 auto 2rem;
  max-width: 920px;
  text-align: center;
}

.how-title {
  margin-bottom: 0.5rem;
  font: 700 2.2rem/1.2 var(--font-accent);
  color: var(--text);
}

.how-subtitle {
  font: 400 1.1rem/1.4 var(--font-accent);
  color: var(--muted);
}

.how-steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.how-step-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1.5rem 1.25rem 1.4rem;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbf8 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(19, 22, 19, 0.06);
  overflow: hidden;
}

.how-step-card::after {
  content: "";
  position: absolute;
  right: -28px;
  bottom: -28px;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(76, 175, 80, 0.18), rgba(76, 175, 80, 0));
}

.how-step-icon {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(76, 175, 80, 0.14), rgba(76, 175, 80, 0.06));
  color: var(--green);
}

.how-step-icon svg {
  width: 42px;
  height: 42px;
}

.how-step-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.5rem;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  font: 800 1rem/1 var(--font-accent);
}

.how-step-card h3 {
  font: 700 1.25rem/1.25 var(--font-accent);
  color: var(--text);
}

.how-step-card p {
  max-width: 26rem;
  color: #4f5a50;
  font: 400 1rem/1.5 var(--font-main);
}

.block-map-section {
  padding: 2rem 2rem 1rem;
}

.block-stats {
  padding: 2rem;
}

.map-title, .map-title-full,
.stats-title {
  margin-bottom: 0.5rem;
  font: 700 2.2rem/1.2 var(--font-accent);
  text-align: center;
  color: var(--text);
}

.map-title-full {
  margin-top: 1rem;
}

.stats-title {
  margin-bottom: 2rem;
}

.map-subtitle {
  margin: 0 auto 2rem;
  max-width: 900px;
  text-align: center;
  font: 400 1.1rem/1.4 var(--font-accent);
  color: var(--muted);
}

.map-wrapper {
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}


.map-container, .map-container-full {
  width: 100%;
  height: 450px;
  background: #f5f5f5;
}

.sitewide-map-section {
  max-width: 1200px;
  margin: 1.25rem auto 0;
  padding: 0 1rem;
}

.sitewide-map-card {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbf8 100%);
  box-shadow: 0 10px 28px rgba(19, 22, 19, 0.06);
}

.sitewide-map-header {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.9rem;
}

.sitewide-map-header h2 {
  margin-bottom: 0.25rem;
  font: 700 1.3rem/1.2 var(--font-accent);
}

.sitewide-map-header p {
  color: var(--muted);
}

.sitewide-map-link {
  padding: 0.7rem 1rem;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  white-space: nowrap;
}

.sitewide-map-wrapper {
  border-radius: 14px;
}

.sitewide-map-container {
  height: 280px;
}

.map-container-full {height: 100vh}


.stats-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.2rem;
}

.stat-card {
  padding: 1.75rem 1.25rem;
  text-align: center;
  background: #fbfdfb;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-4px);
  border-color: var(--green);
  box-shadow: 0 6px 16px rgba(76, 175, 80, 0.12);
}

.stat-number {
  margin-bottom: 0.5rem;
  font: 800 2.6rem/1.1 var(--font-accent);
  color: var(--green);
}

.stat-description {
  font: 500 1rem/1.4 var(--font-accent);
  color: #555;
}

.main-footer {
  background-color: #2e4a3f; /* Deep green or matching neutral color */
  color: #ffffff;
  padding: 40px 20px 20px;
  font-family: 'Roboto Condensed', sans-serif;
  margin-top: auto;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 30px;
}

.footer-brand .footer-logo {
  max-height: 50px;
  margin-bottom: 15px;
}

.footer-brand .footer-description {
  font-size: 14px;
  line-height: 1.5;
  opacity: 0.8;
}

.footer-links h3, .footer-project-info h3 {
  font-size: 18px;
  margin-bottom: 15px;
  font-weight: 600;
}

.footer-links ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links ul li {
  margin-bottom: 10px;
}

.footer-links ul li a {
  color: #ffffff;
  text-decoration: none;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.footer-links ul li a:hover {
  opacity: 1;
}

.footer-project-info p {
  margin: 5px 0;
  font-size: 14px;
  opacity: 0.8;
}

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  font-size: 13px;
  opacity: 0.6;
}

.how-information {

}


@media (max-width: 1023px) {
  header {
    padding: 0.5rem 1rem;
  }

  .burger-button {
    display: flex;
    margin-left: auto;
  }

  .header-nav {
    display: none;
    position: absolute;
    top: 55px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem 0;
    background: #fff;
    border-top: 1px solid var(--border);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
  }

  header.menu-open .header-nav {
    display: flex;
  }

  .center-part,
  .right-part {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .center-part {
    gap: 0;
  }

  .center-part a,
  .right-part a {
    margin: 0;
    padding: 0.95rem 1rem;
    border-bottom: 1px solid #f0f3f0;
  }

  .right-part a {
    border-bottom: 0;
  }

  header.menu-open .burger-button span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
  }

  header.menu-open .burger-button span:nth-child(2) {
    opacity: 0;
  }

  header.menu-open .burger-button span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
  }
}

@media (max-width: 640px) {
  .block-hero-video {
    height: 62vh;
    min-height: 360px;
  }

  .hero-content {
    width: 96vw;
  }

  .hero-button {
    width: 100%;
    max-width: 300px;
  }

  .block-map-section,
  .block-how-participate,
  .block-stats {
    padding: 1.25rem 1rem 2.5rem;
  }

  .stats-title,
  .map-title,
  .map-title-full,
  .how-title {
    font-size: 1.75rem;
  }

  .map-subtitle,
  .how-subtitle {
    font-size: 1rem;
  }

  .map-container {
    height: 320px;
  }

  .sitewide-map-container {
    height: 220px;
  }
}

@media (min-width: 640px) {
  .how-steps {
    grid-template-columns: repeat(3, 1fr);
  }

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

@media (min-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 640px) {
  .sitewide-map-section {
    margin-top: 1rem;
  }

  .sitewide-map-card {
    padding: 0.85rem;
  }

  .sitewide-map-container {
    height: 190px;
  }
}

/* Styles for auth page */
.auth-page {
  max-width: 960px;
  margin: 1.25rem auto;
  padding: 1.25rem;
}
.auth-page h1 { margin-bottom: 1rem; font-size: 1.5rem; }
.auth-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
.auth-card {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(0,0,0,0.04);
}
.auth-card h2 { margin-bottom: 0.75rem; font-size: 1.1rem; }
.auth-card form { display: flex; flex-direction: column; gap: 0.6rem; }
.auth-card label { font-size: 0.9rem; color: var(--muted); }
.auth-card input { padding: 0.6rem 0.75rem; border: 1px solid var(--border); border-radius: 6px; }
.btn-primary {
  margin-top: 0.5rem;
  padding: 0.6rem 0.85rem;
  border: 0;
  border-radius: 6px;
  background: var(--green);
  color: #fff;
  cursor: pointer;
}

.flashes { 
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 9999; /* Чтобы уведомления были поверх всех элементов */
  max-width: 350px; /* Уменьшили ширину, чтобы в углу это выглядело аккуратно */
  margin: 0; 
  padding: 0; 
}

.flash { padding: 0.6rem 0.9rem; border-radius: 6px; margin-bottom: 0.5rem; }
.flash.error { background: #ffecec; color: #611212; border: 1px solid #f0b3b3; }
.flash.success { background: #e9f8ee; color: #133f1f; border: 1px solid #b8e6c0; }
.flash.info { background: #eef6ff; color: #0b3a66; border: 1px solid #cfe7ff; }

@media (min-width: 720px) {
  .auth-grid { grid-template-columns: 1fr 1fr; }
}

/* Account page */
.account-page { max-width: 720px; margin: 1.5rem auto; padding: 1rem; }
.account-card { padding: 1.25rem; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.account-card h1 { margin-bottom: 0.75rem; }
.account-card p { margin: 0.5rem 0; }

.map-page-shell,
.editor-page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.5rem 1rem 2rem;
}

.map-page-intro,
.editor-hero {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbf8 100%);
  box-shadow: 0 10px 28px rgba(19, 22, 19, 0.06);
}

.editor-hero {
  grid-template-columns: 1.5fr 1fr;
  align-items: start;
}

.editor-hero-copy h2,
.section-heading h3 {
  margin-bottom: 0.35rem;
  font: 700 1.6rem/1.2 var(--font-accent);
}

.editor-hero-copy p,
.editor-hero-note p,
.section-heading p {
  color: var(--muted);
  line-height: 1.5;
}

.editor-hero-note {
  height: 100%;
  padding: 1rem;
  border-radius: 16px;
  background: rgba(76, 175, 80, 0.08);
  border: 1px solid rgba(76, 175, 80, 0.18);
}

.editor-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

.editor-map-wrapper {
  border-radius: 18px;
}

.editor-map-container {
  min-height: 460px;
}

.editor-location-row {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
}

.editor-location-row label,
.observation-form label {
  display: grid;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.editor-location-controls {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
}

.editor-location-controls input,
.editor-coordinates input,
.observation-form input,
.observation-form select,
.observation-form textarea {
  width: 100%;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  font: inherit;
  color: var(--text);
}

.editor-coordinates {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.editor-form-panel {
  padding: 1.2rem;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(19, 22, 19, 0.05);
}

.observation-form {
  display: grid;
  gap: 1rem;
}

.form-section {
  display: grid;
  gap: 0.85rem;
}

.form-section h3 {
  font: 700 1.1rem/1.2 var(--font-accent);
  color: var(--text);
}

.form-grid-2,
.form-grid-3 {
  display: grid;
  gap: 0.75rem;
}

.btn-secondary {
  padding: 0.8rem 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f7faf7;
  color: var(--text);
  cursor: pointer;
}

.btn-submit-observation {
  width: 100%;
  padding: 0.9rem 1rem;
  font-size: 1rem;
}

.map-wrapper-large {
  margin-bottom: 1.5rem;
}

.map-observations {
  display: grid;
  gap: 1rem;
}

.observation-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.observation-card {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(19, 22, 19, 0.04);
}

.observation-card-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.observation-card-header h4 {
  margin-bottom: 0.25rem;
  font: 700 1.05rem/1.2 var(--font-accent);
}

.observation-card-header p {
  color: var(--muted);
}

.observation-badge {
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: rgba(76, 175, 80, 0.12);
  color: var(--green);
  font-size: 0.85rem;
  white-space: nowrap;
}

.observation-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.observation-gallery img,
.map-balloon img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 12px;
}

.observation-meta {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem;
}

.observation-meta div {
  display: grid;
  gap: 0.2rem;
  padding-top: 0.65rem;
  border-top: 1px solid #edf1ed;
}

.observation-meta dt {
  color: var(--muted);
  font-size: 0.82rem;
}

.observation-meta dd {
  color: var(--text);
}

.map-empty-state {
  padding: 1rem;
  border: 1px dashed var(--border);
  border-radius: 12px;
  color: var(--muted);
}

.map-balloon {
  display: grid;
  gap: 0.5rem;
  max-width: 220px;
}

.map-balloon p {
  color: var(--text);
}

@media (min-width: 720px) {
  .editor-layout {
    grid-template-columns: 0.95fr 1.05fr;
  }

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

  .form-grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }

  .observation-meta {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .editor-hero,
  .map-page-intro,
  .editor-form-panel {
    padding: 1rem;
  }

  .editor-location-controls,
  .editor-coordinates {
    grid-template-columns: 1fr;
  }

  .editor-map-container {
    min-height: 340px;
  }
}