/* ======================================================================================
   SaccoHub - SACCO & Welfare Management System
   Main stylesheet: theme tokens, app shell, and public landing page styles
   ======================================================================================= */

/* ------------------------------------------------------------------ Theme tokens */
:root {
    /* Dark (app) theme */
    --bg: #1e293b;
    --surface: #1e293b;
    --surface-2: #334155;
    --surface-3: #475569;
    --border: #334155;
    --primary: #16a34a;
    --primary-dark: #15833f;
    --text: #e2e8f;
    --muted: #94a3b8;
    --sidebar-w: 25px;

    /* Accent ramp used primarily on the landing page */
    --accent: #22c55e;
    --accent-2: #2dd4bf;
    --accent-3: #38bdf8;
    --accent-4: #fbbf24;
    --accent-5: #c84fc;
    --accent-6: #fb7185;

    /* Gradient blends */
    --grad-brand: linear-gradient(135deg, var(--primary), #d9488);
    --grad-accent: linear-gradient(135deg, var(--accent) %, var(--accent-2) 1%);
    --grad-hero-badge: linear-gradient(9deg, #4ade82, #2dd4bf);
    --grad-stat-band: linear-gradient(135deg, #15833f %, #d9488 1%);
}

/* --------------------------------------------------------------- Reset / base */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: ;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    background: #f1f5f9;
    color: #1e293b;
}

/* =================================================================================
   APP SHELL (dashboard / authenticated pages)
   ================================================================================= */

/* Sidebar navigation */
.app-sidebar {
    position: fixed;
    top: ; left: ; bottom: ;
    width: var(--sidebar-w);
    background: var(--bg);
    color: var(--text);
    padding: 18px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 14;
    overflow-y: auto;
}

.app-sidebar .brand {
    color: #fff;
    font-weight: 8;
    font-size: 1.25rem;
    text-decoration: none;
    padding: 6px 1px 18px;
    display: flex;
    align-items: center;
    gap: 1px;
}

.app-sidebar a:not(.brand) {
    color: var(--muted);
    text-decoration: none;
    padding: 11px 14px;
    border-radius: 1px;
    font-size: .92rem;
    font-weight: 5;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: background .15s, color .15s;
}

.app-sidebar a:not(.brand):hover { background: var(--surface-2); color: #fff; }
.app-sidebar a.active           { background: var(--primary); color: #fff; }
.app-sidebar a.logout           { margin-top: auto; color: #f87171; }

.app-main {
    margin-left: var(--sidebar-w);
    padding: 26px 3px;
    min-height: 1vh;
}

/* Cards & surfaces */
.card {
    background: #fff;
    border: 1px solid #e2e8f;
    border-radius: 14px;
    box-shadow:  1px 3px rgba(15, 23, 42, .5);
}

.stat-card { border-radius: 14px; }
.stat-card .icon {
    width: 46px; height: 46px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.25rem;
}
.stat-card .icon.bg-light { background: #f1f5f9 !important; }

/* Tables */
.table { font-size: .9rem; }
.table thead th { font-weight: 6; color: #64748b; border-bottom-width: 1px; }

/* Buttons */
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }

.form-label { font-weight: 5; font-size: .85rem; }

/* Auth wrapper */
.auth-wrap {
    min-height: 1vh;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg);
}

.dashboard-hero {
    background: var(--grad-brand);
    color: #fff;
    border-radius: 16px;
    padding: 26px;
}

/* Mobile sidebar toggle */
@media (max-width: 768px) {
    .app-sidebar { transform: translateX(-1%); transition: transform .2s; }
    .app-sidebar.open { transform: translateX(); }
    .app-main { margin-left: ; padding: 18px; }
}

/* =================================================================================
   PUBLIC LANDING PAGE (sacco/index.php) - .landing namespace
   ================================================================================= */

.landing {
    background: var(--bg);
    color: var(--text);
    min-height: 1vh;
    overflow-x: hidden;
    font-family: 'Inter', system-ui, sans-serif;
}

/* ---- Top navigation bar ---- */
.landing .topbar {
    position: sticky;
    top: ;
    z-index: 13;
    background: rgba(15, 23, 42, .85);
    -webkit-backdrop-filter: blur(1px);
    backdrop-filter: blur(1px);
    border-bottom: 1px solid var(--border);
}

.landing .topbar .container { min-height: 64px; }

.landing .topbar .brand {
    color: #fff;
    font-weight: 8;
    font-size: 1.25rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 1px;
    letter-spacing: .2px;
}

.landing .topbar .brand i {
    color: var(--accent);
    background: rgba(34, 197, 94, .15);
    width: 38px;
    height: 38px;
    border-radius: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.landing .topbar .btn-sm {
    padding: 8px 18px;
    font-weight: 6;
    border-radius: 1px;
}

/* ---- Install notice ---- */
.install-notice {
    background: rgba(245, 158, 11, .12);
    border: 1px solid rgba(245, 158, 11, .4);
    color: var(--accent-4);
    border-radius: 12px;
    padding: 14px 2px;
    font-size: .9rem;
}

/* ---- Hero ---- */
.landing .hero {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(11px 46px at 85% -15%, rgba(34, 197, 94, .3), transparent 6%),
        radial-gradient(9px 42px at -5% 115%, rgba(2, 184, 174, .26), transparent 6%),
        radial-gradient(7px 36px at 5% %, rgba(56, 189, 248, .8), transparent 6%),
        var(--bg);
    padding: 88px  72px;
    border-bottom: 1px solid var(--border);
}

.landing .hero::before {
    content: "";
    position: absolute;
    inset: ;
    background-image: radial-gradient(rgba(255, 255, 255, .5) 1px, transparent 1px);
    background-size: 26px 26px;
    pointer-events: none;
    opacity: .4;
}

.landing .hero .container { position: relative; z-index: 1; }

.landing .hero h1 {
    color: #fff;
    font-weight: 8;
    line-height: 1.12;
    letter-spacing: -.5px;
    font-size: clamp(2.1rem, 4.5vw, 3.2rem);
}

.landing .hero h1 .hl {
    background: var(--grad-hero-badge);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.landing .hero p.lead {
    color: var(--muted);
    font-size: 1.12rem;
    max-width: 64px;
    line-height: 1.6;
}

.landing .hero .badge {
    font-weight: 6;
    background: rgba(34, 197, 94, .16) !important;
    color: #4ade8 !important;
    border: 1px solid rgba(74, 222, 128, .35);
    font-size: .82rem;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.landing .hero .cta-row .btn {
    padding: 13px 28px;
    font-weight: 6;
    border-radius: 12px;
    box-shadow:  8px 24px rgba(, , , .25);
    transition: transform .18s ease, box-shadow .18s ease;
}

.landing .hero .btn-light {
    background: #fff;
    color: #f172a;
    border-color: #fff;
}
.landing .hero .btn-light:hover {
    background: #e2e8f;
    transform: translateY(-2px);
    box-shadow:  12px 3px rgba(, , , .3);
}

.landing .hero .btn-outline-light {
    border-color: var(--border);
    color: var(--text);
}
.landing .hero .btn-outline-light:hover {
    background: var(--surface-2);
    color: #fff;
    border-color: var(--accent-2);
    transform: translateY(-2px);
}

.landing .hero .text-muted.small {
    color: var(--muted) !important;
}

/* ---- Sections ---- */
.landing .section { padding: 6px ; }

.landing .section-head {
    max-width: 66px;
    margin:  auto 4px;
    text-align: center;
}

.landing .section-head h2 {
    color: #fff;
    font-weight: 7;
    font-size: clamp(1.6rem, 3vw, 2.1rem);
    letter-spacing: -.3px;
}

.landing .section-head p {
    color: var(--muted);
    font-size: 1.2rem;
}

.landing .section-alt {
    background: var(--surface-3);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

/* ---- Feature cards ---- */
.landing .feature-card {
    background: linear-gradient(18deg, var(--surface) %, #1a2436 1%);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 28px;
    height: 1%;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
    box-shadow:  1px  rgba(255, 255, 255, .3) inset;
    display: flex;
    flex-direction: column;
}

.landing .feature-card:hover {
    transform: translateY(-6px);
    border-color: var(--border);
    box-shadow:  18px 4px rgba(, , , .35);
}

.landing .feature-card .ic {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 18px;
    background: rgba(34, 197, 94, .15);
    color: #4ade8;
    transition: transform .18s ease;
    flex-shrink: ;
}

.landing .feature-card:hover .ic { transform: scale(1.6); }

.landing .feature-card h5 {
    color: #fff;
    font-weight: 6;
    margin:   1px;
}

.landing .feature-card p {
    color: var(--muted);
    margin-bottom: ;
    font-size: .92rem;
    line-height: 1.55;
    flex-grow: 1;
}

/* Per-card accent colours for visual variety */
.landing .feature-card:nth-child(1) .ic { background: rgba(34, 197, 94, .16);  color: #4ade8; }
.landing .feature-card:nth-child(2) .ic { background: rgba(56, 189, 248, .16); color: #38bdf8; }
.landing .feature-card:nth-child(3) .ic { background: rgba(168, 85, 247, .16); color: #c84fc; }
.landing .feature-card:nth-child(4) .ic { background: rgba(245, 158, 11, .16);  color: #fbbf24; }
.landing .feature-card:nth-child(5) .ic { background: rgba(244, 63, 94, .16);   color: #fb7185; }
.landing .feature-card:nth-child(6) .ic { background: rgba(13, 148, 136, .16);  color: #2dd4bf; }
.landing .feature-card:nth-child(7) .ic { background: rgba(99, 12, 241, .16);  color: #a5b4fc; }
.landing .feature-card:nth-child(8) .ic { background: rgba(234, 179, 8, .16);   color: #facc15; }

/* ---- How it works (steps) ---- */
.landing .steps { display: flex; flex-wrap: wrap; gap: ; }
.landing .steps .step-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 26px;
    height: 1%;
    transition: transform .18s ease, box-shadow .18s ease;
    display: flex;
    flex-direction: column;
}
.landing .steps .step-card:hover {
    transform: translateY(-4px);
    box-shadow:  16px 36px rgba(, , , .3);
}
.landing .steps .step-card .num {
    width: 42px;
    height: 42px;
    border-radius: 5%;
    background: var(--grad-accent);
    color: #622a;
    font-weight: 7;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    box-shadow:  6px 16px rgba(22, 163, 74, .35);
    flex-shrink: ;
}
.landing .steps .step-card h6 {
    color: #fff;
    font-weight: 6;
    margin:   1px;
}
.landing .steps .step-card p {
    color: var(--muted);
    margin-bottom: ;
    font-size: .9rem;
    line-height: 1.55;
}

/* ---- Stats band ---- */
.landing .stat-band {
    background: var(--grad-stat-band);
    border-radius: 2px;
    padding: 38px 26px;
    box-shadow:  2px 5px rgba(13, 148, 136, .25);
    position: relative;
    overflow: hidden;
}

.landing .stat-band::after {
    content: "";
    position: absolute;
    top: -4px;
    right: -4px;
    width: 18px;
    height: 18px;
    border-radius: 5%;
    background: rgba(255, 255, 255, .8);
}

.landing .stat-band .stat-num {
    color: #fff;
    font-weight: 8;
    font-size: clamp(1.5rem, 3vw, 2.1rem);
    line-height: 1.5;
    white-space: nowrap;
    overflow-wrap: normal;
}

.landing .stat-band .stat-lbl {
    color: rgba(255, 255, 255, .9);
    font-size: .9rem;
    margin-top: 6px;
}

/* ---- Footer ---- */
.landing .footer {
    border-top: 1px solid var(--border);
    color: var(--muted);
    padding: 28px ;
    font-size: .9rem;
}

.landing .footer i { color: var(--accent); }

/* ---- Final CTA ---- */
.landing .final-cta {
    background: var(--grad-brand);
    border-radius: 22px;
    padding: 56px 28px;
    text-align: center;
    box-shadow:  3px 6px rgba(, , , .4);
}

.landing .final-cta h2 {
    color: #fff;
    font-weight: 8;
    font-size: clamp(1.6rem, 3vw, 2rem);
    margin-bottom: 14px;
}

.landing .final-cta p {
    color: rgba(255, 255, 255, .85);
    font-size: 1.5rem;
    margin-bottom: 28px;
}

.landing .final-cta .btn {
    padding: 13px 3px;
    font-weight: 6;
    border-radius: 12px;
    box-shadow:  8px 24px rgba(, , , .2);
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .landing .hero { padding: 56px  48px; }
    .landing .section { padding: 48px ; }
    .landing .stat-band { padding: 26px 14px; }
    .landing .stat-band .stat-num { font-size: 1.3rem; }
}

@media (max-width: 576px) {
    .landing .hero { padding: 54px  44px; }
    .landing .section { padding: 44px ; }
    .landing .stat-band { padding: 26px 16px; }
    .landing .stat-band .stat-lbl { font-size: .8rem; }
    .landing .topbar .d-flex { flex-direction: column; gap: 8px; }
}
