/* Fadoktor Felmérő – terepi PWA. Sötét, nagy gombos, kesztyűvel is nyomható felület. */
:root {
  --bg: #14261c;
  --bg2: #1c3427;
  --card: #21402f;
  --line: #35543f;
  --text: #eef5f0;
  --muted: #9db8a8;
  --brand: #52b788;
  --brand-dark: #2d6a4f;
  --warn: #f4a261;
  --danger: #e76f51;
  --ok: #74c69d;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 17px; }
.hidden { display: none !important; }

/* Fejléc */
.topbar { display: flex; justify-content: space-between; align-items: center;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 14px 10px; background: var(--bg2);
  position: sticky; top: 0; z-index: 20; border-bottom: 1px solid var(--line); }
.topbar-left { display: flex; align-items: center; gap: 10px; }
.logo { width: 30px; height: 30px; border-radius: 8px; }
.app-title { font-weight: 700; font-size: 16px; }
.topbar-right { display: flex; gap: 8px; align-items: center; }
.chip { font-size: 13px; padding: 3px 10px; border-radius: 999px; background: var(--card); color: var(--ok); }
.chip-warn { color: #1d1d1d; background: var(--warn); font-weight: 700; }

.sync-bar { background: var(--warn); color: #1d1d1d; font-size: 14px; font-weight: 600;
  padding: 8px 14px; text-align: center; }

/* Képernyők */
main { padding: 16px 14px calc(env(safe-area-inset-bottom, 0px) + 30px); max-width: 640px; margin: 0 auto; }
h1 { font-size: 24px; margin: 10px 0 6px; }
.muted { color: var(--muted); margin: 4px 0 14px; }
.small { font-size: 14px; }
.row-between { display: flex; justify-content: space-between; align-items: center; }

label { display: block; margin: 14px 0 4px; font-size: 15px; color: var(--muted); }
input[type=text], input[type=email], input[type=password] {
  width: 100%; padding: 14px; margin-top: 6px; font-size: 17px; color: var(--text);
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; outline: none; }
input:focus { border-color: var(--brand); }

/* Gombok */
.btn { border: 0; border-radius: 14px; font-size: 17px; font-weight: 700; cursor: pointer;
  padding: 12px 16px; color: var(--text); background: var(--card); }
.btn:active { transform: scale(.985); }
.btn-big { display: block; width: 100%; padding: 18px; margin: 14px 0; font-size: 19px; }
.btn-primary { background: var(--brand-dark); }
.btn-primary:active { background: var(--brand); }
.btn-secondary { background: var(--card); border: 1px solid var(--line); }
.btn-ghost { background: transparent; color: var(--muted); font-weight: 600; }
.btn-mini { font-size: 14px; padding: 8px 12px; }
.btn-back { padding-left: 0; margin-top: 4px; }
.btn-rec { background: var(--danger); }
.btn-rec.recording { animation: pulse 1.2s infinite; background: #c1121f; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(231,111,81,.5);} 50% { box-shadow: 0 0 0 14px rgba(231,111,81,0);} }
.btn-finish { background: var(--brand); color: #08130d; }
.btn-danger { background: var(--danger); }

.rec-timer { text-align: center; font-size: 34px; font-variant-numeric: tabular-nums;
  font-weight: 700; color: var(--danger); margin: 6px 0 12px; }

/* Listák */
.list { margin-top: 10px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px; margin: 10px 0; }
.card-tap { cursor: pointer; }
.card-tap:active { background: var(--bg2); }
.card h3 { margin: 0 0 4px; font-size: 18px; }
.card .sub { color: var(--muted); font-size: 14px; }
.status-chip { display: inline-block; font-size: 12px; font-weight: 700; border-radius: 999px;
  padding: 2px 10px; margin-left: 6px; vertical-align: middle; }
.st-pending { background: var(--warn); color: #1d1d1d; }
.st-done { background: var(--brand-dark); color: var(--text); }
.st-error { background: var(--danger); color: #fff; }
.st-info { background: var(--line); color: var(--text); }

/* Hanglista */
.audio-item { display: flex; align-items: center; gap: 10px; background: var(--card);
  border: 1px solid var(--line); border-radius: 12px; padding: 10px; margin: 8px 0; flex-wrap: wrap; }
.audio-item audio { flex: 1 1 200px; height: 40px; min-width: 0; }
.audio-idx { font-weight: 700; color: var(--muted); }
.audio-note { font-size: 13px; color: var(--muted); flex-basis: 100%; }

/* Fotórács */
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.photo-grid .ph { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden;
  background: var(--bg2); }
.photo-grid img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-grid .ph .st { position: absolute; right: 4px; bottom: 4px; font-size: 11px; font-weight: 700;
  padding: 1px 7px; border-radius: 999px; }
.ph-del { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border: 0;
  border-radius: 999px; background: rgba(0,0,0,.55); color: #fff; font-size: 13px; font-weight: 700;
  cursor: pointer; line-height: 1; }

.finish-wrap { margin-top: 26px; border-top: 1px solid var(--line); padding-top: 10px; }
.status-box { border-radius: 12px; padding: 12px 14px; margin: 10px 0; font-size: 15px; }
.status-box.info { background: var(--bg2); border: 1px solid var(--line); }
.status-box.warn { background: rgba(244,162,97,.15); border: 1px solid var(--warn); }

.msg { min-height: 20px; font-size: 15px; }
.msg.err { color: var(--danger); }
.msg.ok { color: var(--ok); }
.msg.info { color: var(--warn); }

/* Toast */
.toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 20px);
  transform: translateX(-50%); background: var(--text); color: #10201a; font-weight: 700;
  padding: 12px 18px; border-radius: 12px; z-index: 50; max-width: 90vw; text-align: center;
  box-shadow: 0 6px 24px rgba(0,0,0,.4); }
