/* Califitoga App: app-mode shell, install guide */
:root { --cfa-green:#5b8c1e; --cfa-dark:#111; --cfa-ring:#ff8a00; }

/* ---------- App mode (installed app only) ---------- */
.cfa-topbar, .cfa-tabbar { display:none; }
html.cfa-standalone .cfa-topbar {
  display:flex; align-items:center; justify-content:center; position:fixed; top:0; left:0; right:0; z-index:99990;
  background:var(--cfa-dark); height:calc(58px + env(safe-area-inset-top)); padding-top:env(safe-area-inset-top);
}
html.cfa-standalone .cfa-topbar img { height:42px; width:auto; max-width:70vw; display:block; }
html.cfa-standalone .cfa-tabbar {
  display:flex; position:fixed; left:0; right:0; bottom:0; z-index:99990; background:#fff; border-top:1px solid #e3e3e3;
  padding:6px 4px calc(6px + env(safe-area-inset-bottom)); justify-content:space-around;
}
html.cfa-standalone .cfa-tab {
  flex:1; display:flex; flex-direction:column; align-items:center; gap:2px; color:#6b6b6b; text-decoration:none;
  font:600 11px/1.2 -apple-system,"Segoe UI",Roboto,sans-serif; padding:4px 0; -webkit-tap-highlight-color:transparent;
}
html.cfa-standalone .cfa-tab { touch-action:manipulation; cursor:pointer; }
html.cfa-standalone .cfa-tab.is-on { color:var(--cfa-green); }
html.cfa-standalone .cfa-tab.is-pending svg { animation:cfa-bob .7s ease-in-out infinite alternate; }
@keyframes cfa-bob { to { transform:translateY(-2px); opacity:.6; } }
html.cfa-standalone body.cfa-app-page { padding-top:calc(58px + env(safe-area-inset-top)) !important; padding-bottom:calc(66px + env(safe-area-inset-bottom)) !important; }

/* Remove the empty space Uncode reserves for the website header, and the dark page background */
html.cfa-standalone:has(body.cfa-app-page), html.cfa-standalone body.cfa-app-page { background:#fff !important; }
html.cfa-standalone body.cfa-app-page #sections-container { padding-top:0 !important; }
html.cfa-standalone body.cfa-app-page.cft-page .row.row-parent { padding-top:14px !important; padding-bottom:10px !important; }
html.cfa-standalone body.cfa-app-page .box-wrapper { min-height:calc(100vh - 58px - 66px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
html.cfa-standalone body.cfa-app-page #vh_layout_help, html.cfa-standalone body.cfa-app-page .gdpr-overlay { pointer-events:none !important; }

/* Tap feedback while the next page loads */
.cfa-progress { display:none; }
html.cfa-standalone .cfa-progress { display:block; position:fixed; left:0; top:calc(58px + env(safe-area-inset-top)); height:3px; width:0; background:#7fb32c; z-index:99995; opacity:0; }
html.cfa-standalone.cfa-loading .cfa-progress { opacity:1; animation:cfa-load 6s cubic-bezier(.1,.7,.2,1) forwards; }
@keyframes cfa-load { to { width:92%; } }
html.cfa-standalone.cfa-loading body.cfa-app-page .box-wrapper { opacity:.55; transition:opacity .2s; }

/* Back to top arrow */
.cfa-top { display:none; }
html.cfa-standalone .cfa-top {
  display:flex; align-items:center; justify-content:center; position:fixed; right:14px; bottom:calc(78px + env(safe-area-inset-bottom)); z-index:99991;
  width:46px; height:46px; border-radius:50%; border:0; background:var(--cfa-green); color:#fff; box-shadow:0 4px 14px rgba(0,0,0,.25);
  opacity:0; transform:translateY(12px); pointer-events:none; transition:opacity .2s, transform .2s; touch-action:manipulation; -webkit-tap-highlight-color:transparent;
}
html.cfa-standalone .cfa-top.is-on { opacity:1; transform:none; pointer-events:auto; }

/* Hide the website chrome inside the app (member pages only) */
html.cfa-standalone body.cfa-app-page #masthead,
html.cfa-standalone body.cfa-app-page .menu-wrapper,
html.cfa-standalone body.cfa-app-page .menu-container,
html.cfa-standalone body.cfa-app-page .vmenu-container,
html.cfa-standalone body.cfa-app-page .menu-overlay,
html.cfa-standalone body.cfa-app-page #uncode-privacy-banner,
html.cfa-standalone body.cfa-app-page .uncode-privacy-wrapper,
html.cfa-standalone body.cfa-app-page footer,
html.cfa-standalone body.cfa-app-page .site-footer,
html.cfa-standalone body.cfa-app-page #colophon,
html.cfa-standalone body.cfa-app-page .cft-nav { display:none !important; }
html.cfa-standalone .footer-scroll-top,
html.cfa-standalone .cfa-guide,
html.cfa-standalone .cfa-guide-wrap { display:none !important; }

/* Public website pages opened from inside the app: normal site plus a way back */
.cfa-back { display:none; }
html.cfa-standalone .cfa-back {
  display:flex; align-items:center; gap:6px; position:fixed; left:12px; top:calc(10px + env(safe-area-inset-top)); z-index:99992;
  background:var(--cfa-green); color:#fff; text-decoration:none; font:700 14px/1 -apple-system,"Segoe UI",Roboto,sans-serif;
  padding:11px 16px 11px 12px; border-radius:999px; box-shadow:0 3px 12px rgba(0,0,0,.3); touch-action:manipulation;
}

/* Pull down to refresh */
.cfa-ptr { display:none; }
html.cfa-standalone .cfa-ptr {
  display:flex; align-items:center; justify-content:center; position:fixed; left:50%; top:calc(58px + env(safe-area-inset-top) + 6px);
  width:38px; height:38px; margin-left:-19px; border-radius:50%; background:#fff; color:var(--cfa-green); box-shadow:0 3px 12px rgba(0,0,0,.25);
  z-index:99993; opacity:0; transform:translateY(-40px); pointer-events:none;
}
html.cfa-standalone .cfa-ptr.is-spin svg { animation:cfa-spin .8s linear infinite; }
@keyframes cfa-spin { to { transform:rotate(360deg); } }

/* ---------- Homepage install guide ---------- */
.cfa-guide-wrap { padding:56px 20px; background:#f5f8ef; }
.cfa-guide { max-width:1040px; margin:0 auto; font-family:inherit; color:#111; }
.cfa-guide h2 { font-size:clamp(26px,4vw,38px); line-height:1.15; margin:0 0 8px; text-align:center; }
.cfa-guide .cfa-sub { text-align:center; color:#555; margin:0 auto 22px; max-width:560px; }
.cfa-tabs { display:flex; gap:8px; justify-content:center; margin-bottom:26px; }
.cfa-tabs button { appearance:none; border:2px solid var(--cfa-green); background:#fff; color:var(--cfa-green); font:700 15px/1 inherit; padding:12px 22px; border-radius:999px; cursor:pointer; }
.cfa-tabs button.is-on { background:var(--cfa-green); color:#fff; }
.cfa-steps[hidden] { display:none !important; }
.cfa-steps { display:grid; grid-template-columns:repeat(auto-fit,minmax(190px,1fr)); gap:18px; list-style:none; margin:0; padding:0; }
.cfa-steps li { background:#fff; border-radius:18px; padding:16px 14px 18px; text-align:center; box-shadow:0 2px 10px rgba(0,0,0,.05); }
.cfa-steps svg { width:100%; max-width:150px; height:auto; display:block; margin:0 auto 12px; }
.cfa-steps b { display:inline-flex; width:26px; height:26px; border-radius:50%; background:var(--cfa-green); color:#fff; align-items:center; justify-content:center; font-size:14px; margin-bottom:8px; }
.cfa-steps h3 { font-size:16px; margin:0 0 4px; }
.cfa-steps p { font-size:14px; line-height:1.45; color:#555; margin:0; }
.cfa-install-btn { display:none; margin:0 auto 22px; background:var(--cfa-ring); color:#fff; border:0; border-radius:999px; padding:14px 30px; font:700 16px/1 inherit; cursor:pointer; }
html.cfa-can-install .cfa-install-btn { display:block; }
html.cfa-installed .cfa-install-btn { display:none; }
.cfa-note { text-align:center; font-size:13px; color:#666; margin:18px 0 0; }
.cfa-pulse { animation:cfa-pulse 1.6s ease-out infinite; transform-origin:center; transform-box:fill-box; }
@keyframes cfa-pulse { 0%{opacity:.9;transform:scale(.85)} 70%{opacity:0;transform:scale(1.5)} 100%{opacity:0;transform:scale(1.5)} }
@media (prefers-reduced-motion:reduce){ .cfa-pulse{animation:none;opacity:.8} }
