/* ============================================================
   Universal Seva Sangha — visual identity
   Palette grows from the trust's own colours: banyan-leaf green,
   marigold/turmeric gold, and a deep saffron-red used for emphasis
   (echoing the org's own banners and cheque templates).
   ============================================================ */

:root {
    --uss-green-900: #1e4620;
    --uss-green-700: #2f6b30;
    --uss-green-500: #3f8f3f;
    --uss-gold-500: #d9a441;
    --uss-gold-300: #f0cf85;
    --uss-cream: #fbf6ea;
    --uss-red-600: #b8342b;
    --uss-ink: #223022;
    --uss-ink-soft: #4c5a4c;
    --uss-white: #ffffff;
    --uss-border: #e3dcc4;

    --font-display: 'Hind Siliguri', 'Baloo Da 2', 'Segoe UI', sans-serif;
    --font-body: 'Hind Siliguri', 'Noto Sans Bengali', 'Segoe UI', Arial, sans-serif;

    --radius-md: 10px;
    --radius-lg: 18px;
    --shadow-card: 0 10px 30px rgba(30, 70, 32, 0.10);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--uss-cream);
    color: var(--uss-ink);
    font-family: var(--font-body);
    scroll-behavior: smooth;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

.container {
    width: 100%;
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ---------------- Top bar ---------------- */
.topbar {
    background: var(--uss-green-900);
    color: var(--uss-gold-300);
    font-size: 13px;
    padding: 6px 0;
}
.topbar .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px; }
.topbar a { color: var(--uss-gold-300); }
.topbar a:hover { color: var(--uss-white); }

/* ---------------- Header / nav ---------------- */
.site-header {
    background: var(--uss-white);
    border-bottom: 3px solid var(--uss-gold-500);
    position: sticky;
    top: 0;
    z-index: 50;
}
.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    padding-bottom: 12px;
    gap: 16px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }
.brand-text .name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 20px;
    color: var(--uss-green-900);
    line-height: 1.1;
}
.brand-text .tag { font-size: 12px; color: var(--uss-ink-soft); }

.main-nav { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.main-nav a {
    font-weight: 600;
    font-size: 15px;
    color: var(--uss-ink);
    padding: 6px 2px;
    border-bottom: 2px solid transparent;
}
.main-nav a:hover { border-bottom-color: var(--uss-gold-500); }
.main-nav .btn { border: none; }
.lang-toggle {
    border: 1px solid var(--uss-green-700);
    color: var(--uss-green-700) !important;
    border-radius: 999px;
    padding: 6px 14px !important;
    font-size: 13px !important;
}

.nav-toggle { display: none; background: none; border: none; font-size: 26px; color: var(--uss-green-900); }

/* ---------------- Buttons ---------------- */
.btn {
    display: inline-block;
    padding: 12px 26px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    border: 2px solid transparent;
}
.btn-primary { background: var(--uss-red-600); color: var(--uss-white); }
.btn-primary:hover { background: #96261f; }
.btn-outline { background: transparent; border-color: var(--uss-white); color: var(--uss-white); }
.btn-outline:hover { background: var(--uss-white); color: var(--uss-green-900); }
.btn-gold { background: var(--uss-gold-500); color: var(--uss-green-900); }
.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-block { display: block; width: 100%; text-align: center; }
.btn-danger { background: var(--uss-red-600); color: #fff; }
.btn-ghost { background: transparent; border-color: var(--uss-border); color: var(--uss-ink); }

/* ---------------- Hero ---------------- */
.hero {
    position: relative;
    color: var(--uss-white);
    min-height: 420px;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    background: var(--uss-green-900);
}
.hero-slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1.2s ease;
}
.hero-slide.active { opacity: 1; }
.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(20,40,20,.15) 0%, rgba(15,30,15,.85) 100%);
}
.hero-content { position: relative; z-index: 2; padding: 60px 0 44px; }
.hero-eyebrow {
    text-transform: uppercase;
    letter-spacing: .12em;
    font-size: 12px;
    color: var(--uss-gold-300);
    font-weight: 700;
}
.hero h1 {
    font-family: var(--font-display);
    font-size: clamp(28px, 5vw, 48px);
    margin: 10px 0 12px;
    line-height: 1.15;
}
.hero p { font-size: 16px; max-width: 640px; opacity: .92; margin-bottom: 22px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

/* ---------------- Sections ---------------- */
section { padding: 56px 0; }
.section-title {
    font-family: var(--font-display);
    font-size: clamp(22px, 3.4vw, 32px);
    color: var(--uss-green-900);
    margin: 0 0 8px;
}
.section-sub { color: var(--uss-ink-soft); max-width: 680px; margin-bottom: 32px; }
.section-alt { background: var(--uss-white); }

/* ---------------- Level plan cards ---------------- */
.level-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 20px;
}
.level-card {
    background: var(--uss-white);
    border: 1px solid var(--uss-border);
    border-radius: var(--radius-lg);
    padding: 22px;
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
}
.level-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 6px;
    background: linear-gradient(90deg, var(--uss-green-700), var(--uss-gold-500));
}
.level-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px; height: 40px;
    border-radius: 50%;
    background: var(--uss-green-900);
    color: var(--uss-gold-300);
    font-weight: 700;
    margin-bottom: 12px;
}
.level-card h3 { margin: 0 0 4px; color: var(--uss-green-900); font-family: var(--font-display); }
.level-card .req { color: var(--uss-ink-soft); font-size: 14px; margin-bottom: 12px; }
.level-card .amount { font-size: 22px; font-weight: 800; color: var(--uss-red-600); }
.level-card .extra { font-size: 13px; color: var(--uss-ink-soft); margin-top: 10px; border-top: 1px dashed var(--uss-border); padding-top: 10px; }

/* ---------------- Cards generic ---------------- */
.card {
    background: var(--uss-white);
    border: 1px solid var(--uss-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 24px;
}

/* ---------------- Footer ---------------- */
.site-footer { background: var(--uss-green-900); color: #d9e7d9; padding: 40px 0 20px; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 24px; margin-bottom: 24px; }
.footer-grid h4 { color: var(--uss-gold-300); font-family: var(--font-display); margin-bottom: 10px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); padding-top: 16px; font-size: 13px; text-align: center; color: #b8ccb8; }

/* ---------------- Forms (shared by admin/user/login) ---------------- */
.auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, var(--uss-green-900), var(--uss-green-700));
    padding: 24px;
}
.auth-card {
    background: var(--uss-white);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
    width: 100%;
    max-width: 420px;
    padding: 34px;
}
.auth-card h1 { font-family: var(--font-display); color: var(--uss-green-900); font-size: 24px; text-align: center; margin-bottom: 4px; }
.auth-card .sub { text-align: center; color: var(--uss-ink-soft); margin-bottom: 24px; font-size: 14px; }

.form-group { margin-bottom: 16px; }
label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; color: var(--uss-ink); }
input[type=text], input[type=password], input[type=email], input[type=tel], input[type=number], input[type=date], select, textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--uss-border);
    border-radius: var(--radius-md);
    font-size: 15px;
    font-family: var(--font-body);
    background: var(--uss-cream);
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--uss-green-500);
    box-shadow: 0 0 0 3px rgba(63,143,63,.18);
}
.alert { padding: 12px 16px; border-radius: var(--radius-md); font-size: 14px; margin-bottom: 16px; }
.alert-error { background: #fbe6e4; color: var(--uss-red-600); border: 1px solid #f0bcb7; }
.alert-success { background: #e7f3e3; color: var(--uss-green-900); border: 1px solid #bfdcb6; }

/* ---------------- Admin / user shell layout ---------------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
    width: 240px;
    background: var(--uss-green-900);
    color: #dcefdc;
    flex-shrink: 0;
    padding: 20px 0;
}
.sidebar .brand-mini { display: flex; align-items: center; gap: 10px; padding: 0 20px 20px; border-bottom: 1px solid rgba(255,255,255,.12); margin-bottom: 12px; }
.sidebar .brand-mini img { width: 36px; height: 36px; border-radius: 50%; }
.sidebar .brand-mini span { font-family: var(--font-display); font-weight: 700; font-size: 15px; color: #fff; }
.sidebar nav a {
    display: block;
    padding: 11px 22px;
    font-size: 14px;
    font-weight: 600;
    color: #cfe4cf;
    border-left: 3px solid transparent;
}
.sidebar nav a:hover, .sidebar nav a.active { background: rgba(255,255,255,.08); border-left-color: var(--uss-gold-500); color: #fff; }
.content { flex: 1; padding: 26px; max-width: 1200px; }
.topbar-app { display:flex; justify-content: space-between; align-items:center; margin-bottom:22px; flex-wrap:wrap; gap:10px; }
.topbar-app h1 { font-family: var(--font-display); font-size: 22px; color: var(--uss-green-900); margin:0; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; margin-bottom: 26px; }
.stat-card { background: var(--uss-white); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow-card); border: 1px solid var(--uss-border); }
.stat-card .label { font-size: 13px; color: var(--uss-ink-soft); margin-bottom: 6px; }
.stat-card .value { font-size: 26px; font-weight: 800; color: var(--uss-green-900); }

table.data-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius-md); overflow: hidden; }
table.data-table th, table.data-table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--uss-border); font-size: 14px; }
table.data-table th { background: var(--uss-green-900); color: #fff; font-weight: 600; }
table.data-table tr:hover td { background: #f8f4e8; }
.table-wrap { overflow-x: auto; background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-card); border: 1px solid var(--uss-border); }

.progress-bar { background: var(--uss-border); border-radius: 999px; height: 12px; overflow: hidden; }
.progress-bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--uss-green-700), var(--uss-gold-500)); }

.badge { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge-success { background: #e2f3de; color: var(--uss-green-900); }
.badge-muted { background: #eee; color: #777; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 720px) { .grid-2 { grid-template-columns: 1fr; } }

/* camera capture widget */
.capture-box { text-align: center; }
.capture-box video, .capture-box canvas, .capture-box img.preview {
    width: 100%; max-width: 320px; border-radius: var(--radius-md); border: 2px solid var(--uss-border); background:#000;
}
.capture-actions { display:flex; gap:10px; justify-content:center; margin-top:10px; flex-wrap:wrap; }

.doc-preview { text-align: center; }
.doc-preview img { max-width: 100%; border: 1px solid var(--uss-border); border-radius: var(--radius-md); box-shadow: var(--shadow-card); }

/* native collapsible sections (member network / level view) */
details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: "▸"; display: inline-block; margin-right: 8px; transition: transform .15s; color: var(--uss-gold-500); }
details[open] > summary::before { transform: rotate(90deg); }

/* ---------------- Responsive ---------------- */
@media (max-width: 900px) {
    .app-shell { flex-direction: column; }
    .sidebar { width: 100%; padding-bottom: 0; }
    .sidebar nav { display: flex; overflow-x: auto; }
    .sidebar nav a { border-left: none; border-bottom: 3px solid transparent; white-space: nowrap; }
    .sidebar nav a.active, .sidebar nav a:hover { border-bottom-color: var(--uss-gold-500); }
    .sidebar .brand-mini { border-bottom: none; margin-bottom: 0; }
}
@media (max-width: 720px) {
    .main-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: #fff; flex-direction: column; align-items: flex-start; padding: 14px 20px; box-shadow: 0 12px 20px rgba(0,0,0,.08); }
    .main-nav.open { display: flex; }
    .nav-toggle { display: block; }
    .hero { min-height: 360px; }
}
