/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
    --navy:        #1a1060;
    --purple:      #7c6fdb;
    --purple-btn:  #9083e8;
    --purple-light:#e8e4fb;
    --purple-xlight:#f3f0fc;
    --bg:          #ede9f8;
    --muted:       #8888aa;
    --text:        #1a1060;
    --text-mid:    #4a4570;
    --white:       #ffffff;
    --badge-bg:    #ffd6c4;
    --badge-text:  #c45000;
    --success:     #16a085;
    --success-bg:  #d4f0ea;
    --danger:      #c0392b;
    --danger-bg:   #fde8e6;
    --border:      #e0d8f8;
    --radius:      22px;
    --radius-sm:   14px;
    --shadow:      0 8px 40px rgba(80,60,180,0.13);
    --shadow-lg:   0 20px 60px rgba(80,60,180,0.22);
}

/* ── Body & Background ── */
html, body { min-height: 100%; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    font-size: 15px;
    position: relative;
}

/* ── Decorative blobs via pseudo-elements on body ── */
body::before {
    content: '';
    position: fixed;
    width: 480px; height: 480px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,185,155,0.60) 0%, transparent 68%);
    top: 22%; left: -160px;
    pointer-events: none; z-index: 0;
}
body::after {
    content: '';
    position: fixed;
    width: 540px; height: 540px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(205,190,250,0.58) 0%, transparent 68%);
    top: -130px; right: -170px;
    pointer-events: none; z-index: 0;
}
/* Teal blob – via site-header sibling */
.site-header ~ * + *::before {
    display: none; /* reset */
}

/* ── Header ── */
.site-header {
    position: relative; z-index: 10;
    background: rgba(255,255,255,0.78);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(180,165,240,0.25);
    padding: 0 28px;
}
.header-inner {
    max-width: 1100px; margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between;
    height: 66px;
}
.logo {
    color: var(--navy); font-weight: 800;
    font-size: 1.2rem; text-decoration: none;
    display: flex; align-items: center; gap: 10px;
}
.logo-icon {
    width: 36px; height: 36px;
    background: var(--navy); border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem; color: #fff; flex-shrink: 0;
}
.header-nav a {
    color: var(--purple); text-decoration: none;
    font-weight: 600; font-size: .88rem;
    padding: 7px 18px; border-radius: 99px;
    border: 1.5px solid var(--purple);
    transition: all .2s;
}
.header-nav a:hover { background: var(--purple); color: #fff; }

/* ── Layout ── */
.container        { max-width: 1100px; margin: 0 auto; padding: 36px 24px; position: relative; z-index: 1; }
.container-narrow { max-width: 660px;  margin: 0 auto; padding: 32px 24px; position: relative; z-index: 1; }

/* ── White card ── */
.card {
    background: rgba(255,255,255,0.97);
    border-radius: var(--radius);
    padding: 30px 34px;
    box-shadow: var(--shadow);
    margin-bottom: 22px;
    position: relative;
}
.card h2 { font-size: 1.1rem; font-weight: 700; margin-bottom: 16px; color: var(--navy); }

/* ── Badge ── */
.badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 5px 14px; border-radius: 99px;
    font-size: .79rem; font-weight: 700; margin-bottom: 14px;
}
.badge.active    { background: var(--badge-bg); color: var(--badge-text); }
.badge.completed { background: var(--success-bg); color: var(--success); }

/* ── Product page ── */
.product-title {
    font-size: 1.8rem; font-weight: 800; color: var(--navy);
    letter-spacing: -.6px; line-height: 1.25; margin-bottom: 10px;
}
.product-description { color: var(--text-mid); line-height: 1.75; margin-bottom: 4px; }

.product-hero-img {
    width: 100%; max-height: 400px; object-fit: cover;
    border-radius: 16px; margin: 18px 0; display: block;
}
.product-img-placeholder {
    width: 100%; aspect-ratio: 4/3; max-height: 400px;
    border-radius: 16px; margin: 18px 0;
    background: repeating-linear-gradient(
        -45deg,
        var(--purple-light) 0px, var(--purple-light) 16px,
        rgba(255,255,255,.5) 16px, rgba(255,255,255,.5) 32px
    );
    display: flex; align-items: center; justify-content: center;
    color: var(--purple); font-size: .85rem; text-align: center;
}

/* ── Progress block ── */
.progress-section { margin: 18px 0 22px; }
.progress-header  { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.progress-label   { font-weight: 700; font-size: .95rem; color: var(--navy); }
.progress-pct     { font-weight: 700; font-size: .95rem; color: var(--purple); }

.progress-wrap { background: var(--purple-light); border-radius: 99px; height: 8px; overflow: hidden; }
.progress-fill {
    height: 100%; border-radius: 99px;
    background: linear-gradient(90deg, var(--purple), #a89af5);
    transition: width .7s ease; min-width: 12px;
}
.progress-fill.done { background: linear-gradient(90deg, var(--success), #1abc9c); }

.progress-amount { margin-top: 14px; }
.progress-amount .collected { font-size: 1.65rem; font-weight: 800; color: var(--navy); }
.progress-amount .label-sm  { font-size: .9rem; color: var(--muted); margin-left: 6px; }
.progress-amount .goal-line { margin-top: 4px; font-size: .88rem; color: var(--muted); }

/* ── Forms ── */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 7px; color: var(--navy); }
.form-group input,
.form-group textarea,
.form-group select {
    width: 100%; padding: 12px 16px;
    border: 1.5px solid var(--border); border-radius: var(--radius-sm);
    font-size: .95rem; background: #fff; color: var(--text);
    transition: border-color .2s, box-shadow .2s;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none; border-color: var(--purple);
    box-shadow: 0 0 0 4px rgba(124,111,219,0.12);
}
.form-group .hint { font-size: .8rem; color: var(--muted); margin-top: 5px; }
.amount-input-wrap { position: relative; }
.amount-input-wrap .currency {
    position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
    color: var(--muted); font-weight: 600;
}
.amount-input-wrap input { padding-left: 32px; }

/* ── Buttons ── */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 12px 22px; border-radius: var(--radius-sm);
    font-size: .95rem; font-weight: 600;
    cursor: pointer; text-decoration: none; border: none; transition: all .2s;
}
.btn-primary  { background: var(--purple); color: #fff; box-shadow: 0 4px 14px rgba(124,111,219,.35); }
.btn-primary:hover { background: #6a5dcc; }
.btn-stripe {
    background: var(--purple-btn); color: #fff;
    width: 100%; justify-content: center;
    font-size: 1rem; padding: 16px; border-radius: 14px;
    box-shadow: 0 5px 18px rgba(124,111,219,.38); margin-top: 6px;
    letter-spacing: .01em;
}
.btn-stripe:hover { background: var(--purple); }
.btn-danger  { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #a93226; }
.btn-ghost   { background: var(--purple-xlight); color: var(--purple); border: 1.5px solid var(--border); }
.btn-ghost:hover { background: var(--purple-light); }
.btn-sm { padding: 6px 14px; font-size: .82rem; }

/* ── Stripe note ── */
.stripe-info { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 12px; font-size: .8rem; color: var(--muted); }

/* ── Alerts ── */
.alert {
    padding: 13px 16px; border-radius: var(--radius-sm);
    font-size: .9rem; margin-bottom: 16px;
    display: flex; align-items: flex-start; gap: 10px;
}
.alert.success { background: var(--success-bg); color: #0e7a62; border: 1px solid #a8e6d8; }
.alert.error   { background: var(--danger-bg);  color: #a93226; border: 1px solid #f5b7b1; }
.alert.info    { background: var(--purple-light); color: #4a3d99; border: 1px solid #c8bef5; }

/* ── Breadcrumb ── */
.breadcrumb { font-size: .85rem; color: var(--muted); margin-bottom: 20px; }
.breadcrumb a { color: var(--purple); text-decoration: none; font-weight: 500; }

/* ── Contributor list ── */
.contrib-list { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.contrib-item {
    display: flex; align-items: center; gap: 14px;
    padding: 12px 16px; background: var(--purple-xlight); border-radius: var(--radius-sm);
}
.contrib-avatar {
    width: 40px; height: 40px; border-radius: 50%;
    background: linear-gradient(135deg, var(--purple), #a89af5);
    color: #fff; font-weight: 700; font-size: 1rem;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.contrib-name   { font-weight: 600; font-size: .9rem; color: var(--navy); }
.contrib-date   { font-size: .78rem; color: var(--muted); }
.contrib-amount { margin-left: auto; font-weight: 800; color: var(--purple); font-size: .95rem; }

/* ── Index: hero + grid ── */
.hero-text { margin-bottom: 26px; }
.hero-text h1 { font-size: 1.9rem; font-weight: 800; color: var(--navy); letter-spacing: -.5px; margin-bottom: 6px; }
.hero-text p  { color: var(--text-mid); }

.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(285px, 1fr)); gap: 22px; }
.product-card {
    background: rgba(255,255,255,0.97); border-radius: var(--radius); overflow: hidden;
    box-shadow: var(--shadow); text-decoration: none; color: inherit;
    display: flex; flex-direction: column; transition: transform .25s, box-shadow .25s;
}
.product-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.product-card__img {
    width: 100%; height: 180px; object-fit: cover; display: block;
    background: repeating-linear-gradient(-45deg,
        var(--purple-light) 0px, var(--purple-light) 16px,
        rgba(255,255,255,.5) 16px, rgba(255,255,255,.5) 32px);
}
.product-card__body  { padding: 20px; flex: 1; display: flex; flex-direction: column; gap: 10px; }
.product-card__name  { font-weight: 700; font-size: 1rem; color: var(--navy); }
.product-card__meta  { color: var(--muted); font-size: .84rem; }
.product-card__progress { margin-top: auto; }
.progress-stats { display: flex; justify-content: space-between; font-size: .82rem; color: var(--muted); margin-top: 6px; }

/* ── Admin ── */
.admin-topbar {
    background: var(--navy); padding: 13px 28px;
    display: flex; align-items: center; gap: 22px; flex-wrap: wrap; position: relative; z-index: 10;
}
.admin-topbar .admin-logo { color: #fff; font-weight: 800; margin-right: auto; }
.admin-topbar a { color: rgba(255,255,255,.7); text-decoration: none; font-size: .9rem; font-weight: 500; }
.admin-topbar a:hover { color: #fff; }

.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th { text-align: left; padding: 10px 14px; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); border-bottom: 2px solid var(--border); }
.admin-table td { padding: 13px 14px; border-bottom: 1px solid var(--border); font-size: .9rem; vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--purple-xlight); }

/* ── Empty / Result ── */
.empty-state  { text-align: center; padding: 60px 24px; color: var(--muted); }
.empty-state .icon { font-size: 3rem; margin-bottom: 12px; }
.empty-state h3 { color: var(--text-mid); font-size: 1.1rem; margin-bottom: 6px; }
.result-page  { text-align: center; padding: 60px 24px; }
.result-page .icon { font-size: 4rem; margin-bottom: 18px; }
.result-page h1 { font-size: 1.8rem; font-weight: 800; color: var(--navy); margin-bottom: 10px; }
.result-page p  { color: var(--text-mid); margin-bottom: 24px; }

/* ── Footer ── */
.site-footer {
    text-align: center; padding: 26px 24px;
    color: var(--muted); font-size: .84rem;
    position: relative; z-index: 1;
}
.site-footer strong { color: var(--navy); }

/* ── Responsive ── */
@media (max-width: 640px) {
    .product-grid { grid-template-columns: 1fr; }
    .card { padding: 20px 18px; }
    .product-title { font-size: 1.5rem; }
}
