
/* ==========================================
   CHRISTMAS APPEAL - MAIN STYLESHEET
   ========================================== */

:root {
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    color: #24364b;
    background: #f5f9f7;
    font-synthesis: none;
    --green: #16845c;
    --dark-green: #14532d;
    --blue: #2563eb;
    --gold: #fbbf24;
    --border: #dce8e3;
    --muted: #64748b;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: linear-gradient(180deg, #f0faf5 0%, #f7fafc 380px);
}

a {
    color: #147a67;
}

    a:hover {
        color: #0f5b4d;
    }

.container {
    max-width: 1120px;
    margin: auto;
    padding: 18px;
}

h1 {
    font-size: 1.85rem;
    color: #164b38;
    letter-spacing: -.5px;
}

h2 {
    font-size: 1.35rem;
    color: #205745;
}

h3 {
    color: #205745;
}

.heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

/* ==========================================
   HEADER AND NAVIGATION
   ========================================== */

.site-header {
    background: linear-gradient(110deg, #14532d, #166534, #0f766e);
    color: white;
}

.bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding-top: 16px;
    padding-bottom: 16px;
}

.brand {
    color: white;
    font-size: 22px;
    font-weight: 750;
    text-decoration: none;
    white-space: nowrap;
}

    .brand:hover {
        color: #fef3c7;
    }

.main-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

    .main-nav a,
    .logout-link {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 7px;
        background: transparent;
        color: white;
        text-decoration: none;
        font: inherit;
        font-size: 14px;
        font-weight: 600;
        padding: 9px 12px;
        border: 1px solid transparent;
        border-radius: 9px;
        cursor: pointer;
    }

        .main-nav a:hover,
        .logout-link:hover {
            background: rgba(255, 255, 255, .15);
            color: white;
        }

        .main-nav a.nav-highlight {
            background: #fbbf24;
            color: #422006;
        }

            .main-nav a.nav-highlight:hover {
                background: #fcd34d;
                color: #422006;
            }

    .main-nav form {
        display: inline;
        margin: 0;
    }

    .main-nav .logout-link {
        border-color: rgba(255, 255, 255, .4);
    }

.main-content {
    padding-top: 32px;
    padding-bottom: 40px;
    min-height: 65vh;
}

.site-footer {
    padding-top: 20px;
    padding-bottom: 20px;
    color: #64748b;
    font-size: 13px;
    text-align: center;
}

/* ==========================================
   CARDS AND DASHBOARD
   ========================================== */

.card {
    background: white;
    padding: 25px;
    border: 1px solid var(--border);
    border-radius: 15px;
    margin: 18px 0;
    box-shadow: 0 5px 20px rgba(20, 83, 45, .055);
}

    .card h2:first-child {
        margin-top: 0;
    }

.narrow {
    max-width: 450px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 16px;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 14px;
}

    .stats .card {
        border-top: 4px solid #10b981;
        transition: transform .2s ease, box-shadow .2s ease;
    }

        .stats .card:hover {
            transform: translateY(-3px);
            box-shadow: 0 9px 25px rgba(20, 83, 45, .1);
        }

    .stats strong {
        font-size: 2rem;
        color: #0b8061;
    }

/* ==========================================
   FORMS AND INPUTS
   ========================================== */

label {
    display: block;
    font-weight: 600;
    margin: 12px 0;
    color: #34465b;
}

input:not([type=checkbox]):not([type=radio]),
select,
textarea {
    display: block;
    width: 100%;
    padding: 11px 13px;
    margin-top: 6px;
    border: 1px solid #b8cfc5;
    border-radius: 9px;
    background: white;
    color: #24364b;
    font: inherit;
    transition: border-color .2s ease, box-shadow .2s ease;
}

    input:not([type=checkbox]):not([type=radio]):focus,
    select:focus,
    textarea:focus {
        outline: none;
        border-color: #16a085;
        box-shadow: 0 0 0 3px rgba(22, 160, 133, .13);
    }

input[type=checkbox] {
    width: 18px;
    height: 18px;
    vertical-align: middle;
    accent-color: #16845c;
}

input[type=radio] {
    accent-color: #16845c;
}

fieldset {
    border: 1px solid #cfe4d9;
    border-radius: 12px;
    padding: 20px;
    margin: 22px 0;
    background: #fbfefd;
}

legend {
    font-weight: 750;
    font-size: 1.15rem;
    padding: 0 8px;
    color: #176447;
}

.checks {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.check {
    font-weight: 500;
}

/* ==========================================
   BUTTONS
   ========================================== */

button,
.button {
    display: inline-block;
    background: #16845c;
    color: white;
    border: 1px solid #16845c;
    padding: 11px 18px;
    border-radius: 9px;
    font: inherit;
    font-weight: 650;
    cursor: pointer;
    text-decoration: none;
    transition: background .2s ease, transform .2s ease;
}

    button:hover,
    .button:hover {
        background: #106b4a;
        color: white;
        transform: translateY(-1px);
    }

    button:disabled,
    .button:disabled {
        opacity: .55;
        cursor: not-allowed;
        transform: none;
    }

    button.secondary,
    .button.secondary,
    a.secondary {
        background: #e8f4ef;
        color: #176447;
        border-color: #cfe4d9;
    }

        button.secondary:hover,
        .button.secondary:hover,
        a.secondary:hover {
            background: #d5ebe0;
            color: #14532d;
        }

.link {
    background: transparent;
    padding: 0;
    border: 0;
    color: white;
}

/* Action buttons */

.btn {
    display: inline-block;
    padding: 11px 18px;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    margin-right: 8px;
    margin-bottom: 8px;
    transition: background .2s ease, transform .2s ease;
}

    .btn:hover {
        transform: translateY(-1px);
    }

.btn-primary {
    background-color: #16845c;
    color: white;
    border-color: #16845c;
}

    .btn-primary:hover {
        background-color: #106b4a;
        color: white;
    }

.btn-outline-primary {
    background-color: transparent;
    color: #16845c;
    border-color: #16845c;
}

    .btn-outline-primary:hover {
        background-color: #e8f4ef;
        color: #14532d;
    }

.btn-outline-secondary {
    background-color: transparent;
    color: #475569;
    border-color: #94a3b8;
}

    .btn-outline-secondary:hover {
        background-color: #f1f5f9;
        color: #334155;
    }

.btn-sm {
    padding: 7px 12px;
    font-size: 13px;
}

/* ==========================================
   TABLES
   ========================================== */

table {
    border-collapse: collapse;
    width: 100%;
}

th,
td {
    border-bottom: 1px solid #e2eae5;
    text-align: left;
    padding: 12px;
}

th {
    background: #edf8f2;
    color: #205745;
    font-size: 13px;
    font-weight: 750;
}

tbody tr {
    transition: background .15s ease;
}

    tbody tr:hover {
        background: #f5fbf7;
    }

code {
    font-size: 1.05rem;
    background: #eaf4ff;
    color: #1e4f91;
    padding: 4px 7px;
    border-radius: 5px;
}

/* ==========================================
   NOTICES AND MESSAGES
   ========================================== */

.notice {
    background: #e1f7ea;
    border: 1px solid #9bd5b1;
    color: #176447;
    padding: 14px;
    border-radius: 10px;
}

.warning,
.error {
    color: #a52b2b;
    margin: 12px 0;
}

.hint {
    color: #64748b;
    font-size: .9rem;
}

/* ==========================================
   REFERRAL FORMS
   ========================================== */

.support {
    border-top: 1px solid #e0e9e3;
    padding: 16px 0;
    display: flex;
    justify-content: space-between;
    gap: 15px;
    align-items: center;
}

.child-row {
    display: flex;
    align-items: end;
    flex-wrap: wrap;
    gap: 15px;
    padding: 12px;
    border-bottom: 1px solid #e4eaf0;
}

    .child-row label {
        flex: 1;
        min-width: 115px;
    }

/* Reason for referral checkboxes */

.referral-reasons-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 24px;
    row-gap: 12px;
    margin: 16px 0;
    max-width: 850px;
}

    .referral-reasons-grid .check {
        display: flex;
        align-items: flex-start;
        gap: 10px;
        margin: 0;
        padding: 0;
        line-height: 1.4;
    }

    .referral-reasons-grid input[type="checkbox"] {
        flex: 0 0 auto;
        margin: 4px 0 0;
    }

/* ==========================================
   AFD POSTCODE LOOKUP
   ========================================== */

.afd-address-lookup {
    margin: 20px 0;
    max-width: 650px;
}

.afd-lookup-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}

    .afd-lookup-row input {
        flex: 1;
        min-width: 0;
    }

    .afd-lookup-row button {
        white-space: nowrap;
        margin: 0;
    }

.afd-address-lookup [data-afd-control="lookupResultsList"] {
    margin-top: 8px;
}

/* ==========================================
   UTILITIES
   ========================================== */

[hidden] {
    display: none !important;
}

/* ==========================================
   RESPONSIVE LAYOUT
   ========================================== */

@media (max-width: 768px) {
    .bar,
    .heading {
        flex-direction: column;
        align-items: flex-start;
    }

    .main-nav {
        gap: 4px;
    }

    .brand {
        font-size: 20px;
    }

    .container {
        padding: 13px;
    }
}

@media (max-width: 650px) {
    .support {
        align-items: flex-start;
        flex-direction: column;
    }

    .referral-reasons-grid {
        grid-template-columns: 1fr;
        row-gap: 10px;
    }

    table {
        display: block;
        overflow-x: auto;
    }

    .card {
        padding: 18px;
    }
}

@media (max-width: 600px) {
    .afd-lookup-row {
        flex-direction: column;
        align-items: stretch;
    }
}
