/* Espace Fokontany — annonces géo-ciblées, doléances, certificats de résidence. */
:root {
  --fok-primary: #6750A4;
  --fok-primary-d: #543f92;
  --fok-ink: #1b1b28;
  --fok-muted: #6b6b7d;
  --fok-line: #e6e3ef;
  --fok-bg: #f5f3fb;
  --fok-card: #ffffff;
  --fok-ok: #16a34a;
  --fok-warn: #d97706;
  --fok-err: #dc2626;
}
* { box-sizing: border-box; }
body.fok-body {
  margin: 0; background: var(--fok-bg); color: var(--fok-ink);
  font-family: Nunito, system-ui, sans-serif; -webkit-tap-highlight-color: transparent;
}
.fok-wrap { max-width: 680px; margin: 0 auto; padding: 0 14px 96px; }
.fok-hidden { display: none !important; }

/* Top bar */
.fok-top {
  position: sticky; top: 0; z-index: 20; background: var(--fok-primary); color: #fff;
  display: flex; align-items: center; gap: 10px; padding: 14px 16px; padding-top: calc(14px + env(safe-area-inset-top));
}
.fok-top .fok-back { color: #fff; text-decoration: none; font-size: 18px; }
.fok-top h1 { font-size: 17px; margin: 0; font-weight: 900; flex: 1; }
.fok-top .fok-sub { font-size: 12px; opacity: .85; font-weight: 700; }

/* Offline banner */
.fok-offline { background: #fee2e2; color: #991b1b; text-align: center; font-size: 12.5px; font-weight: 700; padding: 6px; }

/* Sections & cards */
.fok-section-title { font-size: 12px; font-weight: 900; letter-spacing: .5px; text-transform: uppercase; color: var(--fok-muted); margin: 20px 2px 8px; }
.fok-card { background: var(--fok-card); border: 1px solid var(--fok-line); border-radius: 14px; padding: 14px; margin-bottom: 10px; }
.fok-card h3 { margin: 0 0 4px; font-size: 15.5px; font-weight: 800; }
.fok-card .fok-meta { font-size: 12px; color: var(--fok-muted); display: flex; flex-wrap: wrap; gap: 8px; }
.fok-card .fok-body { font-size: 14px; margin-top: 6px; white-space: pre-wrap; line-height: 1.45; }
.fok-empty { text-align: center; color: var(--fok-muted); padding: 26px 12px; }
.fok-empty i { display: block; font-size: 30px; color: var(--fok-line); margin-bottom: 10px; }
.fok-loading { text-align: center; color: var(--fok-muted); padding: 22px; }

/* Buttons */
.fok-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--fok-primary); color: #fff; border: none; border-radius: 12px;
  padding: 12px 16px; font: 800 15px Nunito, sans-serif; cursor: pointer; width: 100%;
}
.fok-btn:disabled { opacity: .55; }
.fok-btn.ghost { background: transparent; color: var(--fok-primary); border: 1.5px solid var(--fok-line); }
.fok-btn.sm { width: auto; padding: 8px 12px; font-size: 13px; border-radius: 10px; }
.fok-btn.danger { background: var(--fok-err); }
.fok-btn.ok { background: var(--fok-ok); }
.fok-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.fok-quick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 6px 0 4px; }
.fok-quick .fok-btn { flex-direction: column; padding: 16px 10px; gap: 6px; }
.fok-quick .fok-btn i { font-size: 20px; }

/* Inputs */
.fok-input, .fok-textarea, .fok-select {
  width: 100%; border: 1.5px solid var(--fok-line); border-radius: 10px; padding: 11px 12px;
  font: 600 15px Nunito, sans-serif; background: #fff; color: var(--fok-ink); margin-bottom: 10px;
}
.fok-textarea { min-height: 96px; resize: vertical; }
.fok-label { font-size: 12.5px; font-weight: 800; color: var(--fok-muted); display: block; margin: 4px 2px; }
.fok-check { display: flex; align-items: center; gap: 8px; font-size: 14px; margin: 4px 0 12px; }

/* Chips / status */
.fok-chip { font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.fok-chip.pending { background: #fef3c7; color: #92400e; }
.fok-chip.in_progress { background: #dbeafe; color: #1e40af; }
.fok-chip.resolved, .fok-chip.approved { background: #dcfce7; color: #166534; }
.fok-chip.rejected, .fok-chip.cancelled { background: #fee2e2; color: #991b1b; }

/* Tabs (chief) */
.fok-tabs { display: flex; gap: 6px; background: #ece8f6; padding: 4px; border-radius: 12px; margin: 12px 0; }
.fok-tab { flex: 1; text-align: center; padding: 9px 6px; border-radius: 9px; font-size: 13px; font-weight: 800; color: var(--fok-muted); cursor: pointer; border: none; background: transparent; position: relative; }
.fok-tab.active { background: #fff; color: var(--fok-primary); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.fok-tab .fok-badge { position: absolute; top: 2px; right: 6px; background: var(--fok-err); color: #fff; font-size: 10px; min-width: 16px; height: 16px; border-radius: 999px; line-height: 16px; padding: 0 4px; }

/* Gate PIN */
.fok-gate { position: fixed; inset: 0; background: var(--fok-bg); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; z-index: 50; }
.fok-gate-icon { width: 72px; height: 72px; border-radius: 20px; background: var(--fok-primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 30px; margin-bottom: 16px; }
.fok-gate h1 { font-size: 20px; margin: 0 0 8px; }
.fok-gate p { color: var(--fok-muted); font-size: 13.5px; text-align: center; max-width: 340px; margin: 0 0 16px; line-height: 1.5; }
.fok-gate .fok-input { max-width: 280px; text-align: center; letter-spacing: 4px; font-size: 20px; }
.fok-gate-err { color: var(--fok-err); font-size: 13px; min-height: 18px; font-weight: 700; }
.fok-gate-close { position: absolute; top: calc(14px + env(safe-area-inset-top)); right: 16px; background: none; border: none; color: var(--fok-muted); font-size: 22px; cursor: pointer; }

/* Modal / sheet */
.fok-modal { position: fixed; inset: 0; background: rgba(20,18,35,.5); display: none; align-items: flex-end; justify-content: center; z-index: 60; }
.fok-modal.open { display: flex; }
.fok-sheet { background: #fff; width: 100%; max-width: 680px; border-radius: 18px 18px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); max-height: 90vh; overflow: auto; }
.fok-sheet-head { display: flex; align-items: center; margin-bottom: 12px; }
.fok-sheet-head h2 { font-size: 17px; margin: 0; flex: 1; }
.fok-sheet-head .fok-x { background: none; border: none; font-size: 22px; color: var(--fok-muted); cursor: pointer; }

/* QR / certificate */
.fok-qr { text-align: center; padding: 10px; }
.fok-qr canvas, .fok-qr img { width: 190px; height: 190px; image-rendering: pixelated; }
.fok-verify { text-align: center; padding: 40px 20px; }
.fok-verify .fok-vic { width: 84px; height: 84px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 40px; color: #fff; margin-bottom: 14px; }
.fok-verify.ok .fok-vic { background: var(--fok-ok); }
.fok-verify.bad .fok-vic { background: var(--fok-err); }
.fok-verify h2 { margin: 0 0 6px; }
.fok-verify .fok-vrow { font-size: 14px; color: var(--fok-ink); margin: 4px 0; }
.fok-verify .fok-vk { color: var(--fok-muted); font-weight: 700; }
.fok-toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); background: #1c1c2e; color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 13px; font-weight: 700; z-index: 80; opacity: 0; transition: opacity .2s; }
.fok-toast.show { opacity: 1; }
