/* FILE: css/app.css
   ARCHITECTURE: PRESENTATION Layer — styling only, no logic here.
   Mobile-first — the whole product is "type it on your phone." */

:root {
  --forest:   #2a6f4d;
  --forest-dark: #1c4d34;
  --ember:    #e0631f;
  --ember-dark: #b84f18;
  --ink:      #202824;
  --paper:    #fbf9f4;
  --line:     #dcd6c8;
  --danger:   #b3261e;
  --radius:   10px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

.hidden { display: none !important; }

button {
  font: inherit;
  cursor: pointer;
}

input, select {
  font: inherit;
}

/* ── Top bar ─────────────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--forest-dark);
  color: white;
}
.brand { font-weight: 700; letter-spacing: 0.02em; }
.party-name { font-size: 0.9em; opacity: 0.85; }

/* ── Screens & cards ─────────────────────────────────────────── */
.screen {
  min-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
}
#screen-auth, #screen-join {
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}
.card {
  width: 100%;
  max-width: 420px;
  background: white;
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}
.card h1 { font-size: 1.4em; margin: 0 0 4px; }
.card h2 { margin-top: 0; }
.tagline { color: var(--forest); font-weight: 600; margin-top: 0; }

form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}
label { font-size: 0.85em; font-weight: 600; color: #4a4438; }
input, select {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  width: 100%;
}
button[type="submit"], .alert-btn, #organizer-controls button {
  background: var(--forest);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 12px 16px;
  font-weight: 600;
  margin-top: 6px;
}
button[type="submit"]:hover, #organizer-controls button:hover { background: var(--forest-dark); }

.link-button {
  background: none;
  border: none;
  color: var(--forest);
  text-decoration: underline;
  padding: 6px 0;
  font-size: 0.9em;
  align-self: flex-start;
}

.hint { color: #756f60; font-size: 0.85em; margin: 4px 0; }
.error {
  color: var(--danger);
  background: #fbeceb;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.9em;
}
.disclaimer {
  font-size: 0.75em;
  color: #8a8373;
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.create-map {
  height: 220px;
  border-radius: 8px;
  border: 1px solid var(--line);
}

/* ── Main screen ─────────────────────────────────────────────── */
#screen-main { padding: 0; }

.briefing {
  background: var(--forest);
  color: white;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.briefing .link-button { color: white; }

.view-toggle {
  display: flex;
  border-bottom: 1px solid var(--line);
}
.toggle-btn {
  flex: 1;
  background: white;
  border: none;
  padding: 12px;
  font-weight: 600;
  color: #8a8373;
}
.toggle-btn.active { color: var(--forest); border-bottom: 3px solid var(--forest); }

.view { flex: 1; display: flex; flex-direction: column; }
#map { height: 45vh; min-height: 280px; width: 100%; }

.landmarks-list { padding: 10px 16px; }
.landmarks-list h3 { margin: 8px 0 4px; font-size: 0.95em; }
.landmark-row { padding: 4px 0; font-size: 0.92em; }

.compass-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  min-height: 45vh;
}
.compass-arrow {
  font-size: 5em;
  color: var(--ember);
  transition: transform 0.3s ease;
  line-height: 1;
}
.compass-distance { font-size: 1.6em; font-weight: 700; margin: 8px 0 0; }

.no-path {
  text-align: center;
  padding: 16px;
  color: #756f60;
}

.ask-wrap { padding: 0 16px 12px; }
#form-ask { flex-direction: row; margin-top: 0; }
#form-ask input {
  flex: 1;
}
#form-ask button {
  background: var(--ember);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 0 16px;
  font-weight: 600;
}
.ask-response {
  background: #fff6ea;
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 8px;
  font-size: 0.92em;
}

.organizer-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
}

.alert-buttons {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
}
.alert-btn {
  flex: 1;
  padding: 16px;
  font-size: 1.05em;
  border-radius: 10px;
}
.alert-btn.found { background: var(--forest); }
.alert-btn.help  { background: var(--danger); }

#btn-show-alerts { margin: 0 16px 8px; }

.alerts-feed {
  margin: 0 16px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.alert-row {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9em;
}
.alert-row:last-child { border-bottom: none; }
.alert-open        { background: #fff6ea; }
.alert-acknowledged { background: #eef5ff; }
.alert-resolved     { background: #f2f2f2; color: #8a8373; }

#main-error { margin: 0 16px 16px; }

/* ── Modal ───────────────────────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 1000;
}
.modal-card {
  background: white;
  border-radius: var(--radius);
  padding: 20px;
  width: 100%;
  max-width: 400px;
}
