:root {
    --landex-dark-teal: #243F44;
    --landex-medium-teal: #00717C;
    --landex-light-teal: #518C98;
    --landex-dark-grey: #707070;
    --landex-light-grey: #E0EAEF;
    --landex-lime: #CED64B;
    --landex-white: #FFFFFF;
    --landex-shadow: 0 1.5rem 3rem rgba(36, 63, 68, 0.08);
    --bs-primary: #00717C;
    --bs-primary-rgb: 0, 113, 124;
    --bs-link-color: #00717C;
    --bs-link-hover-color: #243F44;
    --bs-body-color: #707070;
    --bs-body-bg: #f5f8f8;
    --filepond-drop-label-color: #707070;
    --filepond-border-radius: 0.375rem;
    --bs-border-color: rgba(36, 63, 68, 0.12);
    --bs-font-sans-serif: Montserrat, Arial, sans-serif;
}

html {
    width: 100%;
    font-size: 100%;
}

body {
    margin: 0 auto;
    font-family: Montserrat, Arial, sans-serif;
    color: var(--landex-dark-grey);
    background-color: var(--bs-body-bg);
    overflow-x: hidden;
}

a {
    color: var(--landex-medium-teal);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

a:hover,
a:focus {
    color: var(--landex-lime);
    text-decoration: underline;
}

.form-text a {
    font-weight: 600;
}

.card a {
    font-weight: 600;
}

.alert a {
    color: var(--landex-dark-teal);
    font-weight: 600;
    text-decoration: underline;
}

.alert a:hover {
    color: var(--landex-lime);
}

/* Required field indicator */
.required-indicator {
    color: #dc3545;
    font-weight: 600;
    margin-left: 0.25rem;
}

/* F05H Modal */
.f05h-modal-header {
    background-color: var(--landex-medium-teal);
    color: #fff;
}

.f05h-modal-body {
    background-color: #f5f8f8;
}

.f05h-terms-header {
    background-color: var(--landex-light-teal);
    color: #fff;
}

.f05h-terms-body {
    max-height: 240px;
    overflow-y: auto;
    font-size: 0.9rem;
}

.f05h-signature-box {
    background-color: #f8f9fa;
}

.f05h-locked #f05h-form {
    opacity: 0.45;
    pointer-events: none;
    filter: grayscale(40%);
    transition: opacity 0.3s ease;
}

#f05h-form-container:not(.f05h-locked) #f05h-form {
    opacity: 1;
    pointer-events: auto;
    filter: none;
    transition: opacity 0.3s ease;
}

#f05h-clear-signature.btn-outline-primary {
    border-color: var(--landex-medium-teal);
    color: var(--landex-medium-teal);
}

#f05h-clear-signature.btn-outline-primary:hover,
#f05h-clear-signature.btn-outline-primary:focus {
    background-color: var(--landex-medium-teal);
    color: #fff;
}

#f05h-clear-signature.btn-outline-primary:disabled {
    border-color: rgba(60, 182, 206, 0.5);
    color: rgba(60, 182, 206, 0.6);
}

#submit-f05h:disabled {
    background-color: var(--landex-medium-teal);
    border-color: var(--landex-medium-teal);
    color: #fff;
    opacity: 0.55;
}

.missing-steps-accordion {
    border-radius: 0.375rem;
    overflow: hidden;
}

.missing-steps-item {
    border: 1px solid #00e5fb;
}

.missing-steps-toggle {
    background-color: #e0fbff;
    color: var(--landex-dark-teal);
    font-weight: 600;
}

.missing-steps-toggle:not(.collapsed) {
    background-color: #e0fbff;
    color: var(--landex-dark-teal);
    box-shadow: none;
}

.missing-steps-toggle::after {
    filter: brightness(0) saturate(100%) invert(17%) sepia(20%) saturate(700%) hue-rotate(145deg);
    transform: rotate(-180deg);
    transition: transform 0.2s ease;
}

.missing-steps-toggle.collapsed::after {
    transform: rotate(0deg);
}

.missing-steps-body {
    background-color: #f0fdff;
    font-size: 0.9rem;
}


@media (min-width: 1400px) {
    .container,
    .container-lg,
    .container-md,
    .container-sm,
    .container-xl,
    .container-xxl {
        max-width: 1200px !important;
    }
}

h1,
.h1,
h2,
.h2,
h3,
.h3,
h4,
.h4,
.navbar-brand {
    color: var(--landex-dark-teal);
    font-family: Montserrat, Arial, sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.display-6 {
    font-size: clamp(2.125rem, 3.019vw + 1.23rem, 3.75rem);
    line-height: 1.05;
}

.lead {
    color: var(--landex-dark-grey);
}

#header-navbar {
    padding: 1.5rem 0;
    background-color: var(--landex-medium-teal) !important;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(36, 63, 68, 0.2);
}

.portal-home-body #header-navbar {
    margin-bottom: 0 !important;
}

.portal-home-body .portal-shell {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.portal-home-body footer {
    margin-top: 0 !important;
}

body:not(.portal-home-body) .site-footer {
    margin-top: 2rem;
}

#header-navbar .btn {
    text-transform: none;
}

#header-navbar .navbar-brand {
    color: var(--landex-white) !important;
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

#header-navbar .navbar-brand svg {
    display: block;
    width: 235px;
    max-width: 100%;
    height: auto;
}

.navbar-brand-subtitle {
    font-size: 13px;
    color: #3cb6ce;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-top: 6px;
}

#header-navbar .nav-link,
#header-navbar .navbar-text {
    color: var(--landex-white) !important;
    font-size: 0.95rem;
    font-weight: 600;
}

#header-navbar .nav-link:hover,
#header-navbar .nav-link:focus {
    color: rgba(255, 255, 255, 0.85) !important;
}

.portal-shell {
    padding-top: 1rem;
    padding-bottom: 4rem;
}

.action-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(240, 246, 246, 0.98));
}

.card {
    border: 0;
    border-radius: 0.25rem;
    box-shadow: var(--landex-shadow);
    overflow: hidden;
}

.card-body {
    padding: 1.75rem;
}

.card {
    border-radius: 0.75rem;
    box-shadow: 0 0.5rem 2rem rgba(36, 63, 68, 0.1);
    border: 1px solid rgba(36, 63, 68, 0.08);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--landex-medium-teal);
    box-shadow: 0 0 0 0.25rem rgba(0, 113, 124, 0.15);
}

.form-control,
.form-select {
    background-color: #fafbfb;
    border: 1px solid rgba(36, 63, 68, 0.15);
    padding: 0.75rem 1rem;
    transition: all 0.2s ease-in-out;
}

.form-control:focus,
.form-select:focus {
    background-color: #fff;
}

.form-label {
    font-weight: 600;
    color: var(--landex-dark-teal);
    margin-bottom: 0.5rem;
}

.form-text {
    color: var(--landex-dark-grey);
    font-size: 0.875rem;
}

.filepond--root {
    margin-bottom: 0;
    font-family: inherit;
}

/* Direct child only - the drop-zone panel, not each file item's panel (which reuses the same class) */
.filepond--root > .filepond--panel-root {
    background-color: #fafbfb;
    border: 1px dashed rgba(0, 113, 124, 0.35);
    border-radius: 0.75rem;
}

.filepond--drop-label {
    color: var(--landex-dark-grey);
    min-height: 6rem;
}

.filepond--drop-label label {
    font-size: 0.9375rem;
}

.filepond--label-action {
    color: var(--landex-medium-teal);
    font-weight: 600;
    text-decoration-color: rgba(0, 113, 124, 0.4);
}

.filepond--item .filepond--panel-root {
    background-color: var(--landex-medium-teal);
    border-radius: 0.5rem;
}

.filepond--drip-blob {
    background-color: var(--landex-medium-teal);
}

.form-floating {
    position: relative;
}

.form-floating > .form-control,
.form-floating > .form-select {
    height: calc(3.5rem + 2px);
    padding: 1rem 0.75rem;
}

.form-floating > label {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    padding: 1rem 0.75rem;
    pointer-events: none;
    border: 1px solid transparent;
    transform-origin: 0 0;
    transition: opacity 0.1s ease-in-out, transform 0.1s ease-in-out;
}

.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label,
.form-floating > .form-select ~ label {
    opacity: 0.65;
    transform: scale(0.85) translateY(-0.5rem) translateX(0.15rem);
}

.form-floating > .form-control:focus ~ label::after,
.form-floating > .form-control:not(:placeholder-shown) ~ label::after,
.form-floating > .form-select ~ label::after {
    position: absolute;
    inset: 1rem 0.375rem;
    z-index: -1;
    height: 1.5em;
    content: "";
    background-color: #fafbfb;
    border-radius: 0.25rem;
}

.form-floating > .form-control:focus ~ label::after,
.form-floating > .form-control:not(:placeholder-shown) ~ label::after {
    background-color: #fff;
}

.password-strength {
    margin-top: 0.5rem;
    height: 4px;
    background-color: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
}

.password-strength-bar {
    height: 100%;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.password-strength-bar.weak {
    width: 33%;
    background-color: #ef4444;
}

.password-strength-bar.fair {
    width: 66%;
    background-color: #f59e0b;
}

.password-strength-bar.good {
    width: 100%;
    background-color: #10b981;
}

.password-strength-text {
    font-size: 0.75rem;
    margin-top: 0.25rem;
    color: var(--landex-dark-grey);
}

.password-strength-text.weak {
    color: #ef4444;
}

.password-strength-text.fair {
    color: #f59e0b;
}

.password-strength-text.good {
color: #10b981;
}

.toggle-cards {
display: flex;
gap: 1rem;
}

.toggle-card {
flex: 1;
padding: 1rem;
border: 2px solid rgba(36, 63, 68, 0.15);
border-radius: 0.5rem;
cursor: pointer;
transition: all 0.2s ease-in-out;
text-align: center;
background-color: #fafbfb;
    padding: 1rem;
    border: 2px solid rgba(36, 63, 68, 0.15);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    text-align: center;
    background-color: #fafbfb;
}

.toggle-card:hover {
    border-color: var(--landex-medium-teal);
    background-color: #fff;
}

.toggle-card.active {
    border-color: var(--landex-medium-teal);
    background-color: rgba(0, 113, 124, 0.05);
    box-shadow: 0 0 0 0.25rem rgba(0, 113, 124, 0.15);
}

.toggle-card input[type="radio"] {
    display: none;
}

.toggle-card-label {
    font-weight: 600;
    color: var(--landex-dark-teal);
    margin-bottom: 0.25rem;
}

.toggle-card-description {
    font-size: 0.875rem;
    color: var(--landex-dark-grey);
}

.form-header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(0, 113, 124, 0.05), rgba(81, 140, 152, 0.05));
    border-radius: 0.75rem;
    border: 1px solid rgba(0, 113, 124, 0.1);
}

.form-header-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 0.75rem;
    background-color: rgba(0, 113, 124, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--landex-medium-teal);
}

.form-header-icon svg {
    width: 24px;
    height: 24px;
}

.form-header-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--landex-dark-teal);
    margin-bottom: 0.5rem;
}

.form-header-description {
    color: var(--landex-dark-grey);
    font-size: 0.875rem;
}

.form-page {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 4rem 0;
}

.form-page .row {
    width: 100%;
}

.form-page .card {
    max-width: 500px;
    margin: 0 auto;
}

.mb-4 {
    margin-bottom: 1.5rem !important;
}

.mb-3 {
    margin-bottom: 1.25rem !important;
}

.form-control.is-valid,
.form-select.is-valid {
    border-color: #10b981;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%2310b981' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.form-control.is-invalid,
.form-select.is-invalid {
    border-color: #ef4444;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23ef4444'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linecap='round' d='M6 3.5v3M6 8v.5'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.invalid-feedback {
    display: none;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #ef4444;
}

.form-control.is-invalid ~ .invalid-feedback,
.form-select.is-invalid ~ .invalid-feedback {
    display: block;
}

.btn {
    min-width: 140px;
    border-radius: 0.25rem;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.85rem 1.4rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

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

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.3);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

.btn:focus:not(:active)::after {
    animation: ripple 1s ease-out;
}

@keyframes ripple {
    0% { transform: scale(0, 0); opacity: 0.5; }
    100% { transform: scale(100, 100); opacity: 0; }
}

.fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.loading-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--landex-light-grey);
    border-top: 4px solid var(--landex-medium-teal);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.btn-primary,
.btn-success {
    background-color: var(--landex-medium-teal);
    border-color: var(--landex-medium-teal);
    color: var(--landex-white);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-success:hover,
.btn-success:focus {
    background-color: var(--landex-light-teal);
    border-color: var(--landex-light-teal);
    color: var(--landex-white);
}

.btn-outline-secondary,
.btn-outline-primary,
.btn-outline-light,
.btn-outline-danger {
    border-width: 2px;
}

.btn-outline-secondary,
.btn-outline-primary {
    border-color: var(--landex-dark-teal);
    color: var(--landex-dark-teal);
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus,
.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background-color: var(--landex-dark-teal);
    border-color: var(--landex-dark-teal);
    color: var(--landex-white);
}

.table {
    --bs-table-bg: transparent;
    --bs-table-striped-bg: rgba(0, 113, 124, 0.035);
}

.table thead th {
    color: var(--landex-dark-teal);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border-bottom-width: 1px;
}

.badge {
    padding: 0.55em 0.8em;
    font-size: 0.72rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.status-badge { border: 1px solid transparent; }
.status-draft,
.status-awaiting_third_party,
.status-heat_loss_survey_required { background-color: #FFE0B8; color: #8A4B00; border-color: #F5C58A; }
.status-submitted { background-color: #D3E9FF; color: #0B4A7A; border-color: #A9D2F7; }
.status-approved { background-color: #D6F0DC; color: #1E6B30; border-color: #AEDDB9; }
.status-rejected { background-color: #DC3545; color: #fff; }
.status-commissioning { background-color: #1565C0; color: #fff; }
.status-handover { background-color: #E8740C; color: #fff; }
.status-complete { background-color: #198754; color: #fff; }
.status-other { background-color: var(--landex-dark-grey); color: #fff; }

.text-bg-primary {
    background-color: var(--landex-medium-teal) !important;
}

.text-bg-warning {
    background-color: #CE8E00 !important;
    color: #fff !important;
}

.text-bg-success {
    background-color: #7ea94a !important;
}

.text-bg-danger {
    background-color: #610131 !important;
}

.text-bg-secondary {
    background-color: #7d8d90 !important;
}

.form-label,
label {
    color: var(--landex-dark-teal);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.form-control,
.form-select,
textarea {
    border-radius: 0.25rem;
    border: 1px solid rgba(36, 63, 68, 0.18);
    padding: 0.8rem 0.95rem;
    box-shadow: 0 0.125rem 0.25rem rgba(36, 63, 68, 0.04);
}

.form-control:focus,
.form-select:focus,
textarea:focus {
    border-color: rgba(0, 113, 124, 0.45);
    box-shadow: 0 0 0 0.2rem rgba(0, 113, 124, 0.12);
}

.alert {
    border: 0;
    border-radius: 0.25rem;
    box-shadow: 0 0.5rem 1rem rgba(36, 63, 68, 0.08);
}

.list-group-item {
    border-color: rgba(36, 63, 68, 0.08);
}

.site-footer {
    margin-top: 4rem;
    padding: 4rem 0 2rem;
    background: #00717c;
    color: var(--landex-white);
}

.footer-logo svg {
    display: block;
    width: 235px;
    max-width: 100%;
    height: auto;
    margin-bottom: 2rem;
}

.site-footer h2,
.site-footer h3,
.site-footer p,
.site-footer a {
    color: var(--landex-white);
}

.site-footer a {
    text-decoration: none;
}

.site-footer a:hover,
.site-footer a:focus {
    color: #ced64b;
}

.site-footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.portal-hero {
    position: relative;
    color: var(--landex-white);
}

.portal-home-page {
    min-height: calc(100vh - 6.75rem);
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    margin-top: 0;
    margin-bottom: 0 !important;
    display: flex;
    flex-direction: column;
}

.portal-hero-home {
    position: relative;
    flex: 1 0 auto;
    min-height: clamp(360px, 52vh, 520px);
    width: 100%;
    background-image:
        linear-gradient(90deg, rgba(18, 40, 45, 0.78), rgba(13, 82, 90, 0.52)),
        url('../images/header-air-source-heat-pumps-scaled.jpg');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}

.portal-hero-home::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(8, 24, 27, 0.22), rgba(8, 24, 27, 0.42));
}

.portal-hero-home .container {
    position: relative;
    z-index: 1;
}

.portal-hero-content {
    padding: 3rem 0;
}

.portal-hero h1,
.portal-hero .display-6,
.portal-hero .display-3,
.portal-hero .lead {
    color: var(--landex-white);
}

.portal-hero .lead {
    opacity: 0.92;
}

.portal-hero .text-muted {
    color: rgba(255, 255, 255, 0.82) !important;
}

.section-title {
    color: var(--landex-dark-teal);
    font-weight: 700;
}

.icon-xs { width: 14px; height: 14px; }
.icon-sm { width: 18px; height: 18px; }
.icon-md { width: 24px; height: 24px; }
.icon-lg { width: 32px; height: 32px; }

@media (max-width: 767px) {
    #header-navbar {
        padding: 1rem 0;
    }

    .btn {
        min-width: 110px;
        font-size: 0.88rem;
        padding: 0.75rem 1rem;
    }

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