:root {
    --bg: #f3f0e8;
    --surface: #fffdf8;
    --text: #17231c;
    --muted: #5b6a61;
    --line: #d4ded4;
    --green: #216a43;
    --green-dark: #153d2e;
    --shadow: 0 18px 48px rgba(21, 61, 46, 0.12);
    --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: linear-gradient(180deg, #f7f4ed 0%, #eef4ee 100%);
    color: var(--text);
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
input, textarea, select, button { font: inherit; }

.wrap { width: min(1180px, calc(100% - 2rem)); margin: 0 auto; }
.site-shell { min-height: 100vh; }
.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(14px);
    background: linear-gradient(90deg, #1f3d2d 0%, #216a43 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 0;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.9rem;
}
.brand-logo {
    width: 4.75rem;
    height: 4.75rem;
    object-fit: contain;
}
.brand strong, .brand small { display: block; }
.brand small { color: var(--muted); font-size: 0.8rem; }
.topbar .brand strong,
.topbar .brand small,
.topbar .topnav a {
    color: #f4fbf6;
}
.topbar .brand small {
    color: rgba(244, 251, 246, 0.82);
}
.topnav {
    display: flex;
    gap: 1.25rem;
    font-size: 0.95rem;
    align-items: center;
    flex-wrap: wrap;
}
.topnav a { color: #f4fbf6; }

.hero, .project-hero {
    padding: 4rem 0 3rem;
    background:
        radial-gradient(circle at top right, rgba(216, 137, 38, 0.12), transparent 22rem),
        radial-gradient(circle at bottom left, rgba(33, 106, 67, 0.14), transparent 26rem);
}
.hero-grid, .project-hero-grid, .detail-grid, .narrow-grid, .footer-grid, .steps, .project-grid, .stats-grid {
    display: grid;
    gap: 1.5rem;
}
.hero-grid, .project-hero-grid { grid-template-columns: 1.4fr 0.9fr; align-items: center; }
.hero h1, .project-hero h1 {
    margin: 0.25rem 0 1rem;
    font-size: clamp(2.4rem, 5vw, 4.6rem);
    line-height: 0.95;
    letter-spacing: -0.04em;
    max-width: 12ch;
}
.hero-copy { font-size: 1.08rem; line-height: 1.7; color: var(--muted); max-width: 60ch; }
.hero-card, .content-card, .step-card, .project-card, .panel, .auth-card, .prose-card, .table-card, .stat-card {
    background: var(--surface);
    border: 1px solid rgba(21, 61, 46, 0.08);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.hero-card {
    padding: 1.5rem;
    display: grid;
    gap: 1rem;
}
.metric {
    padding: 1rem 1.1rem;
    border-radius: 14px;
    background: linear-gradient(180deg, #fcfbf7, #f0f6f1);
    border: 1px solid var(--line);
}
.metric-highlight {
    padding: 1.15rem 1.2rem;
    background: linear-gradient(135deg, #183c2f 0%, #216a43 100%);
    border-color: rgba(255, 255, 255, 0.08);
}
.metric-row {
    display: flex;
    align-items: baseline;
    gap: 0.7rem;
}
.metric strong {
    display: block;
    font-size: clamp(2rem, 4vw, 3.5rem);
    line-height: 0.9;
    margin: 0;
    color: var(--green-dark);
}
.metric span { color: var(--muted); }
.metric-highlight strong,
.metric-highlight span {
    color: #f4fbf6;
}
.metric-row span {
    font-size: 0.98rem;
    font-weight: 700;
}
.eyebrow {
    display: inline-block;
    padding: 0.4rem 0.7rem;
    border-radius: 999px;
    background: rgba(33, 106, 67, 0.09);
    color: var(--green-dark);
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.hero-actions, .form-actions, .admin-section-head, .project-meta, .actions {
    display: flex;
    gap: 0.8rem;
    align-items: center;
    flex-wrap: wrap;
}
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.9rem 1.2rem;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    font-weight: 700;
}
.button-primary { background: var(--green); color: #fff; }
.button-secondary { background: #eef4ee; color: var(--green-dark); }
.button-block { width: 100%; }
.section { padding: 1.5rem 0 3rem; }
.surface { background: rgba(255, 255, 255, 0.45); }
.section-head { margin-bottom: 1.3rem; }
.section-head h2, .content-card h2, .prose-card h1, .auth-card h1, .admin-main h1 {
    margin: 0.4rem 0 0;
    font-size: clamp(1.8rem, 3vw, 2.8rem);
    line-height: 1.05;
}
.steps { grid-template-columns: repeat(3, 1fr); }
.step-card, .content-card, .panel, .auth-card, .prose-card { padding: 1.5rem; }
.step-card p, .content-card p, .prose-card p { color: var(--muted); line-height: 1.7; }
.project-grid { grid-template-columns: repeat(3, 1fr); }
.project-card { overflow: hidden; }
.project-image, .project-hero-image {
    min-height: 18rem;
    background-size: cover;
    background-position: center;
    background-color: #dfe6de;
}
.project-card-body { padding: 1.25rem; display: grid; gap: 1rem; }
.project-card h3 { margin: 0; font-size: 1.2rem; line-height: 1.2; }
.project-card p { margin: 0; color: var(--muted); line-height: 1.65; }
.badge {
    font-size: 0.75rem;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    font-weight: 700;
    text-transform: uppercase;
}
.badge-inscrito { background: #ece6d8; color: #6b5b32; }
.badge-em_captacao { background: #fff0da; color: #9f6513; }
.badge-executando { background: #f7e9ba; color: #705600; }
.badge-concluido { background: #dff3e5; color: #216a43; }
.badge-rascunho { background: #ececec; color: #656565; }
.detail-grid { grid-template-columns: 1.2fr 0.8fr; }
.narrow-grid { grid-template-columns: 0.9fr 1.1fr; align-items: start; }
.facts {
    margin: 0;
    display: grid;
    gap: 0.8rem;
}
.facts div {
    display: grid;
    gap: 0.2rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid var(--line);
}
.facts dt {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}
.facts dd { margin: 0; font-weight: 700; }
.info-box {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 16px;
    background: #f4f8f4;
    border: 1px solid var(--line);
}
.bullet-list { padding-left: 1.2rem; line-height: 1.7; color: var(--muted); }
.bullet-list li + li { margin-top: 0.55rem; }
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}
.form-grid .full { grid-column: 1 / -1; }
label { display: grid; gap: 0.45rem; font-weight: 700; }
label span { font-size: 0.92rem; }
input, textarea, select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    padding: 0.9rem 1rem;
    color: var(--text);
}
textarea { resize: vertical; }
.checkbox {
    grid-template-columns: auto 1fr;
    align-items: start;
    font-weight: 400;
}
.checkbox input { width: auto; margin-top: 0.25rem; }
.form-errors, .flash {
    margin: 1rem 0;
    padding: 0.95rem 1rem;
    border-radius: 14px;
}
.form-errors, .flash-error {
    background: #fce9e9;
    border: 1px solid #efb0b0;
    color: #8b2525;
}
.flash-success {
    background: #e4f4e8;
    border: 1px solid #b5d7bc;
    color: #215234;
}
.auth-card { max-width: 34rem; margin: 0 auto; }
.prose-card { max-width: 48rem; margin: 0 auto; }
.site-footer {
    padding: 2rem 0 3rem;
    margin-top: 2rem;
    background: linear-gradient(180deg, #16322d 0%, #102925 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.footer-grid {
    grid-template-columns: repeat(4, 1fr);
    padding-top: 0.5rem;
}
.site-footer h3 {
    margin-top: 0;
    color: #f1f8f4;
    font-size: 1rem;
}
.site-footer p {
    color: rgba(225, 237, 232, 0.78);
    line-height: 1.7;
}
.site-footer a {
    color: rgba(241, 248, 244, 0.92);
}
.footer-bottom {
    margin-top: 1.75rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.footer-bottom p {
    margin: 0;
    color: rgba(225, 237, 232, 0.68);
    font-size: 0.92rem;
}
.admin-body {
    background:
        radial-gradient(circle at top left, rgba(33, 106, 67, 0.08), transparent 22rem),
        linear-gradient(180deg, #f4f8f4, #f7f4ed);
}
.admin-shell {
    display: grid;
    grid-template-columns: 19.5rem 1fr;
    min-height: 100vh;
}
.admin-sidebar {
    padding: 1.5rem;
    background: linear-gradient(180deg, #16322d 0%, #102925 100%);
    color: #e9f2eb;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}
.admin-sidebar-panel {
    display: grid;
    gap: 1.2rem;
    margin-bottom: 1.8rem;
}
.admin-brand { color: #fff; }
.admin-brand .brand-logo {
    width: 3rem;
    height: 3rem;
}
.admin-user-card {
    padding: 1rem 1.05rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.06);
    display: grid;
    gap: 0.25rem;
}
.admin-user-label {
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: rgba(233, 242, 235, 0.68);
}
.admin-user-card strong {
    font-size: 1rem;
}
.admin-user-card small {
    color: rgba(233, 242, 235, 0.82);
}
.admin-nav { display: grid; gap: 0.55rem; }
.admin-nav a {
    padding: 0.9rem 1rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid transparent;
    color: #eef5ef;
}
.admin-nav a.is-active {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.12);
}
.admin-main {
    padding: 1.75rem;
}
.admin-page-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}
.admin-page-head p {
    margin: 0;
    max-width: 32rem;
    color: var(--muted);
    line-height: 1.7;
}
.stats-grid {
    grid-template-columns: repeat(4, 1fr);
    margin-bottom: 1.5rem;
}
.stat-card {
    padding: 1.5rem;
    background: linear-gradient(180deg, #fffdf8, #f3f7f4);
}
.stat-card strong {
    display: block;
    font-size: 2rem;
    margin-bottom: 0.25rem;
}
.stat-card span { color: var(--muted); }
.admin-section { margin-top: 1.5rem; }
.admin-section h2 {
    margin: 0;
    font-size: 1.3rem;
}
.table-card { overflow: auto; background: rgba(255, 255, 255, 0.82); }
table { width: 100%; border-collapse: collapse; min-width: 42rem; }
th, td {
    text-align: left;
    padding: 1rem;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}
th { color: var(--muted); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; }
.actions form { display: inline; margin: 0; }
.actions a, .actions button {
    border: none;
    background: none;
    color: var(--green);
    cursor: pointer;
    padding: 0;
    font-weight: 700;
}
.panel p {
    margin: 0;
    color: var(--muted);
    line-height: 1.7;
}
@media (max-width: 960px) {
    .hero-grid,
    .project-hero-grid,
    .detail-grid,
    .narrow-grid,
    .footer-grid,
    .project-grid,
    .steps,
    .stats-grid,
    .admin-shell {
        grid-template-columns: 1fr;
    }
    .footer-bottom {
        flex-direction: column;
        align-items: flex-start;
    }
    .topbar-inner {
        flex-direction: column;
        align-items: flex-start;
    }
    .topnav { flex-wrap: wrap; }
    .form-grid { grid-template-columns: 1fr; }
    .admin-sidebar { padding-bottom: 0; }
    .admin-page-head {
        align-items: flex-start;
    }
}
