/* ═══════════════════════════════════════════
   LAPOR BENCANA — style.css
   ═══════════════════════════════════════════ */

/* ── Reset & Tokens ── */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}

:root{
  --white:#ffffff;--bg:#f5f5f7;--card:#ffffff;
  --text:#1d1d1f;--muted:#6e6e73;--border:#d2d2d7;
  --orange:#ff6b35;--red:#e63946;
  --accent2:#ff8c5a;--green:#34c759;
  --telegram:#229ED9;--telegram-dark:#1a7bb8;
  --orange-glow:rgba(255,107,53,.25);
  --radius:14px;--shadow:0 2px 16px rgba(0,0,0,.07);
}

html{font-size:16px;scroll-behavior:smooth}

body{
  font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen,Ubuntu,sans-serif;
  background:var(--bg);color:var(--text);line-height:1.6;
  min-height:100dvh;display:flex;flex-direction:column;align-items:center;
}

/* ═══ Logo / Partner Bar ═══ */
.logo-bar{
  width:100%;background:var(--white);
  border-bottom:1px solid var(--border);
  padding:.75rem 1.25rem;
  box-shadow:0 1px 6px rgba(0,0,0,.04);
  position:relative;z-index:1;
  margin-top:-28px;
  border-radius:16px 16px 0 0;
  display:none;
}
.logo-bar.visible{display:block}
.logo-bar-inner{
  max-width:720px;margin:0 auto;
  display:flex;align-items:center;gap:1rem;
}
.logo-bar-label{
  font-size:.7rem;font-weight:700;text-transform:uppercase;
  letter-spacing:1px;color:var(--muted);
  white-space:nowrap;flex-shrink:0;
}
.logo-track{
  display:flex;align-items:center;gap:.75rem;
  overflow-x:auto;flex:1;
  scrollbar-width:none;-ms-overflow-style:none;
  padding:.25rem 0;
}
.logo-track::-webkit-scrollbar{display:none}

.logo-slot{
  width:48px;height:48px;min-width:48px;
  border-radius:10px;
  border:1.5px dashed var(--border);
  background:var(--bg);
  display:flex;align-items:center;justify-content:center;
  transition:border-color .2s,background .2s;
  cursor:default;
}
.logo-slot:hover{
  border-color:var(--orange);background:rgba(255,107,53,.04);
}
.logo-placeholder{
  font-size:1.1rem;color:var(--border);font-weight:300;
  line-height:1;
}

/* When a real logo is placed */
.logo-item{
  width:48px;height:48px;min-width:48px;
  border-radius:10px;
  border:1.5px solid var(--border);
  background:var(--white);
  display:flex;align-items:center;justify-content:center;
  overflow:hidden;transition:border-color .2s,transform .15s;
  text-decoration:none;
}
.logo-item:hover{
  border-color:var(--orange);transform:scale(1.08);
}
.logo-item img{
  width:100%;height:100%;object-fit:contain;
  padding:6px;
}

@media(min-width:560px){
  .logo-slot,.logo-item{width:52px;height:52px;min-width:52px}
}

/* ── Header ── */
.header{
  width:100%;background:linear-gradient(135deg,var(--orange),var(--red));
  color:var(--white);text-align:center;
  padding:2rem 1.25rem 3rem;
  position:relative;
}
.header::after{
  content:'';position:absolute;bottom:-1px;left:0;right:0;
  height:32px;background:var(--bg);
  border-radius:24px 24px 0 0;
}
.header-icon{
  font-size:2.2rem;display:block;margin-bottom:.5rem;
  filter:drop-shadow(0 2px 4px rgba(0,0,0,.15));
}
.header h1{
  font-size:1.65rem;font-weight:800;letter-spacing:.8px;
  text-shadow:0 1px 3px rgba(0,0,0,.12);
  margin-bottom:.2rem;
}
.header p{
  font-size:.82rem;opacity:.88;font-weight:400;
  letter-spacing:.2px;margin-bottom:1rem;
}

/* ── Join Telegram Button ── */
.btn-join-telegram{
  display:inline-flex;align-items:center;gap:.5rem;
  padding:.6rem 1.4rem;
  background:var(--white);color:var(--telegram);
  border:none;border-radius:50px;
  font-size:.82rem;font-weight:700;
  text-decoration:none;
  cursor:pointer;transition:all .25s;
  box-shadow:0 4px 14px rgba(0,0,0,.15);
  position:relative;z-index:1;
}
.btn-join-telegram:hover{
  background:var(--telegram);color:var(--white);
  transform:translateY(-2px);
  box-shadow:0 6px 20px rgba(34,158,217,.35);
}
.btn-join-telegram:active{transform:translateY(0)}
.tg-icon{flex-shrink:0;transition:transform .2s}
.btn-join-telegram:hover .tg-icon{transform:scale(1.15)}
.join-arrow{
  font-size:.9rem;transition:transform .2s;
}
.btn-join-telegram:hover .join-arrow{transform:translateX(3px)}

/* ── Container ── */
.container{
  width:100%;max-width:520px;padding:1.5rem 1.25rem;
  position:relative;z-index:1;
}

/* ── Card ── */
.card{
  background:var(--card);border-radius:var(--radius);
  box-shadow:var(--shadow);padding:1.4rem 1.5rem;margin-bottom:1rem;
}
.card-title{
  font-size:.75rem;font-weight:700;text-transform:uppercase;
  letter-spacing:1.2px;color:var(--muted);margin-bottom:1.1rem;
  padding-bottom:.65rem;
  border-bottom:1px solid var(--border);
  display:flex;align-items:center;gap:.45rem;
}
.card-title .icon{font-size:.95rem}

/* ── Form ── */
label{display:block;font-size:.8rem;font-weight:600;color:var(--muted);margin-bottom:.35rem}

input[type="text"],select,textarea{
  width:100%;padding:.7rem .85rem;border:1.5px solid var(--border);
  border-radius:10px;font-size:.95rem;background:var(--bg);
  color:var(--text);transition:border .2s,box-shadow .2s;outline:none;
  font-family:inherit;
}
input:focus,select:focus,textarea:focus{
  border-color:var(--orange);box-shadow:0 0 0 3px var(--orange-glow);
}
textarea{resize:vertical;min-height:90px}

select{
  appearance:none;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236e6e73' viewBox='0 0 16 16'%3E%3Cpath d='M1.5 5.5l6.5 6 6.5-6'/%3E%3C/svg%3E");
  background-repeat:no-repeat;background-position:right .85rem center;
}
.form-group{margin-bottom:1rem}

/* ── Honeypot (invisible to humans) ── */
.hp-wrap{
  position:absolute;left:-9999px;top:-9999px;
  opacity:0;height:0;width:0;overflow:hidden;
  pointer-events:none;
}

/* ── Character Counter ── */
.char-hint{
  font-weight:400;font-size:.72rem;
  transition:color .2s;
}
.char-hint.ok{color:var(--green)}
.char-hint.warn{color:var(--orange)}

.char-counter{
  font-size:.7rem;color:var(--muted);margin-top:.25rem;
  text-align:right;font-family:'SF Mono',Menlo,monospace;
  transition:color .2s;
}
.char-counter.ok{color:var(--green)}
.char-counter.warn{color:var(--orange)}
.char-counter.bad{color:var(--red)}

/* ── Map ── */
#map{
  width:100%;height:260px;border-radius:12px;
  border:1.5px solid var(--border);z-index:0;
}
.map-hint{
  font-size:.78rem;color:var(--muted);margin-bottom:.75rem;
}
.map-actions{display:flex;gap:.5rem;margin-top:.75rem;flex-wrap:wrap}

.btn-ghost{
  flex:1;min-width:0;padding:.55rem .5rem;border:1.5px solid var(--border);
  border-radius:10px;background:var(--white);font-size:.78rem;font-weight:600;
  color:var(--text);cursor:pointer;transition:all .2s;
  display:flex;align-items:center;justify-content:center;gap:.35rem;
}
.btn-ghost:hover{border-color:var(--orange);color:var(--orange)}
.btn-ghost:disabled{opacity:.5;cursor:not-allowed}

.coord-badge{
  margin-top:.5rem;font-size:.75rem;color:var(--muted);
  background:var(--bg);padding:.4rem .7rem;border-radius:8px;
  font-family:'SF Mono',Menlo,monospace;text-align:center;
}

/* ── Upload Zone ── */
.card-attach{padding-bottom:1.25rem}
.optional-badge{
  font-size:.62rem;font-weight:600;text-transform:none;
  letter-spacing:0;color:var(--muted);background:var(--bg);
  padding:.15rem .5rem;border-radius:6px;margin-left:.35rem;
  vertical-align:middle;
}
.upload-zone{
  border:1.5px dashed var(--border);border-radius:12px;
  padding:.85rem;cursor:pointer;transition:border-color .2s,background .2s;
  position:relative;min-height:56px;
  display:flex;align-items:center;justify-content:center;
}
.upload-zone:hover{border-color:var(--orange);background:rgba(255,107,53,.03)}
.upload-zone.has-file{border-style:solid;border-color:var(--green)}

.upload-placeholder{
  display:flex;align-items:center;gap:.5rem;
  font-size:.82rem;color:var(--muted);
  flex-wrap:wrap;justify-content:center;
}
.upload-icon{font-size:1.2rem}
.upload-text{font-weight:600;color:var(--text)}
.upload-hint{font-size:.68rem;width:100%;text-align:center;margin-top:.1rem}

.upload-preview{
  position:relative;display:flex;align-items:center;gap:.75rem;
  width:100%;
}
.upload-preview img,.upload-preview video{
  width:56px;height:56px;object-fit:cover;border-radius:8px;flex-shrink:0;
}
.upload-file-info{
  flex:1;min-width:0;
  font-size:.75rem;color:var(--muted);
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.upload-file-info strong{color:var(--text);display:block;font-size:.8rem}

.upload-remove{
  position:absolute;top:-6px;left:50px;
  width:22px;height:22px;border-radius:50%;
  border:none;background:var(--red);color:#fff;
  font-size:.7rem;font-weight:700;cursor:pointer;
  display:flex;align-items:center;justify-content:center;
  box-shadow:0 1px 4px rgba(0,0,0,.2);
  transition:transform .15s;
}
.upload-remove:hover{transform:scale(1.15)}

.upload-progress{
  margin-top:.5rem;height:4px;background:var(--bg);
  border-radius:4px;overflow:hidden;
}
.upload-progress-bar{
  height:100%;width:0%;background:linear-gradient(90deg,var(--orange),var(--red));
  border-radius:4px;transition:width .3s;
}

/* ── Submit Button ── */
.btn-submit{
  width:100%;padding:.85rem;border:none;border-radius:12px;
  background:linear-gradient(135deg,var(--orange),var(--red));
  color:var(--white);font-size:1rem;font-weight:700;
  cursor:pointer;transition:transform .15s,box-shadow .15s;
  box-shadow:0 4px 14px var(--orange-glow);
  display:flex;align-items:center;justify-content:center;gap:.5rem;
}
.btn-submit:hover{transform:translateY(-1px);box-shadow:0 6px 20px var(--orange-glow)}
.btn-submit:active{transform:scale(.98)}
.btn-submit:disabled{opacity:.6;cursor:not-allowed;transform:none}

/* ── Spinner ── */
.spinner{
  width:20px;height:20px;border:2.5px solid rgba(255,255,255,.35);
  border-top-color:#fff;border-radius:50%;animation:spin .7s linear infinite;
  display:none;
}
@keyframes spin{to{transform:rotate(360deg)}}

/* ── Reports List ── */
.reports-actions{
  display:flex;align-items:center;gap:.5rem;margin-bottom:.75rem;
}
.btn-sm{font-size:.72rem !important;padding:.4rem .65rem !important}
.reports-count{
  font-size:.7rem;color:var(--muted);margin-left:auto;
}

.report-item{
  display:flex;gap:.75rem;padding:.75rem 0;
  border-bottom:1px solid var(--border);
  animation:fadeSlideIn .3s ease-out;
}
.report-item:last-child{border-bottom:none}

@keyframes fadeSlideIn{
  from{opacity:0;transform:translateY(8px)}
  to{opacity:1;transform:translateY(0)}
}

.report-icon{
  width:36px;height:36px;border-radius:10px;
  background:var(--bg);display:flex;align-items:center;justify-content:center;
  font-size:1.1rem;flex-shrink:0;
}
.report-body{flex:1;min-width:0}
.report-type{
  font-size:.82rem;font-weight:700;color:var(--text);
  display:flex;align-items:center;gap:.3rem;
}
.report-desc{
  font-size:.75rem;color:var(--muted);margin-top:.15rem;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.report-meta{
  display:flex;gap:.6rem;margin-top:.3rem;
  font-size:.68rem;color:var(--muted);
}
.report-meta span{display:flex;align-items:center;gap:.2rem}

.report-map-btn{
  align-self:center;flex-shrink:0;
  width:32px;height:32px;border-radius:8px;
  border:1.5px solid var(--border);background:var(--white);
  cursor:pointer;font-size:.85rem;
  display:flex;align-items:center;justify-content:center;
  transition:border-color .2s;
}
.report-map-btn:hover{border-color:var(--orange)}

.report-empty{
  text-align:center;padding:1.5rem 0;
  font-size:.8rem;color:var(--muted);
}
.report-empty-icon{font-size:1.5rem;display:block;margin-bottom:.4rem}

/* ═══ Footer (from COPYRIGHT.md style) ═══ */
.footer{
  width:100%;text-align:center;padding:1.75rem 1rem 1.25rem;
  margin-top:auto;
}
.footer-inner{
  display:inline-flex;align-items:center;gap:.6rem;
  padding:.55rem 1.4rem;
  border-radius:50px;
  background:rgba(255,107,53,.06);
  border:1px solid rgba(255,107,53,.15);
  backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);
}
.footer-crown{
  font-size:1rem;
  animation:crownBob 2s ease-in-out infinite;
  display:inline-block;
}
.footer-crown:last-child{animation-delay:.3s}

@keyframes crownBob{
  0%,100%{transform:translateY(0) rotate(-5deg)}
  50%{transform:translateY(-2px) rotate(5deg)}
}

.footer-text{
  font-size:.78rem;font-weight:700;
  background:linear-gradient(90deg,var(--orange),var(--red),var(--orange));
  background-size:200% auto;
  -webkit-background-clip:text;-webkit-text-fill-color:transparent;
  background-clip:text;color:transparent;
  animation:shimmer 3s linear infinite;
}
@keyframes shimmer{
  0%{background-position:0% center}
  100%{background-position:200% center}
}

/* ── Toast Overlay ── */
.toast-overlay{
  position:fixed;inset:0;background:rgba(0,0,0,.35);
  display:none;align-items:center;justify-content:center;z-index:9999;
  backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px);
}
.toast-overlay.show{display:flex}

.toast-card{
  background:var(--white);border-radius:20px;padding:2rem 1.75rem;
  text-align:center;max-width:320px;width:90%;
  box-shadow:0 20px 50px rgba(0,0,0,.15);
  animation:popIn .35s cubic-bezier(.175,.885,.32,1.275);
}
@keyframes popIn{from{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}

.toast-icon{font-size:3rem;margin-bottom:.75rem}
.toast-card h3{font-size:1.15rem;margin-bottom:.35rem}
.toast-card p{font-size:.85rem;color:var(--muted)}
.toast-btn{
  margin-top:1.25rem;padding:.6rem 2rem;border:none;border-radius:10px;
  background:var(--orange);color:#fff;font-weight:700;font-size:.9rem;
  cursor:pointer;transition:background .2s;
}
.toast-btn:hover{background:var(--red)}

/* ── Leaflet popup fix ── */
.leaflet-popup-content-wrapper{border-radius:12px !important}

/* ── Responsive ── */
@media(min-width:560px){
  .header h1{font-size:1.8rem}
  #map{height:320px}
}

/* ── Cooldown Overlay ── */
.cooldown-overlay{
  position:fixed;inset:0;background:rgba(0,0,0,.45);
  display:none;align-items:center;justify-content:center;z-index:9998;
  backdrop-filter:blur(5px);-webkit-backdrop-filter:blur(5px);
}
.cooldown-overlay.show{display:flex}

.cooldown-card{
  background:var(--white);border-radius:20px;padding:2rem;
  text-align:center;max-width:300px;width:90%;
  box-shadow:0 20px 50px rgba(0,0,0,.15);
  animation:popIn .35s cubic-bezier(.175,.885,.32,1.275);
}
.cooldown-card .cooldown-icon{font-size:2.5rem;margin-bottom:.5rem}
.cooldown-card h3{font-size:1rem;margin-bottom:.25rem}
.cooldown-card p{font-size:.82rem;color:var(--muted);margin-bottom:.75rem}

.cooldown-ring{
  width:80px;height:80px;margin:0 auto;position:relative;
}
.cooldown-ring svg{
  width:80px;height:80px;transform:rotate(-90deg);
}
.cooldown-ring circle{
  fill:none;stroke-width:5;stroke-linecap:round;
}
.cooldown-ring .track{stroke:var(--border)}
.cooldown-ring .progress{stroke:var(--orange);transition:stroke-dashoffset 1s linear}
.cooldown-ring .label{
  position:absolute;inset:0;display:flex;align-items:center;justify-content:center;
  font-size:1.4rem;font-weight:800;color:var(--text);
}

/* ═══ Compress Option ═══ */
.compress-option{
  margin-top:.75rem;
  padding-top:.65rem;
  border-top:1px solid var(--border);
}
.checkbox-wrap{
  display:flex;align-items:flex-start;gap:.6rem;
  cursor:pointer;position:relative;
  margin-bottom:0;
}
.checkbox-wrap input[type="checkbox"]{
  position:absolute;opacity:0;width:0;height:0;
  pointer-events:none;
}
.checkmark{
  width:20px;height:20px;min-width:20px;
  border-radius:6px;border:1.5px solid var(--border);
  background:var(--bg);
  display:flex;align-items:center;justify-content:center;
  transition:all .2s;margin-top:1px;
}
.checkmark::after{
  content:'✓';font-size:.72rem;font-weight:700;
  color:var(--white);opacity:0;transition:opacity .15s;
}
.checkbox-wrap input:checked ~ .checkmark{
  background:var(--orange);border-color:var(--orange);
}
.checkbox-wrap input:checked ~ .checkmark::after{opacity:1}
.checkbox-wrap:hover .checkmark{border-color:var(--orange)}
.checkbox-label{
  font-size:.78rem;color:var(--text);line-height:1.45;
  font-weight:500;
}
.compress-hint{
  font-size:.68rem;color:var(--muted);font-weight:400;
}
.compress-status{
  margin-top:.5rem;font-size:.72rem;
  padding:.4rem .7rem;border-radius:8px;
  background:var(--bg);color:var(--muted);
  display:flex;align-items:center;gap:.4rem;
}
.compress-status.success{color:var(--green)}
.compress-status.compressing{color:var(--orange)}
.compress-status.error{color:var(--red)}
