/* ============================================================
   PoliceBackground.net applicant app — v1 styles
   Mobile-first. Brand: podcast blue #2F4E6E, warm neutrals.
   ============================================================ */
:root {
  --blue: #2F4E6E;
  --blue-dark: #233B54;
  --navy: #1B2E48;
  --blue-light: #E8EEF4;
  --bg: #F5F1EA;
  --card: #FFFFFF;
  --ink: #2B2B28;
  --muted: #6E6A60;
  --line: #E4DDD0;
  --green: #2E7D4F;
  --green-bg: #E6F3EA;
  --yellow: #9A6B1A;
  --yellow-bg: #FBF3DF;
  --red: #B3372F;
  --red-bg: #FBE9E7;
  --radius: 14px;
  --nav-h: 68px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg); color: var(--ink);
  font-size: 16px; line-height: 1.55;
}

/* ---------- App frame ---------- */
#app { max-width: 560px; margin: 0 auto; min-height: 100vh; background: var(--bg); }

header.app-header {
  background: var(--navy); color: #fff;
  padding: 18px 20px 14px;
  position: sticky; top: 0; z-index: 20;
}
header.app-header h1 { margin: 0; font-size: 1.15rem; letter-spacing: .2px; }
header.app-header p { margin: 2px 0 0; font-size: .82rem; opacity: .85; }

main { padding: 16px 16px calc(var(--nav-h) + 28px); }
.view { display: none; animation: fade .18s ease-in; }
.view.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(4px);} to { opacity: 1; transform: none;} }

/* ---------- Bottom nav ---------- */
nav.bottom-nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 560px; height: var(--nav-h);
  background: #fff; border-top: 1px solid var(--line);
  display: flex; z-index: 30;
  padding-bottom: env(safe-area-inset-bottom);
}
nav.bottom-nav button {
  flex: 1; border: 0; background: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; color: var(--muted); font-size: .62rem; font-weight: 600;
  padding: 6px 2px;
}
nav.bottom-nav button .ico { font-size: 1.35rem; line-height: 1; }
nav.bottom-nav button.active { color: var(--blue); }

/* ---------- Cards & type ---------- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; margin-bottom: 14px;
}
.card h2 { margin: 0 0 8px; font-size: 1.05rem; color: var(--blue-dark); }
.card h3 { margin: 0 0 6px; font-size: .98rem; }
.muted { color: var(--muted); font-size: .88rem; }
.small { font-size: .8rem; }

.tip-card { border-left: 5px solid var(--blue); }
.tip-card .tip-label {
  font-size: .72rem; font-weight: 700; letter-spacing: 1.2px;
  color: var(--blue); text-transform: uppercase; margin-bottom: 6px;
}
.tip-card p { margin: 0; font-size: 1.02rem; }

.btn {
  display: block; width: 100%; text-align: center;
  background: var(--blue); color: #fff; border: 0; border-radius: 12px;
  padding: 15px 16px; font-size: 1rem; font-weight: 700;
  text-decoration: none; cursor: pointer; margin: 10px 0;
}
.btn:active { background: var(--blue-dark); }
.btn.secondary { background: #fff; color: var(--blue); border: 2px solid var(--blue); }
.btn.big { padding: 20px 16px; font-size: 1.1rem; }
.btn .sub { display: block; font-size: .82rem; font-weight: 400; opacity: .85; margin-top: 3px; }

.quick-links { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quick-links a {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 10px; text-align: center; text-decoration: none; color: var(--ink);
  font-size: .88rem; font-weight: 600;
}
.quick-links a .ico { display: block; font-size: 1.5rem; margin-bottom: 4px; }
.quick-links a:active { border-color: var(--blue); }

/* ---------- Podcast ---------- */
.ep { border-bottom: 1px solid var(--line); padding: 12px 0; }
.ep:last-child { border-bottom: 0; }
.ep-title { font-weight: 700; font-size: .95rem; margin: 0 0 2px; }
.ep-date { font-size: .78rem; color: var(--muted); margin-bottom: 6px; }
.ep-desc { font-size: .85rem; color: var(--muted); margin: 0 0 8px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ep audio { width: 100%; margin-top: 4px; }
.ep .play-row { display: flex; align-items: center; gap: 10px; }
.play-btn {
  flex: 0 0 auto; width: 46px; height: 46px; border-radius: 50%;
  background: var(--blue); color: #fff; border: 0; font-size: 1.1rem; cursor: pointer;
}
.cache-note {
  background: var(--yellow-bg); border: 1px solid #EAD9A8; color: var(--yellow);
  border-radius: 10px; padding: 10px 12px; font-size: .82rem; margin-bottom: 12px;
}
.ext-links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.ext-links a {
  font-size: .8rem; font-weight: 600; color: var(--blue); text-decoration: none;
  border: 1px solid var(--blue); border-radius: 20px; padding: 6px 12px;
}

/* ---------- FAQ ---------- */
.faq-search {
  width: 100%; padding: 13px 14px; font-size: 1rem;
  border: 1px solid var(--line); border-radius: 12px; margin-bottom: 12px;
  background: #fff;
}
.faq-item { background: var(--card); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; overflow: hidden; }
.faq-q {
  width: 100%; text-align: left; background: none; border: 0; cursor: pointer;
  padding: 14px; font-size: .95rem; font-weight: 700; color: var(--ink);
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
}
.faq-q .chev { color: var(--blue); font-size: 1.1rem; transition: transform .15s; }
.faq-item.open .faq-q .chev { transform: rotate(180deg); }
.faq-a { display: none; padding: 0 14px 14px; font-size: .9rem; color: #3d3a34; }
.faq-item.open .faq-a { display: block; }
.no-results { text-align: center; color: var(--muted); padding: 24px 0; }

/* ---------- DQ checker ---------- */
.progress { height: 8px; background: var(--line); border-radius: 6px; overflow: hidden; margin-bottom: 14px; }
.progress > div { height: 100%; background: var(--blue); border-radius: 6px; transition: width .2s; }
.dq-cat { font-size: .72rem; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--blue); margin-bottom: 6px; }
.dq-q { font-size: 1.12rem; font-weight: 700; margin: 0 0 14px; }
.dq-answers button {
  display: block; width: 100%; text-align: left; margin-bottom: 8px;
  background: #fff; border: 2px solid var(--line); border-radius: 12px;
  padding: 14px; font-size: .95rem; cursor: pointer; color: var(--ink);
}
.dq-answers button:active { border-color: var(--blue); background: var(--blue-light); }
.dq-back { background: none; border: 0; color: var(--muted); font-size: .85rem; cursor: pointer; padding: 8px 0; }

.result { border-radius: var(--radius); padding: 18px 16px; margin-bottom: 14px; border: 1px solid; }
.result.green { background: var(--green-bg); border-color: #BFE0C9; }
.result.yellow { background: var(--yellow-bg); border-color: #EAD9A8; }
.result.red { background: var(--red-bg); border-color: #F0C4C0; }
.result h2 { margin: 0 0 6px; font-size: 1.2rem; }
.result.green h2 { color: var(--green); }
.result.yellow h2 { color: var(--yellow); }
.result.red h2 { color: var(--red); }
.result p { margin: 0; font-size: .92rem; }
.flag-note {
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; font-size: .85rem; margin-bottom: 8px;
}
.flag-note strong { display: block; margin-bottom: 2px; }
.disclaimer {
  background: #fff; border: 1px dashed var(--line); border-radius: 10px;
  padding: 12px; font-size: .78rem; color: var(--muted); margin-top: 14px;
}

/* ---------- Contact form ---------- */
.field {
  width: 100%; padding: 13px 14px; font-size: 1rem; font-family: inherit;
  border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px;
  background: #fff; color: var(--ink);
}
.field:focus { outline: none; border-color: var(--blue); }
textarea.field { min-height: 110px; resize: vertical; }

/* ---------- Settings / misc ---------- */
.toggle-row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.toggle-row:last-child { border-bottom: 0; }
.switch { position: relative; width: 52px; height: 30px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; inset: 0; cursor: pointer; border-radius: 30px;
  background: #CFC9BC; transition: .2s;
}
.slider:before {
  content: ""; position: absolute; height: 24px; width: 24px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: .2s;
}
.switch input:checked + .slider { background: var(--blue); }
.switch input:checked + .slider:before { transform: translateX(22px); }

.about-stats { display: flex; gap: 10px; margin: 10px 0; }
.about-stats div {
  flex: 1; background: var(--blue-light); border-radius: 10px; padding: 12px 8px; text-align: center;
}
.about-stats strong { display: block; font-size: 1.25rem; color: var(--blue-dark); }
.about-stats span { font-size: .72rem; color: var(--muted); }

.install-hint {
  background: var(--blue-light); border-radius: 10px; padding: 12px;
  font-size: .85rem; color: var(--blue-dark); margin-bottom: 14px;
}

footer.app-foot { text-align: center; color: var(--muted); font-size: .75rem; padding: 8px 0 4px; }
footer.app-foot a { color: var(--blue); }
