/* =============================================================================
   GiveAble — Responsive, accessible stylesheet
   Mobile-first. No external dependencies.
   ========================================================================== */

:root {
    --primary:       #0e7c66;
    --primary-dark:  #0a5e4e;
    --primary-soft:  #e4f2ee;
    --primary-softer:#f0f8f5;
    --accent:        #f59e0b;
    --accent-soft:   #fef3d9;
    --ink:           #1f2937;
    --muted:         #5b6472;
    --bg:            #f6f9f8;
    --surface:       #ffffff;
    --border:        #e4e9e7;
    --danger:        #dc2626;
    --danger-soft:   #fdecec;
    --success:       #15803d;
    --success-soft:  #e8f6ee;
    --info-soft:     #eaf2fd;
    --shadow-sm: 0 1px 2px rgba(15, 40, 34, .06);
    --shadow:    0 6px 24px rgba(15, 40, 34, .08);
    --radius:    14px;
    --radius-sm: 9px;
    --container: 1120px;
    --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--ink);
    background: var(--bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

img, svg { display: block; max-width: 100%; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5rem; color: var(--ink); }
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
h3 { font-size: 1.2rem; }
p  { margin: 0 0 1rem; }
a  { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: 1.25rem;
}

.site-main { flex: 1 0 auto; width: 100%; }

:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
    border-radius: 4px;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--primary-dark);
    color: #fff;
    padding: .6rem 1rem;
    z-index: 1000;
    border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    padding: .68rem 1.25rem;
    font-weight: 600;
    font-size: .95rem;
    font-family: inherit;
    line-height: 1.2;
    border: 2px solid transparent;
    border-radius: 999px;
    cursor: pointer;
    text-align: center;
    transition: background .15s ease, border-color .15s ease, color .15s ease, transform .05s ease;
    text-decoration: none !important;
}
.btn:active { transform: translateY(1px); }

.btn--primary { background: var(--primary); color: #fff; }
.btn--primary:hover { background: var(--primary-dark); color: #fff; }

.btn--accent { background: var(--accent); color: #3b2c00; }
.btn--accent:hover { background: #e08c00; color: #3b2c00; }

.btn--ghost { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn--ghost:hover { background: var(--primary-soft); color: var(--primary-dark); }

.btn--danger { background: var(--danger); color: #fff; }
.btn--danger:hover { background: #b91c1c; color: #fff; }

.btn--subtle { background: var(--primary-soft); color: var(--primary-dark); }
.btn--subtle:hover { background: #d4e9e3; color: var(--primary-dark); }

.btn--block { width: 100%; }
.btn--sm { padding: .45rem .9rem; font-size: .85rem; }

/* ---------- Forms ---------- */
.field { margin-bottom: 1.1rem; }
.field label { display: block; font-weight: 600; margin-bottom: .35rem; font-size: .92rem; }
.field .hint { font-size: .8rem; color: var(--muted); margin-top: .3rem; }
.field input,
.field select,
.field textarea {
    width: 100%;
    padding: .72rem .85rem;
    font: inherit;
    color: var(--ink);
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.field textarea { min-height: 130px; resize: vertical; }
.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}
.field .req { color: var(--danger); }

/* Segmented choice (register) */
.choice-grid { display: grid; grid-template-columns: 1fr; gap: .75rem; }
.choice-card {
    position: relative;
    display: block;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.1rem;
    cursor: pointer;
    background: var(--surface);
    transition: border-color .15s ease, background .15s ease;
}
.choice-card input { position: absolute; opacity: 0; }
.choice-card .choice-card__title { font-weight: 700; margin: 0 0 .2rem; }
.choice-card .choice-card__desc { margin: 0; font-size: .88rem; color: var(--muted); }
.choice-card:has(input:checked) {
    border-color: var(--primary);
    background: var(--primary-softer);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

/* ---------- Flash messages ---------- */
.flash-wrap { padding-top: 1rem; }
.flash-wrap:empty { padding: 0; }
.flash {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .8rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: .6rem;
    border: 1px solid;
}
.flash--success { background: var(--success-soft); border-color: #bbe7cc; color: var(--success); }
.flash--error   { background: var(--danger-soft); border-color: #f6c7c7; color: var(--danger); }
.flash__text { font-weight: 500; }
.flash__close {
    background: transparent;
    border: 0;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    color: inherit;
    padding: 0 .2rem;
}

/* ---------- Header / nav ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, .94);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
}
.header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 68px;
    gap: 1rem;
}
.brand { display: inline-flex; align-items: center; gap: .5rem; color: var(--ink); text-decoration: none !important; }
.brand__mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px; height: 38px;
    border-radius: 10px;
    background: var(--primary);
    color: #fff;
}
.brand__text { font-size: 1.3rem; font-weight: 800; letter-spacing: -.02em; }
.brand__accent { color: var(--primary); }

.nav-toggle {
    display: inline-flex;
    flex-direction: column;
    gap: 5px;
    background: transparent;
    border: 0;
    padding: .5rem;
    cursor: pointer;
}
.nav-toggle__bar { width: 24px; height: 2.5px; background: var(--ink); border-radius: 2px; transition: transform .2s ease, opacity .2s ease; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

.site-nav { display: none; width: 100%; }
.site-nav.is-open { display: block; }

.site-nav__list {
    list-style: none;
    margin: 0;
    padding: .5rem 0 1rem;
    display: flex;
    flex-direction: column;
    gap: .25rem;
}
.nav-link {
    display: block;
    padding: .6rem .5rem;
    color: var(--ink);
    font-weight: 500;
    border-radius: 8px;
    text-decoration: none !important;
}
.nav-link:hover { background: var(--primary-softer); color: var(--primary-dark); }
.nav-link.is-active { color: var(--primary-dark); background: var(--primary-soft); }

.nav-auth { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-top: .5rem; }
.nav-user { display: inline-flex; align-items: center; gap: .5rem; font-weight: 600; margin-right: .25rem; }
.nav-user__name { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Avatar */
.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    flex: none;
}
.avatar--sm { width: 34px; height: 34px; font-size: .85rem; }
.avatar--md { width: 56px; height: 56px; font-size: 1.3rem; }
.avatar--lg { width: 84px; height: 84px; font-size: 2rem; }

/* ---------- Footer ---------- */
.site-footer { background: #12342e; color: #cfe2dd; margin-top: 3rem; }
.footer__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    padding-top: 2.5rem;
    padding-bottom: 2rem;
}
.footer__brand { font-size: 1.4rem; font-weight: 800; color: #fff; margin-bottom: .4rem; }
.footer__tagline { font-size: .95rem; color: #a9c7c0; max-width: 34ch; }
.footer__heading { color: #fff; font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; margin-bottom: .8rem; }
.footer__links { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; font-size: .95rem; }
.footer__links a { color: #cfe2dd; text-decoration: none; }
.footer__links a:hover { color: #fff; text-decoration: underline; }
.footer__bottom { border-top: 1px solid rgba(255,255,255,.12); padding: 1rem 0; font-size: .85rem; color: #9db9b2; }
.footer__bottom p { margin: 0; }
.footer__note { color: #7fa39b; }

/* ---------- Hero ---------- */
.hero {
    background:
        radial-gradient(1200px 500px at 80% -10%, rgba(245, 158, 11, .18), transparent 60%),
        linear-gradient(160deg, #0e7c66 0%, #0a5e4e 100%);
    color: #eaf5f2;
    padding: 3rem 0 3.5rem;
}
.hero__grid { display: grid; grid-template-columns: 1fr; gap: 2rem; align-items: center; }
.hero h1 { color: #fff; }
.hero__lead { font-size: 1.1rem; color: #d5ebe5; max-width: 56ch; }
.hero__actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.4rem; }
.hero__stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 2rem; }
.stat { background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.14); border-radius: var(--radius); padding: 1rem; text-align: center; }
.stat__num { font-size: 1.7rem; font-weight: 800; color: #fff; }
.stat__label { font-size: .82rem; color: #cfe5df; }

.hero__card {
    background: var(--surface);
    color: var(--ink);
    border-radius: var(--radius);
    padding: 1.4rem;
    box-shadow: var(--shadow);
}
.hero__card h3 { margin-top: 0; }

/* ---------- Sections ---------- */
.section { padding: 2.8rem 0; }
.section--alt { background: var(--surface); }
.section--soft { background: var(--primary-softer); }
.section__head { max-width: 64ch; margin-bottom: 1.6rem; }
.section__head--center { margin-inline: auto; text-align: center; }
.section__eyebrow {
    display: inline-block;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: .4rem;
}
.section__sub { color: var(--muted); }

/* Grids */
.grid { display: grid; gap: 1.1rem; }
.grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }

/* Feature cards */
.feature {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.4rem;
    box-shadow: var(--shadow-sm);
}
.feature__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px; height: 48px;
    font-size: 1.5rem;
    border-radius: 12px;
    background: var(--primary-soft);
    margin-bottom: .8rem;
}
.feature h3 { margin: 0 0 .4rem; }
.feature p { margin: 0; color: var(--muted); font-size: .95rem; }

/* Step cards */
.step {
    display: flex;
    gap: 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.2rem;
}
.step__num {
    flex: none;
    width: 40px; height: 40px;
    border-radius: 50%;
    background: var(--accent);
    color: #3b2c00;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.step h3 { margin: 0 0 .3rem; }
.step p { margin: 0; color: var(--muted); font-size: .95rem; }

/* ---------- Listing cards ---------- */
.listing-card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    transition: box-shadow .15s ease, transform .15s ease;
    text-decoration: none !important;
    color: var(--ink);
    height: 100%;
}
.listing-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.listing-card__top { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-bottom: .7rem; }
.listing-card__title { margin: 0 0 .5rem; font-size: 1.08rem; color: var(--ink); }
.listing-card__desc {
    color: var(--muted);
    font-size: .93rem;
    margin: 0 0 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.listing-card__meta {
    margin-top: auto;
    padding-top: .8rem;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .6rem;
    font-size: .82rem;
    color: var(--muted);
}
.listing-card__author { display: flex; align-items: center; gap: .5rem; min-width: 0; }
.listing-card__author span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .18rem .65rem;
    font-size: .74rem;
    font-weight: 700;
    border-radius: 999px;
    white-space: nowrap;
}
.badge--need  { background: #fde8e8; color: #b91c1c; }
.badge--offer { background: var(--success-soft); color: var(--success); }
.badge--private { background: var(--accent-soft); color: #8a5a00; }
.badge--open        { background: var(--success-soft); color: var(--success); }
.badge--in_progress { background: var(--info-soft); color: #1d4ed8; }
.badge--fulfilled   { background: var(--primary-soft); color: var(--primary-dark); }
.badge--closed      { background: #eef0f2; color: #4b5563; }
.badge--pending     { background: var(--accent-soft); color: #8a5a00; }
.badge--accepted    { background: var(--success-soft); color: var(--success); }
.badge--declined    { background: var(--danger-soft); color: var(--danger); }
.badge--type { background: var(--primary-soft); color: var(--primary-dark); }

/* Filter bar */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: .7rem;
    align-items: center;
    margin-bottom: 1.4rem;
}
.filter-bar__search { flex: 1 1 240px; }
.filter-bar__search input {
    width: 100%;
    padding: .62rem .9rem;
    border: 1.5px solid var(--border);
    border-radius: 999px;
    font: inherit;
}
.filter-bar__select select {
    padding: .62rem .9rem;
    border: 1.5px solid var(--border);
    border-radius: 999px;
    font: inherit;
    background: var(--surface);
}

/* Empty state */
.empty {
    text-align: center;
    padding: 3rem 1rem;
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    color: var(--muted);
}
.empty__icon { font-size: 2.4rem; margin-bottom: .6rem; }
.empty h3 { margin-bottom: .4rem; }

/* Page header band */
.page-head { padding: 2.2rem 0 1.6rem; border-bottom: 1px solid var(--border); background: var(--surface); }
.page-head h1 { margin-bottom: .3rem; }
.page-head__sub { color: var(--muted); margin: 0; }

/* ---------- Auth / narrow forms ---------- */
.auth-wrap {
    max-width: 520px;
    margin: 2.5rem auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.8rem;
    box-shadow: var(--shadow);
}
.auth-wrap h1 { margin-bottom: .4rem; }
.auth-wrap__sub { color: var(--muted); margin-bottom: 1.4rem; }
.auth-alt { margin-top: 1.2rem; text-align: center; font-size: .94rem; color: var(--muted); }

/* ---------- Detail panel (listing page, profile) ---------- */
.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.3rem;
}
.panel__title { margin-bottom: 1rem; }

.detail-grid { display: grid; grid-template-columns: 1fr; gap: 1.3rem; }
.detail-main h1 { font-size: 1.6rem; margin-bottom: .7rem; }
.detail-desc { white-space: pre-line; color: #374151; }
.detail-meta { display: flex; flex-wrap: wrap; gap: .5rem; margin: .8rem 0; }

.meta-row { display: flex; justify-content: space-between; gap: 1rem; padding: .5rem 0; border-bottom: 1px solid var(--border); font-size: .94rem; }
.meta-row:last-child { border-bottom: 0; }
.meta-row dt { color: var(--muted); }
.meta-row dd { margin: 0; font-weight: 600; text-align: right; }

/* Response / comment thread */
.thread { display: grid; gap: .8rem; }
.response {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    background: var(--surface);
}
.response__head { display: flex; align-items: center; gap: .6rem; margin-bottom: .4rem; }
.response__name { font-weight: 700; }
.response__time { color: var(--muted); font-size: .8rem; margin-left: auto; }
.response__msg { margin: 0; color: #374151; }
.response__actions { display: flex; gap: .5rem; margin-top: .8rem; }

/* ---------- Profile ---------- */
.profile-grid { display: grid; grid-template-columns: 1fr; gap: 1.3rem; }
.profile-card { text-align: center; }
.profile-card .avatar { margin: 0 auto .8rem; }
.profile-card__name { margin: 0; }
.profile-card__role { color: var(--muted); margin: 0 0 .2rem; }
.profile-card__meta { color: var(--muted); font-size: .88rem; margin: 0; }

.tabs { display: flex; flex-wrap: wrap; gap: .4rem; border-bottom: 1px solid var(--border); margin-bottom: 1.2rem; }
.tab {
    padding: .55rem 1rem;
    border: 0;
    background: transparent;
    font: inherit;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    text-decoration: none !important;
}
.tab:hover { color: var(--primary-dark); }
.tab.is-active { color: var(--primary-dark); border-bottom-color: var(--primary); }

/* ---------- Admin dashboard ---------- */
.stat-cards { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.2rem;
    box-shadow: var(--shadow-sm);
}
.stat-card__num { font-size: 1.9rem; font-weight: 800; color: var(--primary-dark); }
.stat-card__label { color: var(--muted); font-size: .9rem; }

.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.data th, table.data td { text-align: left; padding: .7rem .75rem; border-bottom: 1px solid var(--border); vertical-align: top; }
table.data th { background: var(--primary-softer); color: var(--primary-dark); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
table.data tr:last-child td { border-bottom: 0; }
.row-actions { display: flex; flex-wrap: wrap; gap: .4rem; }

/* ---------- Utilities ---------- */
.text-center { text-align: center; }
.text-muted { color: var(--muted); }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mb-0 { margin-bottom: 0; }
.inline-form { display: inline; }

/* ---------- Responsive (tablet & up) ---------- */
@media (min-width: 640px) {
    .grid--2 { grid-template-columns: repeat(2, 1fr); }
    .grid--3 { grid-template-columns: repeat(2, 1fr); }
    .grid--4 { grid-template-columns: repeat(2, 1fr); }
    .stat-cards { grid-template-columns: repeat(2, 1fr); }
    .choice-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 900px) {
    .nav-toggle { display: none; }
    .site-nav { display: flex; width: auto; margin-left: auto; }
    .site-nav__list { flex-direction: row; align-items: center; gap: .25rem; padding: 0; }
    .nav-auth { margin-top: 0; margin-left: .5rem; }
    .hero__grid { grid-template-columns: 1.1fr .9fr; }
    .hero { padding: 4rem 0 4.5rem; }
    .grid--3 { grid-template-columns: repeat(3, 1fr); }
    .grid--4 { grid-template-columns: repeat(4, 1fr); }
    .footer__grid { grid-template-columns: 1.6fr 1fr 1fr 1.2fr; }
    .detail-grid { grid-template-columns: 1.8fr 1fr; }
    .profile-grid { grid-template-columns: 320px 1fr; }
    .stat-cards { grid-template-columns: repeat(4, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* Language switcher (header) */
.nav-lang { display: flex; align-items: center; gap: .25rem; margin-top: .5rem; padding: .35rem 0; }
.nav-lang a { font-size: .82rem; font-weight: 700; color: var(--muted); padding: .2rem .55rem; border-radius: 6px; text-decoration: none; }
.nav-lang a:hover { color: var(--primary-dark); background: var(--primary-softer); }
.nav-lang a.is-active { color: var(--primary-dark); background: var(--primary-soft); }
.footer__credit { margin: .3rem 0 0; font-size: .82rem; color: #7fa39b; }
@media (min-width: 900px) { .nav-lang { margin-top: 0; margin-left: .75rem; padding: 0; } }




