@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,600;9..144,700&family=Public+Sans:wght@400;500;600&display=swap');

:root {
    --color-soil: #5C4430;
    --color-green: #1F4A34;
    --color-gold: #C79A45;
    --color-paper: #F5F1E6;
    --color-ink: #22201B;
    --font-display: 'Fraunces', serif;
    --font-body: 'Public Sans', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background-color: var(--color-paper);
    color: var(--color-ink);
    line-height: 1.6;
}

h1, h2, h3 {
    font-family: var(--font-display);
    color: var(--color-green);
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
}

h2 {
    font-size: 1.75rem;
    font-weight: 600;
    margin-top: 2rem;
}

p {
    margin-bottom: 1rem;
    max-width: 65ch;
}

a {
    color: var(--color-green);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 2rem;
    background-color: var(--color-paper);
    border-bottom: 1px solid rgba(34, 32, 27, 0.1);
    position: relative;
}

.nav-logo {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-ink);
}

.nav-links {
    display: flex;
    align-items: center;
}

.nav-links a {
    margin-left: 1.5rem;
    font-family: var(--font-body);
    font-weight: 500;
    color: var(--color-ink);
}

.nav-links a:hover {
    color: var(--color-gold);
    text-decoration: none;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 26px;
    height: 18px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.nav-toggle span {
    display: block;
    height: 2px;
    width: 100%;
    background-color: var(--color-ink);
    border-radius: 2px;
}

main {
    max-width: 900px;
    margin: 0 auto;
    padding: 3rem 2rem;
    min-height: 60vh;
}

footer {
    text-align: center;
    padding: 2rem;
    font-size: 0.875rem;
    color: var(--color-soil);
    border-top: 1px solid rgba(34, 32, 27, 0.1);
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: var(--color-green);
    color: var(--color-paper);
    font-family: var(--font-body);
    font-weight: 600;
    border-radius: 4px;
    border: none;
    cursor: pointer;
}

.btn:hover {
    background-color: var(--color-soil);
    text-decoration: none;
}

.btn-secondary {
    background-color: transparent;
    color: var(--color-green);
    border: 1px solid var(--color-green);
}

.btn-secondary:hover {
    background-color: var(--color-green);
    color: var(--color-paper);
}

@media (max-width: 640px) {
    .nav-toggle {
        display: flex;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
        position: absolute;
        top: 100%;
        left: 0;
        background-color: var(--color-paper);
        padding: 1rem 2rem;
        border-bottom: 1px solid rgba(34, 32, 27, 0.1);
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links a {
        margin-left: 0;
        margin-top: 0.75rem;
    }

    h1 {
        font-size: 2rem;
    }

    main {
        padding: 2rem 1.25rem;
    }
}

.application-form {
    max-width: 700px;
    margin-top: 2rem;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group h3 {
    font-family: var(--font-display);
    color: var(--color-green);
    margin-top: 1rem;
    margin-bottom: 0;
    border-top: 1px solid rgba(34, 32, 27, 0.15);
    padding-top: 1.5rem;
}

label {
    font-weight: 500;
    font-size: 0.9rem;
    margin-bottom: 0.4rem;
    color: var(--color-soil);
}

input[type="text"],
input[type="email"],
input[type='password'],
input[type="number"],
input[type="tel"],
input[type="date"],
select,
textarea {
    padding: 0.65rem 0.75rem;
    border: 1px solid rgba(34, 32, 27, 0.25);
    border-radius: 6px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    background-color: white;
    width: 100%;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--color-gold);
    box-shadow: 0 0 0 3px rgba(199, 154, 69, 0.2);
}

textarea {
    min-height: 90px;
    resize: vertical;
}

input[type="file"] {
    font-family: var(--font-body);
    font-size: 0.85rem;
    padding: 0.5rem 0;
}

.field-error {
    color: #B23A3A;
    font-size: 0.8rem;
    margin-top: 0.3rem;
}

.flash-messages {
    list-style: none;
    margin-bottom: 1.5rem;
}

.flash-messages li {
    background-color: rgba(199, 154, 69, 0.15);
    border-left: 3px solid var(--color-gold);
    padding: 0.75rem 1rem;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

@media (max-width: 640px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

.business-fields-wrapper {
    display: none;
}

.upload-note {
    font-size: 0.85rem;
    color: var(--color-soil);
    margin-top: -0.5rem;
}

.hero {
    padding: 3rem 0 4rem;
    max-width: 700px;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-gold);
    margin-bottom: 0.75rem;
}

.hero h1 {
    font-size: 2.75rem;
    margin-bottom: 1rem;
}

.hero-sub {
    font-size: 1.1rem;
    color: var(--color-soil);
    max-width: 60ch;
    margin-bottom: 2rem;
}

.hero-actions {
    display: flex;
    gap: 1rem;
}

.how-it-works, .sectors, .membership-preview {
    padding: 3rem 0;
    border-top: 1px solid rgba(34, 32, 27, 0.1);
}

.how-it-works h2, .sectors h2, .membership-preview h2 {
    margin-bottom: 2rem;
}

.steps-grid, .sectors-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.step-number {
    display: block;
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--color-gold);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.step h3, .sector-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.step p, .sector-card p {
    font-size: 0.9rem;
    color: var(--color-soil);
}

.sector-card {
    background-color: white;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid rgba(34, 32, 27, 0.08);
}

.membership-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    max-width: 700px;
}

.membership-card {
    background-color: white;
    padding: 2rem;
    border-radius: 10px;
    border: 1px solid rgba(34, 32, 27, 0.08);
}

.membership-card h3 {
    margin-bottom: 1rem;
}

.membership-card .fee {
    font-family: var(--font-display);
    font-size: 1.75rem;
    color: var(--color-green);
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.membership-card .fee span {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--color-soil);
    font-weight: 400;
}

.membership-card .contribution {
    color: var(--color-soil);
    margin-bottom: 1.5rem;
}

.membership-note {
    margin-top: 1.5rem;
}

@media (max-width: 768px) {
    .steps-grid, .sectors-grid, .membership-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 640px) {
    .hero h1 {
        font-size: 2rem;
    }

    .hero-actions {
        flex-direction: column;
    }

    .steps-grid, .sectors-grid, .membership-grid {
        grid-template-columns: 1fr;
    }
}

.success-page {
    text-align: center;
    max-width: 500px;
    margin: 3rem auto;
    padding: 2rem 1rem;
}

.success-checkmark {
    width: 90px;
    height: 90px;
    margin: 0 auto 1.5rem;
}

.success-checkmark svg {
    width: 100%;
    height: 100%;
}

.success-circle {
    stroke: var(--color-green);
    stroke-width: 3;
    stroke-dasharray: 151;
    stroke-dashoffset: 151;
    animation: draw-circle 0.6s ease forwards;
}

.success-tick {
    stroke: var(--color-green);
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 36;
    stroke-dashoffset: 36;
    animation: draw-tick 0.4s ease forwards 0.6s;
}

@keyframes draw-circle {
    to { stroke-dashoffset: 0; }
}

@keyframes draw-tick {
    to { stroke-dashoffset: 0; }
}

.success-page h1 {
    margin-bottom: 1rem;
}

.success-note {
    font-size: 0.9rem;
    color: var(--color-soil);
    margin-bottom: 2rem;
}

.consent-group {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(34, 32, 27, 0.1);
}

.consent-label {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    font-weight: 400;
    font-size: 0.9rem;
    color: var(--color-ink);
    cursor: pointer;
}

.consent-label input[type="checkbox"] {
    width: auto;
    margin-top: 0.2rem;
    flex-shrink: 0;
    cursor: pointer;
}

.consent-label a {
    font-weight: 600;
}

.qr-container {
    background-color: white;
    padding: 1.5rem;
    border-radius: 8px;
    display: inline-block;
    margin: 1rem 0;
    border: 1px solid rgba(34, 32, 27, 0.1);
}

.qr-container img {
    display: block;
    width: 200px;
    height: 200px;
}

.notice-card {
    background-color: white;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    border: 1px solid rgba(34, 32, 27, 0.08);
}

.notice-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--color-soil);
    margin-bottom: 0.5rem;
}

.notice-badge {
    background-color: rgba(199, 154, 69, 0.2);
    color: #8A6524;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background-color: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.stat-number {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-green);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--admin-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

@media (max-width: 900px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 500px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

.pagination {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1.5rem;
    font-size: 0.85rem;
    color: var(--admin-muted);
}

.portal-body {
    background-color: var(--color-paper);
    margin: 0;
    font-family: var(--font-body);
}

.portal-shell {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 2rem;
}

.portal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 0;
    border-bottom: 1px solid rgba(34, 32, 27, 0.1);
    margin-bottom: 2rem;
}

.portal-logo {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-ink);
    text-decoration: none;
}

.portal-nav {
    display: flex;
    gap: 1.5rem;
}

.portal-nav a {
    color: var(--color-ink);
    font-weight: 500;
    font-size: 0.9rem;
}

.portal-nav a:hover {
    color: var(--color-gold);
    text-decoration: none;
}

.portal-main {
    padding-bottom: 3rem;
}

.portal-welcome {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.portal-welcome h1 {
    margin-bottom: 0;
}

.portal-card {
    background-color: white;
    border-radius: 10px;
    padding: 1.75rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(34, 32, 27, 0.08);
}

.portal-card h2 {
    margin-top: 0;
    font-size: 1.2rem;
}

.portal-details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.detail-label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--color-soil);
    margin-bottom: 0.2rem;
}

.detail-value {
    display: block;
    font-size: 0.95rem;
    color: var(--color-ink);
    font-weight: 500;
}

.portal-card .admin-table {
    margin-bottom: 1.25rem;
}

@media (max-width: 640px) {
    .portal-shell {
        padding: 0 1.25rem;
    }

    .portal-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .portal-nav {
        gap: 1rem;
    }

    .portal-details-grid {
        grid-template-columns: 1fr;
    }
}

.portal-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.portal-card-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.portal-card-header h2 {
    margin: 0;
}

.contribution-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(34, 32, 27, 0.08);
}

.contribution-total {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.contribution-total-value {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-green);
}

.contribution-table {
    width: 100%;
    border-collapse: collapse;
    box-shadow: none;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(34, 32, 27, 0.1);
}

.contribution-table thead {
    background-color: var(--color-paper);
}

.contribution-table th {
    text-align: left;
    padding: 0.75rem 1.1rem;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-soil);
    font-weight: 600;
    border-bottom: 1px solid rgba(34, 32, 27, 0.12);
}

.contribution-table td {
    padding: 0.85rem 1.1rem;
    font-size: 0.88rem;
    color: var(--color-ink);
    border-bottom: 1px solid rgba(34, 32, 27, 0.06);
}

.contribution-table tbody tr:last-child td {
    border-bottom: none;
}

.contribution-table tbody tr:nth-child(even) {
    background-color: rgba(34, 32, 27, 0.015);
}

.contribution-table th:nth-child(2),
.contribution-table td:nth-child(2) {
    text-align: right;
}

.amount-cell {
    font-weight: 600;
    color: var(--color-green);
    font-variant-numeric: tabular-nums;
}

.portal-empty-state {
    color: var(--color-soil);
    font-size: 0.9rem;
    padding: 1.5rem 0;
    text-align: center;
}

@media (max-width: 640px) {
    .contribution-summary {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .portal-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
}

.staff-login-body {
    background-image: linear-gradient(rgba(26, 43, 34, 0.55), rgba(26, 43, 34, 0.55)), url('../img/login_admin.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-body);
}

.staff-login-shell {
    background-color: white;
    border-radius: 12px;
    padding: 2.5rem;
    width: 100%;
    max-width: 400px;
    margin: 1.5rem;
}

.staff-login-brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 1.75rem;
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--admin-text);
}

.bank-details-box {
    background-color: white;
    border: 1px solid rgba(34, 32, 27, 0.12);
    border-radius: 8px;
    padding: 1.25rem;
    margin: 0.5rem 0 1rem;
}

.bank-details-box p {
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
}

@media (max-width: 480px) {
    .btn, .btn-secondary {
        width: 100%;
        text-align: center;
        box-sizing: border-box;
    }

    .hero-actions .btn,
    .hero-actions .btn-secondary {
        width: 100%;
    }

    main {
        padding: 1.75rem 1.25rem;
    }

    input[type="file"] {
        font-size: 0.78rem;
    }

    .consent-label {
        font-size: 0.85rem;
    }

    .bank-details-box {
        padding: 1rem;
    }

    .bank-details-box p {
        font-size: 0.85rem;
    }

    .notice-card {
        padding: 1.1rem;
    }

    .notice-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.35rem;
    }

    .qr-container img {
        width: 160px;
        height: 160px;
    }

    .staff-login-shell {
        padding: 1.75rem;
        margin: 1rem;
    }

    .contribution-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .portal-card {
        padding: 1.25rem;
    }
}

.error-page {
    text-align: center;
    max-width: 500px;
    margin: 4rem auto;
    padding: 2rem 1rem;
}

.error-page h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.error-page p {
    color: var(--color-soil);
    margin-bottom: 2rem;
    max-width: none;
}


.nav-logo-img {
    height: 48px;
    width: auto;
    display: block;
}

.admin-brand-logo {
    width: 100%;
    max-width: 190px;
    height: auto;
    display: block;
}

.portal-logo-img {
    height: 32px;
    width: auto;
    display: block;
}

.staff-login-logo {
    width: 100%;
    max-width: 280px;
    height: auto;
    display: block;
    margin: 0 auto;
}

.notice-image {
    width: 100%;
    max-width: 500px;
    height: auto;
    border-radius: 8px;
    margin: 0.75rem 0;
    display: block;
}

.portal-hero {
    background: linear-gradient(135deg, var(--color-green) 0%, #163726 100%);
    border-radius: 14px;
    padding: 2rem 2.25rem;
    margin-bottom: 1.5rem;
    color: var(--color-paper);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.portal-hero-greeting h1 {
    color: white;
    font-size: 1.75rem;
    margin-bottom: 0.35rem;
}

.portal-hero-greeting .status-badge {
    background-color: rgba(199, 154, 69, 0.25);
    color: var(--color-gold);
}

.portal-hero-balance {
    text-align: right;
}

.portal-hero-balance-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(245, 241, 230, 0.65);
    margin-bottom: 0.25rem;
}

.portal-hero-balance-value {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
    line-height: 1;
}

.portal-card-icon-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.portal-card-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background-color: rgba(31, 74, 52, 0.08);
    color: var(--color-green);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.portal-detail-item {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
}

.portal-detail-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background-color: rgba(199, 154, 69, 0.12);
    color: var(--color-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.portal-mini-stat {
    background-color: var(--color-paper);
    border-radius: 10px;
    padding: 1.1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.portal-mini-stat-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background-color: white;
    color: var(--color-green);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.portal-mini-stat-body {
    display: flex;
    flex-direction: column;
}

.portal-mini-stat-value {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--color-green);
    line-height: 1.15;
}

.portal-mini-stat-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--color-soil);
    margin-top: 0.1rem;
}

.portal-pending-note {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: rgba(199, 154, 69, 0.12);
    border-left: 3px solid var(--color-gold);
    padding: 0.7rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    color: #8A6524;
    margin-bottom: 1.25rem;
}

@media (max-width: 640px) {
    .portal-hero {
        flex-direction: column;
        align-items: flex-start;
    }
    .portal-hero-balance {
        text-align: left;
    }
    .contribution-summary.stats-mini-grid {
        grid-template-columns: 1fr;
    }
}

.portal-card-actions .btn,
.portal-card-actions .btn-secondary {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

.portal-card > .btn,
.portal-card > .btn-secondary {
    padding: 0.55rem 1.1rem;
    font-size: 0.85rem;
}