/* ==========================================================================
   Smart Tenant Management System — Core Stylesheet
   Mobile-first, WebView-optimized, dark-blue/white "premium SaaS" theme.
   ========================================================================== */

:root {
  --color-primary: #0B2559;
  --color-primary-light: #133580;
  --color-primary-dark: #071A3D;
  --color-accent: #3E7CFF;
  --color-accent-2: #22C7B5;
  --color-white: #FFFFFF;
  --color-bg: #F4F6FB;
  --color-surface: #FFFFFF;
  --color-border: #E6E9F2;
  --color-text: #16213E;
  --color-text-muted: #6B7591;
  --color-success: #1FAE6E;
  --color-warning: #F5A623;
  --color-danger: #E5484D;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;

  --shadow-card: 0 2px 10px rgba(11, 37, 89, 0.06);
  --shadow-card-hover: 0 10px 30px rgba(11, 37, 89, 0.12);
  --shadow-nav: 0 -2px 16px rgba(11, 37, 89, 0.08);

  --header-height: 60px;
  --bottom-nav-height: 64px;
  --sidebar-width: 260px;

  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; }

html, body {
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  margin: 0;
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation;
  min-height: 100vh;
  min-height: 100dvh;
}

a { text-decoration: none; color: inherit; }
button { touch-action: manipulation; font-family: inherit; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 10px; }

/* ---------------------------------------------------------------------- */
/* Buttons — large touch targets (min 44px) per mobile UX rules            */
/* ---------------------------------------------------------------------- */
.btn-app {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 15px;
  border: none;
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
  -webkit-user-select: none;
  user-select: none;
}
.btn-app:active { transform: scale(0.97); }
.btn-app-primary { background: var(--color-primary); color: var(--color-white); box-shadow: 0 4px 14px rgba(11,37,89,0.25); }
.btn-app-primary:hover { background: var(--color-primary-light); }
.btn-app-accent { background: var(--color-accent); color: var(--color-white); box-shadow: 0 4px 14px rgba(62,124,255,0.3); }
.btn-app-outline { background: transparent; color: var(--color-primary); border: 1.5px solid var(--color-border); }
.btn-app-block { width: 100%; }
.btn-app[disabled] { opacity: .6; cursor: not-allowed; transform: none; }

/* ---------------------------------------------------------------------- */
/* Guest layout (auth screens)                                             */
/* ---------------------------------------------------------------------- */
.auth-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 18px;
  background: linear-gradient(160deg, var(--color-primary) 0%, var(--color-primary-dark) 55%, #050f26 100%);
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 32px 26px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
  animation: cardIn .5s ease both;
}
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.auth-brand-mark {
  width: 42px; height: 42px; border-radius: 12px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 18px;
}
.auth-brand-name { font-weight: 700; font-size: 17px; color: var(--color-primary); }
.auth-title { font-size: 22px; font-weight: 700; margin: 0 0 4px; color: var(--color-text); }
.auth-subtitle { font-size: 14px; color: var(--color-text-muted); margin: 0 0 24px; }

.form-app-group { margin-bottom: 18px; }
.form-app-label { display: block; font-size: 13px; font-weight: 600; color: var(--color-text); margin-bottom: 6px; }
.form-app-control {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--color-border);
  background: #FBFCFE;
  font-size: 15px;
  color: var(--color-text);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.form-app-control:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 4px rgba(62,124,255,0.15);
  background: #fff;
}
.form-app-error { color: var(--color-danger); font-size: 12.5px; margin-top: 5px; display: none; }
.form-app-group.has-error .form-app-control { border-color: var(--color-danger); }
.form-app-group.has-error .form-app-error { display: block; }
.auth-links { text-align: center; margin-top: 18px; font-size: 14px; color: var(--color-text-muted); }
.auth-links a { color: var(--color-accent); font-weight: 600; }

/* ---------------------------------------------------------------------- */
/* Portal shell: sticky header + sidebar (desktop) + bottom nav (mobile)   */
/* ---------------------------------------------------------------------- */
.portal-shell { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }

.portal-header {
  position: sticky; top: 0; z-index: 40;
  height: var(--header-height);
  background: var(--color-primary);
  color: #fff;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px;
  box-shadow: 0 2px 14px rgba(0,0,0,0.12);
}
.portal-header-left { display: flex; align-items: center; gap: 10px; }
.portal-hamburger {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 10px; background: rgba(255,255,255,0.12);
  border: none; color: #fff; font-size: 18px;
}
.portal-header-title { font-weight: 700; font-size: 16px; }
.portal-header-right { display: flex; align-items: center; gap: 10px; }
.portal-icon-btn {
  width: 40px; height: 40px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.12); color: #fff; border: none; position: relative;
}
.portal-icon-btn .badge-dot {
  position: absolute; top: 6px; right: 7px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--color-danger); border: 2px solid var(--color-primary);
}
.portal-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--color-accent); color: #fff; font-weight: 700;
  display: flex; align-items: center; justify-content: center; font-size: 14px;
}

.portal-body { flex: 1; display: flex; }

.portal-sidebar {
  display: none;
  width: var(--sidebar-width);
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  padding: 18px 12px;
}
.sidebar-link {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: var(--radius-sm);
  color: var(--color-text-muted); font-weight: 600; font-size: 14.5px;
  margin-bottom: 4px; transition: background var(--transition-fast), color var(--transition-fast);
}
.sidebar-link i { font-size: 18px; width: 20px; text-align: center; }
.sidebar-link:hover { background: var(--color-bg); color: var(--color-primary); }
.sidebar-link.active { background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light)); color: #fff; box-shadow: 0 6px 16px rgba(11,37,89,0.25); }

.portal-main { flex: 1; min-width: 0; padding: 18px 14px calc(var(--bottom-nav-height) + 26px); }

.mobile-drawer-backdrop {
  position: fixed; inset: 0; background: rgba(7,26,61,0.5); z-index: 60;
  opacity: 0; pointer-events: none; transition: opacity var(--transition-base);
}
.mobile-drawer-backdrop.open { opacity: 1; pointer-events: auto; }
.mobile-drawer {
  position: fixed; top: 0; left: 0; bottom: 0; width: 82%; max-width: 300px;
  background: var(--color-surface); z-index: 61; padding: 18px 14px;
  transform: translateX(-100%); transition: transform var(--transition-base);
  overflow-y: auto;
}
.mobile-drawer.open { transform: translateX(0); }

.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  height: var(--bottom-nav-height);
  background: var(--color-surface);
  box-shadow: var(--shadow-nav);
  display: flex; align-items: stretch; justify-content: space-around;
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; color: var(--color-text-muted); font-size: 11px; font-weight: 600;
}
.bottom-nav-item i { font-size: 20px; }
.bottom-nav-item.active { color: var(--color-primary); }
.bottom-nav-item.active i { color: var(--color-accent); }

@media (min-width: 992px) {
  .portal-sidebar { display: block; }
  .portal-hamburger { display: none; }
  .bottom-nav { display: none; }
  .portal-main { padding-bottom: 26px; }
}

/* ---------------------------------------------------------------------- */
/* Cards / stats / dashboard widgets                                       */
/* ---------------------------------------------------------------------- */
.app-card {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  padding: 18px;
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--transition-base), transform var(--transition-base);
}
.app-card:hover { box-shadow: var(--shadow-card-hover); transform: translateY(-2px); }

.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 640px) { .stat-grid { grid-template-columns: repeat(4, 1fr); } }
.stat-card { display: flex; flex-direction: column; gap: 8px; }
.stat-icon {
  width: 42px; height: 42px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; font-size: 19px; color: #fff;
}
.stat-value { font-size: 22px; font-weight: 800; color: var(--color-text); }
.stat-label { font-size: 12.5px; color: var(--color-text-muted); font-weight: 600; }

.section-title { font-size: 17px; font-weight: 700; margin: 24px 0 12px; color: var(--color-text); }

.welcome-banner {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
  color: #fff; border-radius: var(--radius-lg); padding: 22px; margin-bottom: 18px;
  box-shadow: 0 10px 30px rgba(11,37,89,0.2);
}
.welcome-banner h2 { margin: 0 0 4px; font-size: 19px; }
.welcome-banner p { margin: 0; opacity: 0.85; font-size: 13.5px; }

/* ---------------------------------------------------------------------- */
/* Empty states                                                            */
/* ---------------------------------------------------------------------- */
.empty-state { text-align: center; padding: 40px 16px; color: var(--color-text-muted); }
.empty-state i { font-size: 42px; color: var(--color-border); margin-bottom: 12px; display: block; }
.empty-state h4 { color: var(--color-text); font-size: 15px; margin: 0 0 4px; }
.empty-state p { font-size: 13.5px; margin: 0 0 16px; }

/* ---------------------------------------------------------------------- */
/* Skeleton loaders                                                         */
/* ---------------------------------------------------------------------- */
.skeleton {
  background: linear-gradient(90deg, #eef1f8 25%, #f6f8fc 37%, #eef1f8 63%);
  background-size: 400% 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
  border-radius: 10px;
}
@keyframes skeleton-shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---------------------------------------------------------------------- */
/* Animations                                                               */
/* ---------------------------------------------------------------------- */
@keyframes cardIn { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
.fade-in-up { animation: cardIn var(--transition-base) both; }

/* ---------------------------------------------------------------------- */
/* Onboarding guided tour                                                   */
/* ---------------------------------------------------------------------- */
.tour-overlay { position: fixed; inset: 0; background: rgba(7,26,61,0.55); z-index: 200; opacity: 0; pointer-events: none; transition: opacity var(--transition-base); }
.tour-overlay.open { opacity: 1; pointer-events: auto; }
.tour-highlight {
  position: absolute; border-radius: 14px;
  box-shadow: 0 0 0 4px var(--color-accent), 0 0 0 9999px rgba(7,26,61,0.55);
  transition: all var(--transition-base);
}
.tour-tooltip {
  position: absolute; max-width: 300px; background: #fff; border-radius: var(--radius-md);
  padding: 18px; box-shadow: 0 20px 50px rgba(0,0,0,0.3); animation: cardIn .3s ease both;
}
.tour-tooltip-progress { font-size: 11.5px; font-weight: 700; color: var(--color-accent); margin-bottom: 6px; letter-spacing: .04em; text-transform: uppercase; }
.tour-tooltip h5 { margin: 0 0 6px; font-size: 15.5px; color: var(--color-text); }
.tour-tooltip p { margin: 0 0 16px; font-size: 13.5px; color: var(--color-text-muted); }
.tour-tooltip-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

/* ---------------------------------------------------------------------- */
/* Notifications (Module 11)                                                */
/* ---------------------------------------------------------------------- */
.notif-row { cursor: pointer; }
.notif-row.notif-unread { background: #F0F5FF; border-color: #C9DCFF; }
.notif-icon {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--color-bg); color: var(--color-primary); font-size: 16px;
}
.badge-dot-inline { width: 8px; height: 8px; border-radius: 50%; background: var(--color-danger); flex-shrink: 0; margin-top: 4px; }

.notif-dropdown {
  position: absolute; top: 56px; right: 12px; width: 320px; max-width: calc(100vw - 24px);
  background: #fff; border-radius: var(--radius-md); box-shadow: 0 20px 50px rgba(0,0,0,0.25);
  z-index: 210; display: none; overflow: hidden;
}
.notif-dropdown.open { display: block; }
.notif-dropdown-header {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 12px 14px; border-bottom: 1px solid var(--color-border);
}
.notif-dropdown-header h6 { margin: 0; font-size: 14px; font-weight: 700; color: var(--color-text); }
.notif-dropdown-header a { font-size: 12px; font-weight: 600; color: var(--color-primary); text-decoration: none; }
.notif-dropdown-list { max-height: 340px; overflow-y: auto; }
.notif-dropdown-item {
  display: flex; align-items: flex-start; gap: 10px; padding: 10px 14px; cursor: pointer;
  border-bottom: 1px solid var(--color-border); text-decoration: none;
}
.notif-dropdown-item:last-child { border-bottom: none; }
.notif-dropdown-item.unread { background: #F0F5FF; }
.notif-dropdown-item .notif-icon { width: 30px; height: 30px; font-size: 14px; }
.notif-dropdown-item-title { font-size: 13px; font-weight: 700; color: var(--color-text); margin-bottom: 2px; }
.notif-dropdown-item-msg { font-size: 12px; color: var(--color-text-muted); line-height: 1.4; }
.notif-dropdown-item-time { font-size: 10.5px; color: var(--color-text-muted); margin-top: 4px; }
.notif-dropdown-empty { padding: 28px 14px; text-align: center; color: var(--color-text-muted); font-size: 13px; }
.notif-dropdown-footer { padding: 10px 14px; text-align: center; border-top: 1px solid var(--color-border); }

/* Priority (client-requested addition, migration 017) — important/urgent
   notifications stand out visually in both the dropdown list and the
   popup toast, normal ones keep the original neutral styling. */
.notif-dropdown-item.notif-priority-important { border-left: 3px solid var(--color-warning); }
.notif-dropdown-item.notif-priority-urgent { border-left: 3px solid var(--color-danger); background: #FFF3F3; }
.notif-dropdown-item.notif-priority-urgent.unread { background: #FFE9E9; }
.notif-dropdown-item.notif-priority-important .notif-icon { background: #FFF6E6; color: var(--color-warning); }
.notif-dropdown-item.notif-priority-urgent .notif-icon { background: #FFE9E9; color: var(--color-danger); }

.notif-popup.notif-priority-important { border-left: 4px solid var(--color-warning); }
.notif-popup.notif-priority-urgent { border-left: 4px solid var(--color-danger); }
.notif-dropdown-footer a { font-size: 12.5px; font-weight: 700; color: var(--color-primary); text-decoration: none; }

/* Mandatory center notification modal (Critical/Important — spec "MAJOR UX
   IMPROVEMENT — NOTIFICATION SYSTEM"). SweetAlert2's own popup is already
   responsive (relative width, max-width, scrollable body); this only adds
   the priority accent + a touch more mobile breathing room. */
.notif-modal { border-top: 5px solid var(--color-warning); border-radius: 16px; max-width: 92vw; }
.notif-modal.notif-priority-urgent { border-top-color: var(--color-danger); }
@media (max-width: 480px) {
  .notif-modal { width: 92vw !important; padding: 1rem !important; }
}

/* ---------------------------------------------------------------------- */
/* Public marketing site (Section 3 audit gap — homepage/search/enquiry)   */
/* Full-width shell, deliberately distinct from the narrow .auth-shell     */
/* "auth-card" used by login/register, and from the fixed-sidebar         */
/* .portal-shell used by the 4 authenticated portals.                     */
/* ---------------------------------------------------------------------- */
.public-shell { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }

.public-navbar {
  background: var(--color-surface); border-bottom: 1px solid var(--color-border);
  position: sticky; top: 0; z-index: 100; box-shadow: var(--shadow-card);
}
.public-navbar-inner {
  max-width: 1180px; margin: 0 auto; padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.public-brand { display: flex; align-items: center; gap: 10px; }
.public-brand-mark {
  width: 38px; height: 38px; border-radius: 10px; background: var(--color-primary);
  color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 15px;
}
.public-brand-logo { height: 38px; max-width: 140px; object-fit: contain; }
.public-brand-name { font-weight: 800; font-size: 17px; color: var(--color-primary); }
.public-nav-toggle {
  display: none; background: none; border: none; font-size: 22px; color: var(--color-primary); cursor: pointer;
}
.public-nav-links { display: flex; align-items: center; gap: 22px; }
.public-nav-links a:not(.btn-app) {
  font-weight: 600; font-size: 14.5px; color: var(--color-text-muted); text-decoration: none;
}
.public-nav-links a:not(.btn-app):hover, .public-nav-links a:not(.btn-app).active { color: var(--color-primary); }
.public-nav-links .btn-app { padding: 8px 18px; }

.public-main { flex: 1; max-width: 1180px; width: 100%; margin: 0 auto; padding: 16px 20px 60px; }

.public-hero {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
  color: #fff; border-radius: var(--radius-lg); padding: 32px 32px 40px; margin-bottom: 32px;
  box-shadow: var(--shadow-card-hover);
}
.public-hero h1 { font-size: 30px; font-weight: 800; margin: 0 0 10px; }
.public-hero p { font-size: 15.5px; opacity: .88; margin: 0 0 22px; max-width: 560px; }
.public-hero-search { background: #fff; border-radius: var(--radius-md); padding: 14px; box-shadow: 0 10px 30px rgba(0,0,0,0.15); }

.public-stats { display: flex; gap: 28px; margin-top: 22px; flex-wrap: wrap; }
.public-stat-value { font-size: 24px; font-weight: 800; }
.public-stat-label { font-size: 12.5px; opacity: .8; }

.public-hero-badge {
  display: inline-flex; align-items: center; gap: 7px; background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.28); border-radius: 999px; padding: 6px 14px;
  font-size: 12.5px; font-weight: 600; margin-bottom: 16px;
}

/* Section headings shared by "How It Works" / "Why Choose Us" */
.section-heading { text-align: center; max-width: 520px; margin: 44px auto 24px; }
.section-heading h2 { font-size: 22px; font-weight: 800; color: var(--color-primary); margin: 0 0 6px; }
.section-heading p { font-size: 14px; color: var(--color-text-muted); margin: 0; }

.steps-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; margin-bottom: 8px; }
.step-card {
  background: var(--color-surface); border-radius: var(--radius-md); padding: 24px 20px;
  box-shadow: var(--shadow-card); text-align: center; position: relative;
}
.step-number {
  position: absolute; top: 14px; right: 16px; width: 24px; height: 24px; border-radius: 50%;
  background: var(--color-bg); color: var(--color-text-muted); font-size: 12px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.step-icon { font-size: 30px; color: var(--color-accent); margin-bottom: 12px; display: block; }
.step-card h3 { font-size: 15.5px; font-weight: 700; margin: 0 0 8px; color: var(--color-text); }
.step-card p { font-size: 13px; color: var(--color-text-muted); margin: 0; line-height: 1.55; }

.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; margin-bottom: 8px; }
.feature-card {
  background: var(--color-surface); border-radius: var(--radius-md); padding: 22px 20px;
  box-shadow: var(--shadow-card); transition: var(--transition-base);
}
.feature-card:hover { box-shadow: var(--shadow-card-hover); transform: translateY(-2px); }
.feature-icon {
  width: 44px; height: 44px; border-radius: 12px; background: rgba(62,124,255,0.12);
  color: var(--color-accent); font-size: 20px; display: flex; align-items: center; justify-content: center; margin-bottom: 14px;
}
.feature-card h3 { font-size: 15px; font-weight: 700; margin: 0 0 6px; color: var(--color-text); }
.feature-card p { font-size: 13px; color: var(--color-text-muted); margin: 0; line-height: 1.55; }

.property-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.property-card {
  background: var(--color-surface); border-radius: var(--radius-md); overflow: hidden;
  box-shadow: var(--shadow-card); transition: var(--transition-base); display: block; text-decoration: none;
}
.property-card:hover { box-shadow: var(--shadow-card-hover); transform: translateY(-3px); }
.property-card-image {
  position: relative; height: 160px; background: #EEF1F8; display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.property-card-image img { width: 100%; height: 100%; object-fit: cover; }
.property-card-body { padding: 14px 16px; }
.property-card-title { font-weight: 700; font-size: 15.5px; color: var(--color-text); margin-bottom: 3px; }
.property-card-meta { font-size: 12.5px; color: var(--color-text-muted); }

.cta-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  background: linear-gradient(135deg, var(--color-primary-dark), var(--color-primary));
  color: #fff; border-radius: var(--radius-lg); padding: 32px; margin-top: 44px;
}
.cta-banner h2 { font-size: 20px; font-weight: 800; margin: 0 0 6px; }
.cta-banner p { font-size: 14px; opacity: .85; margin: 0; max-width: 440px; }
.btn-app-light { background: #fff; color: var(--color-primary); box-shadow: 0 4px 14px rgba(0,0,0,0.18); }
.btn-app-light:hover { background: #F4F6FB; }

.public-footer { background: var(--color-primary-dark); color: #fff; margin-top: auto; padding: 32px 20px 0; }
.public-footer-inner {
  max-width: 1180px; margin: 0 auto; display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding-bottom: 24px;
}
.public-footer-links { display: flex; gap: 18px; flex-wrap: wrap; align-items: flex-start; }
.public-footer-links a { color: rgba(255,255,255,0.75); font-size: 13.5px; text-decoration: none; }
.public-footer-links a:hover { color: #fff; }
.public-footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12); text-align: center; padding: 14px; font-size: 12.5px; opacity: .65;
}

@media (max-width: 767px) {
  .public-nav-toggle { display: block; }
  .public-nav-links {
    position: absolute; top: 100%; left: 0; right: 0; background: var(--color-surface);
    flex-direction: column; align-items: stretch; gap: 0; padding: 8px 20px 16px;
    box-shadow: var(--shadow-card); display: none;
  }
  .public-nav-links.open { display: flex; }
  .public-nav-links a:not(.btn-app) { padding: 10px 0; border-bottom: 1px solid var(--color-border); }
  .public-nav-links .btn-app { margin-top: 10px; }
  .public-main { padding-top: 10px; }
  .public-hero { padding: 18px 20px 26px; }
  .public-hero h1 { font-size: 24px; }
  .section-heading { margin: 32px auto 18px; }
  .cta-banner { padding: 26px 22px; text-align: center; justify-content: center; }
  .cta-banner p { max-width: none; }
}

/* ---------------------------------------------------------------------- */
/* Public site — animated hero, scroll-reveal, pricing page                */
/* ---------------------------------------------------------------------- */

/* Animated gradient + floating blobs behind the hero banner. Purely
   decorative (aria-hidden), sits behind the hero content via z-index. */
.public-hero { position: relative; overflow: hidden; background-size: 220% 220%; animation: heroGradient 14s ease infinite; }
@keyframes heroGradient {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
.public-hero-blob {
  position: absolute; border-radius: 50%; filter: blur(2px); opacity: .18; pointer-events: none;
  background: radial-gradient(circle, #fff 0%, transparent 70%);
  animation: heroFloat 9s ease-in-out infinite;
}
.public-hero-blob.b1 { width: 220px; height: 220px; top: -60px; right: 8%; animation-duration: 11s; }
.public-hero-blob.b2 { width: 140px; height: 140px; bottom: -40px; right: 28%; animation-duration: 8s; animation-delay: -3s; }
.public-hero-blob.b3 { width: 90px; height: 90px; top: 20%; left: 4%; animation-duration: 7s; animation-delay: -1.5s; }
@keyframes heroFloat {
  0%, 100% { transform: translateY(0) translateX(0); }
  50%      { transform: translateY(-18px) translateX(10px); }
}
.public-hero > * { position: relative; z-index: 1; }
.public-hero-badge { animation: cardIn .6s ease both; }
.public-hero h1 { animation: cardIn .6s ease .08s both; }
.public-hero p { animation: cardIn .6s ease .16s both; }
.public-hero-search { animation: cardIn .6s ease .24s both; }
.public-stats { animation: cardIn .6s ease .32s both; }

/* Scroll-reveal: elements start hidden/offset, footer-public.php's
   IntersectionObserver adds .is-visible when they enter the viewport.
   Falls back to always-visible if JS never runs (progressive enhancement —
   see the no-js safety net at the bottom of this block). */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s cubic-bezier(0.4,0,0.2,1), transform .7s cubic-bezier(0.4,0,0.2,1); }
.reveal.is-visible { opacity: 1; transform: none; }
.reveal-stagger.is-visible > * { animation: cardIn .55s cubic-bezier(0.4,0,0.2,1) both; }
.reveal-stagger.is-visible > *:nth-child(1) { animation-delay: .02s; }
.reveal-stagger.is-visible > *:nth-child(2) { animation-delay: .09s; }
.reveal-stagger.is-visible > *:nth-child(3) { animation-delay: .16s; }
.reveal-stagger.is-visible > *:nth-child(4) { animation-delay: .23s; }
.reveal-stagger.is-visible > *:nth-child(5) { animation-delay: .30s; }
.reveal-stagger.is-visible > *:nth-child(6) { animation-delay: .37s; }
/* No-JS safety net: if scripting is unavailable, footer-public.php's
   IntersectionObserver never runs to add .is-visible — don't leave
   content permanently invisible in that case. */
@media (scripting: none) {
  .reveal, .reveal-stagger > * { opacity: 1; transform: none; animation: none; }
}

/* Property/feature/step cards already lift on hover — layer in a touch
   more life without changing their existing box-shadow behavior. */
.step-card, .feature-card, .property-card { will-change: transform; }

/* ---------------------------------------------------------------------- */
/* Pricing page                                                            */
/* ---------------------------------------------------------------------- */
.pricing-hero {
  text-align: center; max-width: 640px; margin: 8px auto 40px;
}
.pricing-hero h1 { font-size: 28px; font-weight: 800; color: var(--color-primary); margin: 0 0 10px; }
.pricing-hero p { font-size: 15px; color: var(--color-text-muted); margin: 0; }

.pricing-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 22px; align-items: stretch;
}
.pricing-card {
  position: relative; background: var(--color-surface); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card); border: 1px solid var(--color-border);
  display: flex; flex-direction: column; overflow: hidden;
  transition: transform .35s cubic-bezier(0.4,0,0.2,1), box-shadow .35s cubic-bezier(0.4,0,0.2,1);
}
.pricing-card:hover { transform: translateY(-6px) scale(1.015); box-shadow: 0 20px 46px rgba(11,37,89,0.16); }
.pricing-card.is-featured { border: 1px solid var(--color-accent); box-shadow: 0 16px 40px rgba(62,124,255,0.18); }
.pricing-card.is-featured:hover { box-shadow: 0 22px 50px rgba(62,124,255,0.26); }

.pricing-card-ribbon {
  position: absolute; top: 14px; right: -34px; transform: rotate(40deg);
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent-2));
  color: #fff; font-size: 10.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  padding: 4px 40px; box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.pricing-card-head {
  padding: 26px 22px 20px; color: #fff;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
}
.pricing-card.is-free .pricing-card-head { background: linear-gradient(135deg, #2c9d78, var(--color-accent-2)); }
.pricing-card-name { font-size: 15px; font-weight: 700; opacity: .9; text-transform: uppercase; letter-spacing: .03em; }
.pricing-card-price { display: flex; align-items: baseline; gap: 4px; margin-top: 8px; }
.pricing-card-price .amount { font-size: 34px; font-weight: 800; line-height: 1; }
.pricing-card-price .cycle { font-size: 12.5px; opacity: .8; }
.pricing-card-desc { font-size: 12.5px; opacity: .85; margin-top: 8px; line-height: 1.5; }

.pricing-card-body { padding: 20px 22px 24px; display: flex; flex-direction: column; flex: 1; }
.pricing-feature-list { display: flex; flex-direction: column; gap: 11px; margin: 0 0 20px; flex: 1; }
.pricing-feature { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--color-text); }
.pricing-feature i { font-size: 15px; width: 18px; text-align: center; flex-shrink: 0; }
.pricing-feature.is-on i { color: var(--color-success); }
.pricing-feature.is-off { color: var(--color-text-muted); }
.pricing-feature.is-off i { color: #C7CCDC; }

.pricing-note {
  text-align: center; max-width: 560px; margin: 40px auto 0; font-size: 12.5px; color: var(--color-text-muted);
}

@media (max-width: 767px) {
  .pricing-card-ribbon { right: -38px; top: 12px; }
}

/* ---------------------------------------------------------------------- */
/* App splash / loading screen — shown on public pages while the page and  */
/* its assets finish loading. Matters most when this site is wrapped in an */
/* Android WebView "app" shell, where a blank white flash on open reads as */
/* broken rather than loading. Self-removes once window 'load' fires (with */
/* a minimum visible time so it never just flickers, and a hard failsafe   */
/* so a slow/broken resource can never trap someone behind it forever).    */
/* ---------------------------------------------------------------------- */
.app-splash {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  background: linear-gradient(135deg, var(--color-primary-dark), var(--color-primary) 55%, var(--color-accent));
  background-size: 200% 200%;
  animation: heroGradient 6s ease infinite;
  color: #fff;
  transition: opacity .5s ease, visibility .5s ease;
}
.app-splash.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.app-splash-badge { position: relative; width: 84px; height: 84px; display: flex; align-items: center; justify-content: center; }
.app-splash-ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.18); border-top-color: #fff;
  animation: splashSpin 1s linear infinite;
}
.app-splash-mark {
  width: 58px; height: 58px; border-radius: 18px; background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.3); display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 20px; letter-spacing: .02em; overflow: hidden;
}
.app-splash-mark img { width: 100%; height: 100%; object-fit: contain; }
@keyframes splashSpin { to { transform: rotate(360deg); } }
.app-splash-name { font-size: 15px; font-weight: 700; letter-spacing: .02em; opacity: .95; }
.app-splash-dots { display: flex; gap: 6px; }
.app-splash-dots span {
  width: 6px; height: 6px; border-radius: 50%; background: #fff; opacity: .5;
  animation: splashDot 1.1s ease-in-out infinite;
}
.app-splash-dots span:nth-child(2) { animation-delay: .15s; }
.app-splash-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes splashDot { 0%, 80%, 100% { opacity: .35; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-4px); } }

/* ---------------------------------------------------------------------- */
/* Colorful icon variants — a small rotating palette applied to feature/   */
/* step icons in the view (icon-a/b/c/d) so the page reads as vibrant      */
/* rather than a single flat blue tint everywhere.                        */
/* ---------------------------------------------------------------------- */
.feature-icon.icon-a { background: linear-gradient(135deg, #3E7CFF, #6f9bff); color: #fff; }
.feature-icon.icon-b { background: linear-gradient(135deg, #22C7B5, #4fe0cf); color: #fff; }
.feature-icon.icon-c { background: linear-gradient(135deg, #F5A623, #ffc25c); color: #fff; }
.feature-icon.icon-d { background: linear-gradient(135deg, #8B5CF6, #b18cfb); color: #fff; }
.feature-icon { transition: transform .35s cubic-bezier(0.34,1.56,0.64,1); }
.feature-card:hover .feature-icon { transform: scale(1.1) rotate(-6deg); }

.step-icon-wrap {
  width: 54px; height: 54px; border-radius: 16px; display: flex; align-items: center; justify-content: center;
  font-size: 22px; margin: 0 auto 14px; color: #fff;
  box-shadow: 0 10px 22px rgba(11,37,89,0.18);
  transition: transform .35s cubic-bezier(0.34,1.56,0.64,1);
}
.step-icon-wrap.icon-a { background: linear-gradient(135deg, #3E7CFF, #6f9bff); }
.step-icon-wrap.icon-b { background: linear-gradient(135deg, #22C7B5, #4fe0cf); }
.step-icon-wrap.icon-c { background: linear-gradient(135deg, #F5A623, #ffc25c); }
.step-card:hover .step-icon-wrap { transform: scale(1.1) rotate(-6deg); }

/* Hero: subtle floating icons layered with the gradient blobs. */
.public-hero-float { position: absolute; color: rgba(255,255,255,0.16); pointer-events: none; animation: heroFloat 8s ease-in-out infinite; }
.public-hero-float.f1 { top: 12%; right: 12%; font-size: 52px; animation-duration: 9s; }
.public-hero-float.f2 { bottom: 18%; right: 32%; font-size: 32px; animation-duration: 7s; animation-delay: -2s; }
.public-hero-float.f3 { top: 58%; left: 6%; font-size: 28px; animation-duration: 10s; animation-delay: -4s; }
@media (max-width: 575px) { .public-hero-float { display: none; } }

.text-gradient-accent {
  background: linear-gradient(90deg, #fff, #BFD9FF);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* CTA banners: a subtle dot-grid texture so the gradient isn't flat. */
.cta-banner { position: relative; overflow: hidden; }
.cta-banner::before {
  content: ''; position: absolute; inset: 0; opacity: .12; pointer-events: none;
  background-image: radial-gradient(circle, #fff 1.5px, transparent 1.5px);
  background-size: 18px 18px;
}
.cta-banner > * { position: relative; z-index: 1; }
.cta-banner .btn-app-light:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(0,0,0,0.2); }

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  .public-hero, .public-hero-blob, .public-hero-float, .public-hero-badge, .public-hero h1, .public-hero p,
  .public-hero-search, .public-stats, .reveal, .reveal-stagger > *, .pricing-card,
  .app-splash, .app-splash-ring, .app-splash-dots span, .feature-icon, .step-icon-wrap {
    animation: none !important; transition: none !important;
  }
  .reveal, .reveal-stagger > * { opacity: 1 !important; transform: none !important; }
}

/* ---------------------------------------------------------------------- */
/* Utility                                                                  */
/* ---------------------------------------------------------------------- */
.text-muted-app { color: var(--color-text-muted); }
.no-scroll { overflow: hidden; }
