:root{
  --bg: #0b0f14;
  --panel: #0f1620;
  --card: #111a24;
  --text: #e6edf3;
  --muted: #9aa7b2;
  --border: rgba(255,255,255,.10);
  --shadow: 0 12px 40px rgba(0,0,0,.35);
  --accent: #2dd4bf;
  --accent-2: #22c55e;
  --danger: #ff6b6b;
  --radius: 16px;
}

:root[data-theme="light"]{
  --bg: #f6f7fb;
  --panel: #ffffff;
  --card: #ffffff;
  --text: #111827;
  --muted: #4b5563;
  --border: rgba(0,0,0,.10);
  --shadow: 0 12px 40px rgba(0,0,0,.08);
  --accent: #0ea5e9;
  --accent-2: #22c55e;
  --danger: #e11d48;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }

body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: radial-gradient(1200px 600px at 20% 10%, rgba(45,212,191,.16), transparent 60%),
              radial-gradient(900px 500px at 90% 10%, rgba(34,197,94,.10), transparent 55%),
              var(--bg);
  color: var(--text);
}

a{ color: var(--accent); text-decoration:none; }
a:hover{ text-decoration:underline; }

.container{
  width: min(1200px, calc(100% - 48px));
  margin: 0 auto;
  padding: 28px 0 64px;
}

/* Topbar */
.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.04);
  backdrop-filter: blur(10px);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.brand{ display:flex; align-items:center; gap:10px; }
.logo{
  width:36px;height:36px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 30px rgba(45,212,191,.25);
}
.brand h1{ font-size: 16px; margin:0; letter-spacing: .2px; }
.brand p{ margin:0; font-size: 12px; color: var(--muted); }

.actions{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255,255,255,.03);
  color: var(--muted);
  font-size: 12px;
}

/* Buttons */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  padding: 14px 18px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.04);
  color: var(--text);
  cursor:pointer;
  font-weight: 700;
  font-size: 15px;
  line-height: 1;
  min-height: 48px;
  transition: transform .06s ease, border-color .15s ease, background .15s ease, box-shadow .15s ease;
}

.btn:hover{
  border-color: rgba(255,255,255,.22);
  background: rgba(255,255,255,.07);
}

.btn:active{ transform: translateY(1px); }

.btn-accent{
  border-color: rgba(45,212,191,.45);
  background: linear-gradient(135deg, rgba(45,212,191,.18), rgba(34,197,94,.10));
  box-shadow: 0 10px 28px rgba(45,212,191,.16);
}
:root[data-theme="light"] .btn-accent{
  border-color: rgba(14,165,233,.35);
  background: rgba(14,165,233,.12);
  box-shadow: 0 10px 28px rgba(14,165,233,.12);
}

/* Ghost (для label-кнопки файлу, якщо використовуєш) */
.btn-ghost{
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-ghost:hover{
  background: rgba(255,255,255,.07);
  border-color: rgba(255,255,255,.22);
}

/* IMPORTANT: щоб "Надіслати" був такий самий, як "Вибрати файл"
   Якщо в HTML ще є клас btn-xl — робимо його НЕ більшим. */
.btn-xl{
  min-height: 48px;
  padding: 14px 18px;
  font-size: 15px;
  border-radius: 14px;
  min-width: unset;
}

/* Cards */
.card{
  margin-top: 18px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.03);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow:hidden;
}

.card-header{ padding: 18px 18px 0; }
.card-body{ padding: 18px; }

/* Titles */
.h-title{
  margin:0;
  font-size: 30px;
  letter-spacing: .2px;
}
.h-sub{
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
  max-width: 80ch;
}

/* Big cards */
.card.big .card-header{
  padding-top: 40px;
  padding-bottom: 20px;
}
.card.big .card-body{
  padding-top: 20px;
  padding-bottom: 40px;
}

.card.big{
  min-height: 62vh;
  display:flex;
  flex-direction: column;
  justify-content: center;
}

.card.big.auth{
  min-height: 78vh;
  justify-content: flex-start;
}
.card.big.auth .card-header{ padding-top: 46px; }
.card.big.auth .card-body{ padding-bottom: 46px; }

/* Layout helpers */
.row{
  display:flex;
  gap:14px;
  flex-wrap:wrap;
  align-items:center;
}
.row > * { flex: 1; }

form .row + .row{ margin-top: 14px; }
.drop .row{ align-items: stretch; }

.hr{
  height:1px;
  background: var(--border);
  margin: 16px 0;
}

/* Inputs */
input[type="text"], input[type="file"], input, input[type="password"], input[type="email"]{
  width:100%;
  padding: 14px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,.16);
  color: var(--text);
  outline:none;
  font-size: 15px;
  min-height: 48px;
}
:root[data-theme="light"] input{
  background: rgba(255,255,255,.85);
}

/* Drop zone (upload) */
.drop{
  border: 1.5px dashed rgba(255,255,255,.20);
  border-radius: 18px;
  padding: 44px;
  background: rgba(0,0,0,.12);
  min-height: 240px;
}
:root[data-theme="light"] .drop{
  background: rgba(0,0,0,.03);
  border-color: rgba(0,0,0,.18);
}

/* Upload layout */
.upload-row{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:26px;
  flex-wrap:wrap;
}

.file-stack{
  display:flex;
  flex-direction:column;
  gap:10px;
  min-width:320px;
}

/* Ховаємо реальний input file, показуємо тільки label */
.file-stack input[type="file"]{
  position:absolute;
  left:-9999px;
  width:1px;
  height:1px;
  opacity:0;
}

.file-name{
  margin-top: 2px;
  color: var(--muted);
  font-size: 14px;
  max-width: 48ch;
  overflow:hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.help{
  margin-top:10px;
  font-size: 12px;
  color: var(--muted);
}

/* Grid + media + map */
.grid-2{
  display:grid;
  grid-template-columns: 1.2fr .8fr;
  gap:16px;
}
@media (max-width: 880px){
  .grid-2{ grid-template-columns: 1fr; }
}

.media{
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow:hidden;
  background: rgba(0,0,0,.15);
}
.media img{ display:block; width:100%; height:auto; }

.map{
  height: 340px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow:hidden;
}

/* Notices */
.notice{
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);
  color: var(--muted);
  font-size: 13px;
}
.notice.error{
  border-color: rgba(255,107,107,.35);
  color: var(--danger);
  background: rgba(255,107,107,.08);
}

.small{ font-size: 12px; color: var(--muted); }

.footer{
  margin-top: 18px;
  text-align:center;
  color: var(--muted);
  font-size: 12px;
}

/* Submitted center + bigger typography */
.submitted{
  min-height: 75vh;
  display:flex;
  flex-direction:column;
  justify-content:center;
}
.submitted-center{
  text-align:center;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
}
.submitted-title{
  font-size: 40px;
  line-height: 1.1;
  margin: 0;
}
.submitted-sub{
  font-size: 18px;
  line-height: 1.6;
  margin-top: 10px;
  color: var(--muted);
  max-width: 60ch;
}

/* ===== Upload row: 2 рівні половини + однакова висота кнопок ===== */

.upload-row{
  display: flex;
  gap: 26px;
  align-items: stretch;        /* щоб висота вирівнювалась */
}

.upload-row .file-stack,
.upload-row > button{
  flex: 1 1 0;                 /* 50% + 50% */
  min-width: 0;
}

/* кнопки всередині лівої колонки і сама кнопка справа */
.upload-row .file-stack .btn,
.upload-row > button.btn{
  width: 100%;                 /* кожна займає свою половину */
  min-height: 48px;            /* ВИСОТА як у "Вибрати файл" зараз */
  padding: 14px 18px;
  font-size: 15px;
  border-radius: 14px;
}

/* щоб ліва колонка не роздувалася по висоті через текст */
.upload-row .file-stack{
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* прибираємо зайве розтягування від глобального .row > * { flex:1 } */
.upload-row > *{
  flex: unset;
}

.upload-row .btn,
.upload-row .file-btn{
  height: 48px;
  min-height: 48px;
  padding: 14px 18px;
  font-size: 15px;
  border-radius: 14px;
}

.form-grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}



.btn-wide{
  width: 100%;
  height: 52px;
  border-radius: 14px;
}

.community-panel{
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.is-hidden{
  display: none;
}

.community-search,
.community-select{
  width: 100%;
  height: 46px;
  border-radius: 14px;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.06);
  color: inherit;
}

.map-box{
  height: 280px;
  border-radius: 14px;
  overflow: hidden;
}

.geo-status{
  font-size: 13px;
  opacity: 0.85;
}
.report-layout{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
}

.report-right form{
  display: flex;
  flex-direction: column;
  gap: 12px; /* головне: щоб не було близько */
}

.hint{
  font-size: 13px;
  opacity: 0.8;
}

.error{
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 60, 60, 0.12);
  border: 1px solid rgba(255, 60, 60, 0.25);
}

/* Кнопка "Обрати громаду" - велика як "Відправити" і в стилі темного UI */
.btn-community{
  width: 100%;
  height: 52px;
  border-radius: 14px;
  font-weight: 600;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
}

/* Ховер трохи яскравіший */
.btn-community:hover{
  background: rgba(255,255,255,0.09);
}
.select-community {
  width: 100%;
  height: 48px;
  padding: 0 16px;

  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.15);
  background: linear-gradient(
    180deg,
    rgba(255,255,255,0.08),
    rgba(255,255,255,0.02)
  );

  color: #fff;
  font-size: 15px;
  font-weight: 500;

  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  cursor: pointer;
}

/* hover */
.select-community:hover {
  border-color: rgba(0,255,200,0.6);
}

/* focus */
.select-community:focus {
  outline: none;
  border-color: #00ffd0;
  box-shadow: 0 0 0 2px rgba(0,255,200,0.2);
}

/* placeholder */
.select-community option[value=""] {
  color: #aaa;
}
/* Сам select як "кнопка" */
.select-community{
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.06);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

/* ВАЖЛИВО: щоб у випадаючому списку текст був видимий */
.select-community option{
  color: #000;
  background: #fff;
}
/* select як "кнопка" */
.select-community{
  width: 100%;
  height: 52px;
  padding: 0 44px 0 16px; /* місце під ✕ справа */
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.06);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

/* (опційно) опції в системному дропдауні - щоб не було білим по білому */
.select-community option{
  color: #000;
  background: #fff;
}

/* ✕ */
.community-close{
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* блок зі списком */
.community-listbox{
  margin-top: 10px;
}

/* наш видимий список */
.community-list{
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 220px;
  overflow: auto;
  padding-right: 4px;
}

.community-item{
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.04);
  color: #fff;
  cursor: pointer;
}

.community-item:hover{
  border-color: rgba(0,255,200,0.6);
  background: rgba(0,255,200,0.08);
}

.community-item.empty{
  opacity: 0.7;
  cursor: default;
}
/* реальний select ховаємо */
.select-community.real{
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* fake - це кнопка, яка виглядає як select */
.select-community.fake{
  width: 100%;
  height: 52px;
  padding: 0 44px 0 16px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.06);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}
