/* ════════════════════════════════════════════════════════════════
   NILA Connect v13 — UI/UX Design Pass
   Loaded LAST. Overrides previous CSS layers without changing
   markup, IDs, classes, forms, or app.js hooks.
   Focus: warm, modern, mobile-first, trustworthy, human.
   ════════════════════════════════════════════════════════════════ */

/* ── 1. Design tokens ───────────────────────────────────────── */
:root {
  /* Warm consumer-marketplace palette */
  --n-bg:        #fbf8f3;   /* warm paper */
  --n-surface:   #ffffff;
  --n-surface-2: #f5f0e7;
  --n-ink:       #0b2540;   /* deep navy */
  --n-ink-2:     #2b3d52;
  --n-muted:     #6a7a8c;
  --n-line:      #ece3d2;   /* warm border */
  --n-line-2:    #e3ebf4;

  --n-brand:     #0d6b55;   /* deep teal (matches theme-color) */
  --n-brand-dk:  #0a5040;
  --n-brand-lt:  #e6f0ec;
  --n-gold:      #d4a832;
  --n-gold-dk:   #b08a1f;
  --n-coral:     #ef7a42;
  --n-mint:      #2ea579;

  --n-shadow-1:  0 1px 2px rgba(11,37,64,.04), 0 6px 18px rgba(11,37,64,.06);
  --n-shadow-2:  0 2px 4px rgba(11,37,64,.05), 0 18px 40px rgba(11,37,64,.10);
  --n-shadow-3:  0 4px 8px rgba(11,37,64,.06), 0 30px 70px rgba(11,37,64,.14);

  --n-radius-sm: 10px;
  --n-radius:    16px;
  --n-radius-lg: 22px;
  --n-radius-xl: 28px;
  --n-pill:      999px;

  /* Overwrite legacy tokens so existing rules pick up the new look */
  --paper: var(--n-bg);
  --white: var(--n-surface);
  --ink:   var(--n-ink);
  --navy:  var(--n-ink);
  --navy2: #154c8f;
  --teal:  var(--n-brand);
  --gold:  var(--n-gold);
  --muted: var(--n-muted);
  --light: #8aabbf;
  --border:  var(--n-line);
  --border2: var(--n-line-2);
  --shadow:  var(--n-shadow-1);
  --shadow2: var(--n-shadow-2);
  --radius:  var(--n-radius);
  --radius2: var(--n-radius-lg);
}

/* ── 2. Base typography ─────────────────────────────────────── */
html, body {
  background: var(--n-bg);
  color: var(--n-ink);
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-feature-settings: 'ss01','cv11';
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { color: var(--n-ink); letter-spacing: -0.022em; line-height: 1.12; }
h1 { font-weight: 800; }
h2 { font-weight: 800; letter-spacing: -0.025em; }
h3 { font-weight: 700; }
p  { color: var(--n-ink-2); line-height: 1.6; }
.container { width: min(1180px, 92vw); margin: 0 auto; }

/* Selection */
::selection { background: var(--n-gold); color: var(--n-ink); }

/* ── 3. Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 22px; border-radius: var(--n-pill);
  font-weight: 700; font-size: 14.5px; letter-spacing: -0.005em;
  border: 1.5px solid transparent; cursor: pointer;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease, color .2s ease, border-color .2s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

/* Primary action = deep teal brand (used to be gold) */
.btn-primary {
  background: var(--n-brand); color: #fff;
  box-shadow: 0 6px 16px rgba(13,107,85,.28);
}
.btn-primary:hover { background: var(--n-brand-dk); box-shadow: 0 10px 24px rgba(13,107,85,.34); }

/* Gold = high-energy CTA (Join, Post request) */
.btn-gold {
  background: var(--n-gold); color: var(--n-ink);
  box-shadow: 0 6px 18px rgba(212,168,50,.32);
}
.btn-gold:hover { background: var(--n-gold-dk); color: #fff; box-shadow: 0 10px 26px rgba(176,138,31,.4); }

.btn-outline {
  background: transparent; color: var(--n-ink);
  border-color: var(--n-line);
}
.btn-outline:hover { background: var(--n-surface); border-color: var(--n-ink); }

.btn-outline-light {
  background: rgba(255,255,255,.08); color: #fff;
  border: 1.5px solid rgba(255,255,255,.35); backdrop-filter: blur(6px);
}
.btn-outline-light:hover { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.55); }

.btn-soft { background: var(--n-brand-lt); color: var(--n-brand-dk); }
.btn-soft:hover { background: #d6e7e0; }

.btn-sm { padding: 9px 14px; font-size: 13px; }
.btn-lg { padding: 16px 28px; font-size: 15.5px; }

/* ── 4. Navigation ──────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(251,248,243,.86);
  border-bottom: 1px solid var(--n-line);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  height: 72px;
}
.nav-inner { height: 100%; display: flex; align-items: center; gap: 18px; }
.nav-logo svg { height: 40px; width: auto; }
.nav-links { display: flex; align-items: center; gap: 2px; flex: 1; margin-left: 22px; }
.nav-links a {
  font-weight: 600; font-size: 14.5px; padding: 9px 14px;
  border-radius: var(--n-pill); color: var(--n-ink-2);
  transition: color .15s, background .15s;
}
.nav-links a:hover { color: var(--n-ink); background: rgba(11,37,64,.05); }
.nav-links a.active {
  color: var(--n-brand-dk);
  background: var(--n-brand-lt);
}
.nav-actions { display: flex; align-items: center; gap: 8px; }
.nav-actions .btn { padding: 10px 18px; font-size: 14px; }

/* ── 5. Hero (homepage) ─────────────────────────────────────── */
.hero {
  background:
    radial-gradient(1100px 600px at 85% -10%, rgba(212,168,50,.18), transparent 60%),
    radial-gradient(800px 500px at 0% 110%, rgba(46,165,121,.18), transparent 60%),
    linear-gradient(160deg, #0b2540 0%, #0d3a5c 50%, #0a5040 100%);
  color: #fff;
  padding: 56px 0 72px !important;
  min-height: auto !important;
  overflow: hidden; position: relative;
}
.hero-bg { opacity: .9; }
.hero-inner {
  grid-template-columns: 1.05fr .95fr !important;
  gap: 56px !important;
  align-items: center !important;
  min-height: auto !important;
}
.hero-kicker {
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.18);
  font-weight: 600; letter-spacing: .01em;
  padding: 7px 14px;
}
.kicker-dot { background: var(--n-mint); }
.hero h1 {
  font-size: clamp(36px, 4.4vw, 60px) !important;
  font-weight: 800 !important;
  letter-spacing: -0.035em !important;
  line-height: 1.02 !important;
}
.hero h1 .gold { color: var(--n-gold) !important; }
.hero p {
  font-size: 17.5px; color: rgba(255,255,255,.78);
  max-width: 520px; line-height: 1.55;
}

/* Hero search bar — make it the centerpiece */
.hero-search {
  background: #fff !important;
  border-radius: var(--n-radius-lg) !important;
  padding: 10px !important;
  box-shadow: 0 20px 60px rgba(3,22,48,.4) !important;
  display: flex !important; align-items: center; gap: 6px !important;
  border: 1px solid rgba(255,255,255,.6);
}
.hero-search .hs-field {
  padding: 10px 14px !important;
  background: transparent !important;
  border-right: 1px solid var(--n-line-2);
}
.hero-search .hs-field:last-of-type { border-right: none; }
.hero-search input, .hero-search select {
  background: transparent; border: none; outline: none;
  font-size: 14.5px; color: var(--n-ink); font-weight: 600;
  width: 100%;
}
.hero-search input::placeholder { color: var(--n-muted); font-weight: 500; }
.hs-submit {
  border-radius: var(--n-pill) !important;
  padding: 13px 22px !important;
  background: var(--n-brand) !important; color: #fff !important;
  box-shadow: 0 6px 16px rgba(13,107,85,.34) !important;
}
.hs-submit:hover { background: var(--n-brand-dk) !important; }

/* Trust row under hero */
.trust-row {
  display: flex; flex-wrap: wrap; gap: 18px 24px;
  margin-top: 8px;
}
.trust-item {
  display: flex; align-items: center; gap: 10px;
  color: rgba(255,255,255,.85); font-size: 13.5px; font-weight: 600;
}
.trust-icon {
  width: 32px; height: 32px; border-radius: 10px;
  background: rgba(255,255,255,.1); display: grid; place-items: center;
  border: 1px solid rgba(255,255,255,.18);
}

/* Hero category tiles — softer, more tactile */
.hcat-icon-wrap {
  width: 56px !important; height: 56px !important;
  border-radius: 16px !important;
  box-shadow: 0 8px 18px rgba(0,0,0,.18) !important;
}
.hcat { gap: 7px !important; }
.hcat span { font-size: 11px !important; font-weight: 700 !important; letter-spacing: .005em; }

/* ── 6. Sections, cards & surfaces ─────────────────────────── */
section, .section { padding: 56px 0; }
.section-head { text-align: center; max-width: 680px; margin: 0 auto 36px; }
.section-head h2 { font-size: clamp(28px, 3vw, 40px); margin-bottom: 12px; }
.section-head p { font-size: 16.5px; color: var(--n-muted); }

.card, .provider-card, .pcard, .featured-card, .group-card, .request-card, .plan-card {
  background: var(--n-surface);
  border: 1px solid var(--n-line);
  border-radius: var(--n-radius-lg);
  box-shadow: var(--n-shadow-1);
  transition: transform .2s ease, box-shadow .25s ease, border-color .2s ease;
  overflow: hidden;
}
.card:hover, .provider-card:hover, .pcard:hover, .featured-card:hover, .group-card:hover, .request-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--n-shadow-2);
  border-color: #e3d6bd;
}

/* Generic input / textarea / select */
input[type="text"], input[type="email"], input[type="password"],
input[type="search"], input[type="tel"], input[type="url"],
input[type="number"], textarea, select {
  background: var(--n-surface);
  border: 1.5px solid var(--n-line);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 15px;
  color: var(--n-ink);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--n-brand);
  box-shadow: 0 0 0 4px rgba(13,107,85,.14);
}

/* Badges & pills */
.badge, .chip, .tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: var(--n-pill);
  font-size: 12.5px; font-weight: 700;
  background: var(--n-brand-lt); color: var(--n-brand-dk);
}
.badge-gold { background: #fbeec1; color: #6e5410; }
.badge-coral { background: #fde2d3; color: #8a3f17; }

/* ── 7. Footer ──────────────────────────────────────────────── */
.footer {
  background: var(--n-ink) !important;
  color: rgba(255,255,255,.78) !important;
  padding: 64px 0 0 !important;
  margin-top: 80px;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1.2fr 2.4fr;
  gap: 56px;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.footer-brand p { color: rgba(255,255,255,.65); font-size: 14.5px; margin-top: 12px; max-width: 280px; }
.footer-links {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px;
}
.footer-links > div { display: flex; flex-direction: column; gap: 10px; }
.footer-links strong {
  color: #fff; font-size: 13px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
  margin-bottom: 6px;
}
.footer-links a {
  color: rgba(255,255,255,.7); font-size: 14.5px; font-weight: 500;
  transition: color .15s;
}
.footer-links a:hover { color: var(--n-gold); }
.footer-bottom {
  padding: 22px 0;
}
.footer-bottom .container {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; color: rgba(255,255,255,.5);
}

/* ── 8. Mobile bottom nav ──────────────────────────────────── */
.mobile-nav {
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--n-line);
  box-shadow: 0 -6px 24px rgba(11,37,64,.08);
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
}
.mobile-nav .mn-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; padding: 6px 4px; border-radius: 12px;
  color: var(--n-muted); flex: 1;
  transition: color .15s, background .15s;
}
.mobile-nav .mn-item b { font-size: 10.5px; font-weight: 700; letter-spacing: .01em; }
.mobile-nav .mn-item .mn-ico {
  width: 22px; height: 22px; display: grid; place-items: center;
}
.mobile-nav .mn-item .mn-ico svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mobile-nav .mn-item.active { color: var(--n-brand-dk); }
.mobile-nav .mn-item.active .mn-ico { background: var(--n-brand-lt); border-radius: 10px; }
.mobile-nav .mn-item > span:not(.mn-ico) { display: none; } /* hide emoji */

/* ── 9. Dashboards (provider, customer, owner) ─────────────── */
.dash, .dashboard, .page-dashboard, .page-provider-dashboard,
.page-customer-dashboard, .page-owner, .page-admin-dashboard {
  background: var(--n-bg);
}
.dash-grid, .stats-grid, .metrics-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.stat-card, .metric-card, .kpi-card {
  background: var(--n-surface);
  border: 1px solid var(--n-line);
  border-radius: var(--n-radius);
  padding: 20px;
  box-shadow: var(--n-shadow-1);
}
.stat-card .label, .metric-card .label { color: var(--n-muted); font-size: 13px; font-weight: 600; }
.stat-card .value, .metric-card .value { font-size: 28px; font-weight: 800; color: var(--n-ink); margin-top: 6px; }

/* Tables — readable, not admin-grey */
table { border-collapse: separate; border-spacing: 0; width: 100%; background: var(--n-surface); border-radius: var(--n-radius); overflow: hidden; box-shadow: var(--n-shadow-1); border: 1px solid var(--n-line); }
th { text-align: left; padding: 14px 16px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--n-muted); background: var(--n-surface-2); border-bottom: 1px solid var(--n-line); }
td { padding: 14px 16px; font-size: 14.5px; color: var(--n-ink); border-bottom: 1px solid var(--n-line-2); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(13,107,85,.03); }

/* ── 10. Provider profile / category page polish ───────────── */
.page-provider, .page-category, .page-directory { background: var(--n-bg); }
.provider-hero, .category-hero {
  background: linear-gradient(160deg, #0b2540, #0d3a5c);
  color: #fff; padding: 48px 0; border-radius: 0;
}

/* ── 11. Empty states ──────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 56px 24px;
  background: var(--n-surface); border: 1px dashed var(--n-line);
  border-radius: var(--n-radius-lg);
}
.empty-state h3 { font-size: 20px; margin-bottom: 8px; }
.empty-state p { color: var(--n-muted); max-width: 380px; margin: 0 auto 18px; }

/* ── 12. Forms (request, contact, join, login) ─────────────── */
.form-card, .auth-card {
  background: var(--n-surface);
  border: 1px solid var(--n-line);
  border-radius: var(--n-radius-lg);
  box-shadow: var(--n-shadow-2);
  padding: 36px;
  max-width: 520px; margin: 48px auto;
}
.form-card h1, .auth-card h1 { font-size: 28px; margin-bottom: 8px; }
.form-card label, .auth-card label {
  display: block; font-size: 13.5px; font-weight: 700;
  color: var(--n-ink-2); margin-bottom: 6px; margin-top: 14px;
}
.form-card .btn, .auth-card .btn { width: 100%; margin-top: 18px; }

/* ── 13. Pricing page ──────────────────────────────────────── */
.plan-card {
  padding: 32px 28px; display: flex; flex-direction: column; gap: 14px;
}
.plan-card.featured {
  border: 2px solid var(--n-brand);
  box-shadow: 0 20px 50px rgba(13,107,85,.18);
  transform: translateY(-6px);
}
.plan-card .price { font-size: 40px; font-weight: 800; color: var(--n-ink); letter-spacing: -0.03em; }
.plan-card .price small { font-size: 14px; font-weight: 600; color: var(--n-muted); }

/* ── 14. Community / noticeboard ───────────────────────────── */
.page-community, .page-noticeboard { background: var(--n-bg); }
.group-card { padding: 22px; display: flex; flex-direction: column; gap: 10px; }
.group-card h3 { font-size: 18px; }
.group-card .meta { font-size: 13px; color: var(--n-muted); }

/* ── 15. Utility classes used across pages ─────────────────── */
.text-muted { color: var(--n-muted) !important; }
.text-brand { color: var(--n-brand-dk) !important; }
.text-gold  { color: var(--n-gold-dk) !important; }
.bg-warm    { background: var(--n-surface-2) !important; }
.surface    { background: var(--n-surface); border: 1px solid var(--n-line); border-radius: var(--n-radius); padding: 20px; }

/* ── 16. Responsive refinements ────────────────────────────── */
@media (max-width: 960px) {
  .hero-inner { grid-template-columns: 1fr !important; gap: 32px !important; }
  .footer-inner { grid-template-columns: 1fr; gap: 36px; }
  .footer-links { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .nav { height: 64px; }
  .nav-links { display: none; }
  .nav-actions .btn-outline { display: none; }
  .hero { padding: 40px 0 56px !important; }
  .hero h1 { font-size: clamp(30px, 7vw, 42px) !important; }
  .hero-search {
    flex-direction: column !important; align-items: stretch !important;
    padding: 12px !important; gap: 8px !important;
  }
  .hero-search .hs-field { border-right: none !important; border-bottom: 1px solid var(--n-line-2); padding: 12px 14px !important; }
  .hero-search .hs-field:last-of-type { border-bottom: none; }
  .hs-submit { width: 100%; }
  section, .section { padding: 40px 0; }
  .form-card, .auth-card { padding: 24px; margin: 24px auto; border-radius: var(--n-radius); }
  .footer { padding: 48px 0 0 !important; }
  .footer-bottom .container { flex-direction: column; gap: 8px; text-align: center; }
  /* leave room for bottom mobile nav */
  body { padding-bottom: 72px; }
}
@media (max-width: 480px) {
  .footer-links { grid-template-columns: 1fr; }
}

/* ── 17. Motion (subtle, mobile-respectful) ────────────────── */
@media (prefers-reduced-motion: no-preference) {
  .card, .provider-card, .pcard, .featured-card, .group-card, .request-card,
  .stat-card, .plan-card {
    animation: nFadeUp .5s ease both;
  }
  @keyframes nFadeUp {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
  }
}

/* ── 18. Scrollbar polish (desktop) ────────────────────────── */
@media (hover: hover) {
  ::-webkit-scrollbar { width: 10px; height: 10px; }
  ::-webkit-scrollbar-thumb { background: #d9d1bf; border-radius: 999px; border: 2px solid var(--n-bg); }
  ::-webkit-scrollbar-thumb:hover { background: #b8ad94; }
}
