body {
    background: #f5f7f5;
}

/* ===== Admin enquiry index ===== */
.contact-admin-index.content {
    padding: 5.2rem 1rem 2rem;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
}

.contact-admin-header {
    margin: 0 0 1.8rem;
}

.contact-admin-header h1 {
    margin: 0;
    color: #52796F;
    font-size: 3.4rem;
    font-weight: 800;
    line-height: 1.1;
}

.contact-admin-header p {
    margin: 0.5rem 0 0;
    color: #1f2933;
    font-size: 1.85rem;
    line-height: 1.45;
}

.contact-admin-filter-card {
    margin-bottom: 2rem;
    padding: 1.8rem;
    border: 1px solid #dce6df;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 8px 18px rgba(47, 62, 70, 0.05);
}

.contact-admin-filter-card summary {
    margin: 0 0 1.2rem;
    color: #52796F;
    cursor: pointer;
    font-size: 1.85rem;
    font-weight: 800;
    list-style-position: inside;
}

.contact-admin-filter-card:not([open]) summary {
    margin-bottom: 0;
}

.contact-admin-filter-form {
    margin: 0;
}

.contact-filter-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.4rem 1.6rem;
}

.contact-filter-field .input,
.contact-filter-field .select {
    margin: 0;
}

.contact-filter-field label {
    display: block;
    margin-bottom: 0.45rem;
    color: #2F3E46;
    font-size: 1.55rem;
    font-weight: 700;
}

.contact-admin-filter-card input,
.contact-admin-filter-card select {
    width: 100%;
    height: 4.6rem;
    padding: 0 1.3rem;
    border: 1px solid #d4ddd8;
    border-radius: 8px;
    background: #e5e8e6;
    color: #1f2933;
    font-size: 1.45rem;
    box-shadow: 0 3px 8px rgba(47, 62, 70, 0.14);
}

.contact-admin-filter-card input:focus,
.contact-admin-filter-card select:focus {
    border-color: #52796F;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(82, 121, 111, 0.16);
}

.contact-filter-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1.8rem;
    margin-top: 1.4rem;
}

.contact-search-button,
.contact-reset-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 13rem;
    min-height: 4.4rem;
    margin: 0;
    border-radius: 8px;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
    text-decoration: none;
}

.contact-search-button {
    border: 1px solid #d4ddd8;
    background: #e5e8e6;
    color: #1f2933;
    box-shadow: 0 4px 8px rgba(47, 62, 70, 0.16);
}

.contact-search-button:hover,
.contact-search-button:focus {
    background: #DBE2DC;
    border-color: #cbd8d1;
    color: #1f2933;
}

.contact-reset-button {
    border: 1px solid #ff6868;
    background: #ff6868;
    color: #111111;
    box-shadow: 0 4px 8px rgba(47, 62, 70, 0.16);
}

.contact-reset-button:hover,
.contact-reset-button:focus {
    background: #e85a5a;
    border-color: #e85a5a;
    color: #111111;
}

.contact-admin-table-card {
    padding: 1.1rem 1.4rem;
    border: 1px solid #dce6df;
    border-radius: 4px;
    background: #f1f8f1;
    box-shadow: 0 4px 10px rgba(47, 62, 70, 0.22);
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

.contact-forms-table {
    width: 100%;
    min-width: 112rem;
    margin: 0;
    border-collapse: separate;
    border-spacing: 0 0.8rem;
    table-layout: fixed;
}

.contact-forms-table thead th {
    padding: 1.4rem 1.2rem;
    border-bottom: 2px solid #9aa9a1;
    background: #f6fbf6;
    color: #111111;
    font-size: 1.65rem;
    font-weight: 600;
    white-space: nowrap;
}

.contact-forms-table tbody tr {
    background: #f7fff7;
    box-shadow: 0 3px 6px rgba(47, 62, 70, 0.25);
}

.contact-forms-table tbody td {
    padding: 1.5rem 1.2rem;
    border: 0;
    color: #111111;
    font-size: 1.45rem;
    font-weight: 500;
    line-height: 1.35;
    vertical-align: middle;
    word-break: normal;
    overflow-wrap: anywhere;
}

.contact-forms-table tbody td.actions,
.contact-forms-table tbody td.cell-replied {
    vertical-align: middle;
}

.contact-forms-table th:nth-child(1),
.contact-forms-table td:nth-child(1) {
    width: 11rem;
}

.contact-forms-table th:nth-child(2),
.contact-forms-table td:nth-child(2) {
    width: 18rem;
}

.contact-forms-table th:nth-child(3),
.contact-forms-table td:nth-child(3) {
    width: 18rem;
}

.contact-forms-table th:nth-child(4),
.contact-forms-table td:nth-child(4) {
    width: 16rem;
}

.contact-forms-table th:nth-child(5),
.contact-forms-table td:nth-child(5) {
    width: 20rem;
}

.contact-forms-table th:nth-child(6),
.contact-forms-table td:nth-child(6) {
    width: 16rem;
}

.contact-forms-table th:nth-child(7),
.contact-forms-table td:nth-child(7) {
    width: 10rem;
}

.contact-forms-table tbody td:first-child {
    border-radius: 6px 0 0 6px;
}

.contact-forms-table tbody td:last-child {
    border-radius: 0 6px 6px 0;
}

.cell-name,
.cell-category,
.cell-message,
.cell-email {
    max-width: none;
}

.cell-message {
    max-width: none;
    line-height: 1.35;
}

.inline-mail-link {
    color: #111111;
    text-decoration: none;
}

.inline-mail-link:hover,
.inline-mail-link:focus {
    color: #335765;
    text-decoration: underline;
}

.contact-forms-table td.actions {
    width: 16rem;
    min-width: 16rem;
    padding-right: 1.2rem;
}

.contact-forms-table td.actions,
.contact-forms-table .actions {
    text-align: center;
}

.contact-actions-grid {
    display: grid;
    grid-template-columns: repeat(2, 7rem);
    gap: 0.55rem 0.7rem;
    align-items: center;
    justify-content: center;
    justify-items: center;
}

.contact-actions-grid form {
    width: 100%;
    margin: 0;
}

.contact-forms-table .contact-actions-grid .contact-row-action,
.contact-forms-table td.actions button.contact-row-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 7rem;
    min-width: 0;
    height: 3.2rem;
    min-height: 3.2rem;
    margin: 0;
    padding: 0 0.8rem;
    border: 1px solid #dce4df;
    border-radius: 8px;
    background: #ffffff;
    color: #111111;
    box-shadow: 0 2px 5px rgba(47, 62, 70, 0.16);
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.05;
    text-align: center;
    text-decoration: none;
    box-sizing: border-box;
}

.contact-forms-table .contact-actions-grid .contact-row-action:hover,
.contact-forms-table .contact-actions-grid .contact-row-action:focus,
.contact-forms-table td.actions button.contact-row-action:hover,
.contact-forms-table td.actions button.contact-row-action:focus {
    background: #DBE2DC;
    color: #2F3E46;
    text-decoration: none;
}

.contact-forms-table .contact-actions-grid .contact-row-delete,
.contact-forms-table td.actions button.contact-row-delete {
    border-color: #ff6868;
    background: #ff6868;
    color: #111111;
}

.contact-forms-table .contact-actions-grid .contact-row-delete:hover,
.contact-forms-table .contact-actions-grid .contact-row-delete:focus,
.contact-forms-table td.actions button.contact-row-delete:hover,
.contact-forms-table td.actions button.contact-row-delete:focus {
    background: #e85a5a;
    color: #111111;
}

.contact-reply-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 7rem;
    min-height: 3.2rem;
    padding: 0 0.8rem;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(47, 62, 70, 0.16);
    font-size: 1.1rem;
    font-weight: 800;
}

.contact-reply-badge.is-yes {
    background: #8fd399;
    color: #111111;
}

.contact-reply-badge.is-no {
    background: #ff6868;
    color: #111111;
}

.cell-replied {
    width: 10rem;
    min-width: 10rem;
    padding-left: 1.2rem;
    text-align: center;
}

.contact-admin-paginator {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 1rem;
    margin-top: 1.6rem;
    color: #2F3E46;
    font-size: 1.25rem;
}

.contact-admin-paginator .pagination {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin: 0;
    padding: 0;
}

.contact-admin-paginator p {
    margin: 0;
    text-align: right;
}

.contact-admin-index .empty-state {
    padding: 2rem;
    color: #536171;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
}

/* ===== Page Layout ===== */
.contact-page {
    padding: 48px 20px 72px;
}

.contact-wrapper {
    width: 100%;
    max-width: 920px;
    margin: 0 auto;
}

.contact-card {
    background: #ffffff;
    border: 1px solid #e7efe8;
    border-radius: 28px;
    padding: 40px 36px;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.08);
}

/* ===== Header ===== */
.contact-header {
    margin-bottom: 30px;
}

.contact-kicker {
    margin: 0 0 10px;
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #2f8a54;
}

.contact-header h1 {
    margin: 0 0 14px;
    font-size: 3.2rem;
    line-height: 1.1;
    font-weight: 800;
    color: #354F52;
}

.contact-intro {
    margin: 0;
    max-width: 700px;
    font-size: 1.6rem;
    line-height: 1.7;
    color: #5f6f64;
}

/* ===== Remove default CakePHP fieldset look ===== */
.contactForms fieldset {
    margin: 0;
    padding: 0;
    border: 0;
}

.contactForms legend {
    display: none;
}

/* ===== Form Layout ===== */
.contactForms .input {
    margin-bottom: 22px;
}

.contactForms label {
    display: block;
    margin-bottom: 10px;
    font-size: 1.6rem;
    font-weight: 700;
    color: #4f6f5e;
}

.contactForms input[type="text"],
.contactForms input[type="email"],
.contactForms textarea {
    width: 100%;
    border: 1.5px solid #d6e3d7;
    border-radius: 16px;
    background: #ffffff;
    color: #1f1f1f;
    font-size: 1.55rem;
    box-shadow: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.contactForms input[type="text"],
.contactForms input[type="email"] {
    height: 56px;
    padding: 0 16px;
}

.contactForms textarea {
    min-height: 160px;
    padding: 14px 16px;
    resize: vertical;
}

.contactForms input[type="text"]:focus,
.contactForms input[type="email"]:focus,
.contactForms textarea:focus {
    outline: none;
    border-color: #52796F;
    box-shadow: 0 0 0 3px rgba(82, 121, 111, 0.12);
}

/* ===== Enquiry Categories ===== */
.contactForms .select > label {
    margin-bottom: 14px;
}

.contactForms .select > fieldset,
.contactForms .select > div {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 20px;
    padding: 18px;
    border: 1px solid #e3ece4;
    border-radius: 18px;
    background: #f8fbf8;
}

.contactForms .checkbox {
    margin: 0;
}

.contactForms .checkbox label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #42584b;
}

.contactForms input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: #52796F;
}

/* ===== CAPTCHA ===== */
.captcha-wrap {
    margin-top: 26px;
    padding: 18px;
    border: 1px solid #e3ece4;
    border-radius: 18px;
    background: #f8fbf8;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.turnstile-message {
    margin: 16px 0 0;
    padding: 12px 14px;
    border-left: 4px solid #d97b7b;
    border-radius: 10px;
    background: #fff4f4;
    color: #9a3b3b;
    font-size: 1.45rem;
}

.invalid-submit {
    margin-top: 12px;
    font-size: 1.4rem;
    font-weight: 600;
    color: #b23b3b;
}

/* ===== Submit Button ===== */
.contact-actions {
    margin-top: 28px;
}

.contact-submit-button {
    min-width: 180px;
    height: 54px;
    padding: 0 28px;
    border: none;
    border-radius: 999px;
    background: #52796F;
    color: #ffffff;
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: 0.4px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}

.contact-submit-button:hover {
    background: #354F52;
    transform: translateY(-1px);
}

/* ===== Validation Errors ===== */
.contactForms .error,
.contactForms .error-message,
.contactForms .form-error {
    margin-top: 8px;
    font-size: 1.35rem;
    color: #b23b3b;
}

/* ===== Tablet and small screens ===== */
@media (max-width: 1100px) {
    .contact-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .contact-filter-actions {
        justify-content: flex-end;
    }

    .contact-admin-paginator {
        grid-template-columns: 1fr;
    }

    .contact-admin-paginator p {
        text-align: center;
    }

    .contact-forms-table {
        min-width: 112rem;
    }
}

/* ===== Mobile ===== */
@media (max-width: 768px) {
    .contact-filter-grid {
        grid-template-columns: 1fr;
    }

    .contact-filter-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .contact-search-button,
    .contact-reset-button {
        width: 100%;
    }

    .contact-page {
        padding: 28px 14px 48px;
    }

    .contact-card {
        padding: 28px 20px;
        border-radius: 22px;
    }

    .contact-header h1 {
        font-size: 2.6rem;
    }

    .contact-intro {
        font-size: 1.5rem;
    }

    .contactForms .select > fieldset,
    .contactForms .select > div {
        grid-template-columns: 1fr;
    }

    .contact-submit-button {
        width: 100%;
    }
}

@media (max-width: 420px) {
    .contact-page {
        padding: 20px 10px 40px;
    }

    .contact-card {
        padding: 22px 14px;
        border-radius: 18px;
    }

    .contact-header h1 {
        font-size: 2.3rem;
    }

    .contactForms label,
    .contactForms input[type="text"],
    .contactForms input[type="email"],
    .contactForms textarea {
        font-size: 1.45rem;
    }

    .captcha-wrap {
        padding: 10px;
    }

    .cf-turnstile {
        transform: scale(0.86);
        transform-origin: left top;
        min-height: 58px;
    }
}

/* Admin enquiry index overrides must sit after public contact form rules. */
.contactForms.contact-admin-index .contact-admin-filter-card label {
    margin-bottom: 0.45rem;
    color: #2F3E46;
    font-size: 1.55rem;
    font-weight: 700;
}

.contactForms.contact-admin-index .contact-admin-filter-card .input,
.contactForms.contact-admin-index .contact-admin-filter-card .select {
    margin-bottom: 0;
}

.contactForms.contact-admin-index .contact-admin-filter-card input,
.contactForms.contact-admin-index .contact-admin-filter-card select {
    height: 4.6rem;
    min-height: 4.6rem;
    padding: 0 1.3rem;
    border: 1px solid #d4ddd8;
    border-radius: 8px;
    background: #e5e8e6;
    color: #1f2933;
    font-size: 1.45rem;
    box-shadow: 0 3px 8px rgba(47, 62, 70, 0.14);
}

.contactForms.contact-admin-index .contact-admin-filter-card input:focus,
.contactForms.contact-admin-index .contact-admin-filter-card select:focus {
    border-color: #52796F;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(82, 121, 111, 0.16);
}

.contactForms.contact-admin-index .contact-search-button,
.contactForms.contact-admin-index .contact-reset-button {
    width: auto;
    min-width: 13rem;
    min-height: 4.4rem;
    margin: 0;
    border-radius: 8px;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0;
    line-height: normal;
    text-transform: none;
}

.contactForms.contact-admin-index .contact-search-button {
    border-color: #d4ddd8;
    background: #e5e8e6;
    color: #1f2933;
}

.contactForms.contact-admin-index .contact-reset-button {
    border-color: #ff6868;
    background: #ff6868;
    color: #111111;
}

@media (max-width: 768px) {
    .contactForms.contact-admin-index .contact-search-button,
    .contactForms.contact-admin-index .contact-reset-button {
        width: 100%;
    }
}
