/* =========================================================
   QPET LIQUID PACKAGING
   Central Brand Design System

   All public and admin pages will use these shared variables.

   Official palette source:
   QPET Basic Brand Kit

   Supporting interface colours, sizing and spacing are
   proposed web design values.
   ========================================================= */

:root {
    /* =====================================================
       1. CORE BRAND COLOURS
       ===================================================== */

    --qpet-primary: #0B6F8D;
    --qpet-secondary: #2AA7C7;
    --qpet-accent: #78B84A;
    --qpet-navy: #123B63;
    --qpet-white: #FFFFFF;
    /* =====================================================
       2. SUPPORTING COLOURS
       ===================================================== */

    --qpet-primary-hover: #095970;
    --qpet-primary-active: #07495C;
    --qpet-primary-soft: #EAF5F8;
    --qpet-secondary-soft: #E7F6F9;
    --qpet-accent-soft: #EFF7E8;
    --qpet-surface: #F4F8FA;
    --qpet-surface-alt: #EAF1F5;
    --qpet-border: #DCE7EC;
    --qpet-border-strong: #B9CCD6;
    --qpet-text: var(--qpet-navy);
    --qpet-text-muted: #526B7D;
    --qpet-text-on-dark: #FFFFFF;
    --qpet-text-on-dark-muted: #D6E5EE;
    /* =====================================================
       3. FUNCTIONAL COLOURS

       These are used for validation, notifications,
       enquiry statuses and management actions.
       ===================================================== */

    --qpet-success: #286B39;
    --qpet-success-bg: #E9F6EC;
    --qpet-warning: #805200;
    --qpet-warning-bg: #FFF4DC;
    --qpet-danger: #B42318;
    --qpet-danger-bg: #FDECEA;
    --qpet-info: #0B6F8D;
    --qpet-info-bg: #EAF5F8;
    /* =====================================================
       4. TYPOGRAPHY

       Telegraf and Circe are recommended in the brand kit
       but have not yet been confirmed or licensed.

       Use system font fallbacks until approved webfont
       files are supplied.
       ===================================================== */

    --qpet-font-heading: Helvetica, Arial, sans-serif;
    --qpet-font-body: Inter, "Segoe UI", Helvetica, Arial, sans-serif;
    --qpet-weight-normal: 400;
    --qpet-weight-medium: 500;
    --qpet-weight-semibold: 600;
    --qpet-weight-bold: 700;
    --qpet-text-xs: 0.75rem;
    --qpet-text-sm: 0.875rem;
    --qpet-text-base: 1rem;
    --qpet-text-lg: 1.125rem;
    --qpet-heading-card: clamp(1.125rem, 1.05rem + 0.4vw, 1.5rem);
    --qpet-heading-section: clamp(1.75rem, 1.35rem + 1.8vw, 2.625rem);
    --qpet-heading-page: clamp(2rem, 1.55rem + 2.3vw, 3.25rem);
    --qpet-heading-hero: clamp(2.125rem, 1.5rem + 3.2vw, 4.25rem);
    --qpet-line-body: 1.6;
    --qpet-line-heading: 1.12;
    /* =====================================================
       5. SPACING SYSTEM
       ===================================================== */

    --qpet-space-1: 4px;
    --qpet-space-2: 8px;
    --qpet-space-3: 12px;
    --qpet-space-4: 16px;
    --qpet-space-5: 20px;
    --qpet-space-6: 24px;
    --qpet-space-8: 32px;
    --qpet-space-10: 40px;
    --qpet-space-12: 48px;
    --qpet-space-16: 64px;
    --qpet-space-20: 80px;
    --qpet-space-24: 96px;
    /* =====================================================
       6. RESPONSIVE LAYOUT
       ===================================================== */

    --qpet-container: 1320px;
    --qpet-container-narrow: 840px;
    --qpet-gutter: clamp(16px, 3vw, 48px);
    --qpet-section-space: clamp(48px, 7vw, 96px);
    --qpet-header-height: 88px;
    --qpet-control-height: 48px;
    --qpet-touch-target: 44px;
    /* =====================================================
       7. BORDER RADIUS
       ===================================================== */

    --qpet-radius-sm: 8px;
    --qpet-radius-md: 12px;
    --qpet-radius-lg: 16px;
    --qpet-radius-xl: 20px;
    /* =====================================================
       8. SHADOWS

       Keep shadows subtle and consistent.
       ===================================================== */

    --qpet-shadow-sm: 0 3px 10px rgba(18, 59, 99, 0.06);
    --qpet-shadow-md: 0 8px 24px rgba(18, 59, 99, 0.09);
    --qpet-shadow-lg: 0 16px 42px rgba(18, 59, 99, 0.12);
    /* =====================================================
       9. TRANSITIONS AND ACCESSIBILITY
       ===================================================== */

    --qpet-transition-fast: 150ms ease;
    --qpet-transition: 220ms ease;
    --qpet-focus: #0B6F8D;
    --qpet-focus-light: #2AA7C7;
    --qpet-z-header: 1000;
    --qpet-z-overlay: 1100;
    --qpet-z-dialog: 1200;
}


/* =========================================================
   SHARED CONTAINERS
   ========================================================= */

.qpet-container,
.qpet-container-narrow {
    box-sizing: border-box;
    width: calc(100% - var(--qpet-gutter) * 2);
    margin-inline: auto;
    min-width: 0;
}

.qpet-container {
    max-width: var(--qpet-container);
}

.qpet-container-narrow {
    max-width: var(--qpet-container-narrow);
}


/* =========================================================
   SHARED SECTION STYLING
   ========================================================= */

.qpet-section {
    padding-block: var(--qpet-section-space);
}

.qpet-section-soft {
    background: var(--qpet-surface);
}

.qpet-section-heading {
    max-width: 760px;
    margin-bottom: var(--qpet-space-8);
}

.qpet-brand-rule {
    display: block;
    width: 48px;
    height: 4px;
    margin-bottom: var(--qpet-space-4);
    border: 0;
    border-radius: 4px;
    background: var(--qpet-accent);
}


/* =========================================================
   SHARED TYPOGRAPHY
   ========================================================= */

.qpet-heading {
    margin: 0;
    color: var(--qpet-navy);
    font-family: var(--qpet-font-heading);
    font-weight: var(--qpet-weight-bold);
    line-height: var(--qpet-line-heading);
    overflow-wrap: break-word;
}

.qpet-heading-hero {
    font-size: var(--qpet-heading-hero);
}

.qpet-heading-page {
    font-size: var(--qpet-heading-page);
}

.qpet-heading-section {
    font-size: var(--qpet-heading-section);
}

.qpet-heading-card {
    font-size: var(--qpet-heading-card);
}

.qpet-copy {
    margin: 0;
    color: var(--qpet-text-muted);
    font-family: var(--qpet-font-body);
    font-size: var(--qpet-text-base);
    line-height: var(--qpet-line-body);
    overflow-wrap: break-word;
}

.qpet-heading + .qpet-copy {
    margin-top: var(--qpet-space-4);
}

.qpet-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: var(--qpet-space-2);
    margin: 0 0 var(--qpet-space-3);
    color: var(--qpet-primary);
    font-family: var(--qpet-font-body);
    font-size: var(--qpet-text-xs);
    font-weight: var(--qpet-weight-bold);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

    .qpet-eyebrow::before {
        content: "";
        display: block;
        width: 8px;
        height: 8px;
        flex: 0 0 8px;
        border-radius: 50%;
        background: var(--qpet-accent);
    }


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

.qpet-btn {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--qpet-space-2);
    min-height: var(--qpet-control-height);
    max-width: 100%;
    padding: 12px 20px;
    border: 1px solid transparent;
    border-radius: var(--qpet-radius-sm);
    font-family: var(--qpet-font-body);
    font-size: var(--qpet-text-sm);
    font-weight: var(--qpet-weight-semibold);
    line-height: 1.4;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: color var(--qpet-transition-fast), background-color var(--qpet-transition-fast), border-color var(--qpet-transition-fast);
}

.qpet-btn-primary {
    color: var(--qpet-white);
    background: var(--qpet-primary);
    border-color: var(--qpet-primary);
}

    .qpet-btn-primary:hover {
        color: var(--qpet-white);
        background: var(--qpet-primary-hover);
        border-color: var(--qpet-primary-hover);
    }

    .qpet-btn-primary:active {
        background: var(--qpet-primary-active);
    }

.qpet-btn-secondary {
    color: var(--qpet-primary);
    background: var(--qpet-white);
    border-color: var(--qpet-border-strong);
}

    .qpet-btn-secondary:hover {
        color: var(--qpet-primary-hover);
        background: var(--qpet-primary-soft);
        border-color: var(--qpet-primary);
    }

.qpet-btn-light {
    color: var(--qpet-navy);
    background: var(--qpet-white);
    border-color: var(--qpet-white);
}

    .qpet-btn-light:hover {
        color: var(--qpet-primary);
        background: var(--qpet-primary-soft);
    }

.qpet-btn-outline-light {
    color: var(--qpet-white);
    background: transparent;
    border-color: rgba(255, 255, 255, 0.65);
}

    .qpet-btn-outline-light:hover {
        color: var(--qpet-navy);
        background: var(--qpet-white);
        border-color: var(--qpet-white);
    }

.qpet-btn-danger {
    color: var(--qpet-danger);
    background: var(--qpet-white);
    border-color: var(--qpet-danger);
}

    .qpet-btn-danger:hover {
        background: var(--qpet-danger-bg);
    }

.qpet-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.qpet-btn:focus-visible {
    outline: 3px solid var(--qpet-focus);
    outline-offset: 4px;
}

.qpet-btn-light:focus-visible,
.qpet-btn-outline-light:focus-visible {
    outline-color: var(--qpet-focus-light);
}

.qpet-button-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--qpet-space-3);
}


/* =========================================================
   SHARED FORM CONTROLS
   ========================================================= */

.qpet-field {
    display: grid;
    gap: var(--qpet-space-2);
    min-width: 0;
}

.qpet-field-label {
    color: var(--qpet-navy);
    font-size: var(--qpet-text-sm);
    font-weight: var(--qpet-weight-semibold);
}

.qpet-control {
    box-sizing: border-box;
    display: block;
    width: 100%;
    min-width: 0;
    min-height: var(--qpet-control-height);
    padding: 12px 14px;
    border: 1px solid var(--qpet-border-strong);
    border-radius: var(--qpet-radius-sm);
    color: var(--qpet-text);
    background: var(--qpet-white);
    font-family: var(--qpet-font-body);
    font-size: 1rem;
    transition: border-color var(--qpet-transition-fast), box-shadow var(--qpet-transition-fast);
}

    .qpet-control:focus {
        outline: none;
        border-color: var(--qpet-primary);
        box-shadow: 0 0 0 3px rgba(11, 111, 141, 0.18);
    }

    .qpet-control::placeholder {
        color: var(--qpet-text-muted);
    }

textarea.qpet-control {
    min-height: 130px;
    resize: vertical;
}

.qpet-control.input-validation-error,
.qpet-control[aria-invalid="true"] {
    border-color: var(--qpet-danger);
}

.qpet-field-error {
    color: var(--qpet-danger);
    font-size: var(--qpet-text-sm);
}

.qpet-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--qpet-space-5);
}


/* =========================================================
   SHARED CARDS
   ========================================================= */

.qpet-card {
    box-sizing: border-box;
    min-width: 0;
    padding: var(--qpet-space-6);
    border: 1px solid var(--qpet-border);
    border-radius: var(--qpet-radius-lg);
    background: var(--qpet-white);
    box-shadow: var(--qpet-shadow-sm);
}

.qpet-card-grid {
    display: grid;
    grid-template-columns: repeat( auto-fit, minmax(min(100%, 260px), 1fr) );
    gap: var(--qpet-space-6);
}

    .qpet-card-grid > * {
        min-width: 0;
    }


/* =========================================================
   STATUS LABELS
   ========================================================= */

.qpet-status {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    max-width: 100%;
    padding: 5px 10px;
    border-radius: var(--qpet-radius-sm);
    font-size: var(--qpet-text-xs);
    font-weight: var(--qpet-weight-semibold);
    line-height: 1.4;
}

.qpet-status-success {
    color: var(--qpet-success);
    background: var(--qpet-success-bg);
}

.qpet-status-warning {
    color: var(--qpet-warning);
    background: var(--qpet-warning-bg);
}

.qpet-status-danger {
    color: var(--qpet-danger);
    background: var(--qpet-danger-bg);
}

.qpet-status-info {
    color: var(--qpet-info);
    background: var(--qpet-info-bg);
}


/* =========================================================
   RESPONSIVE MEDIA
   ========================================================= */

.qpet-media {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
}

.qpet-media-frame {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: var(--qpet-radius-lg);
}

    .qpet-media-frame > img,
    .qpet-media-frame > video {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .qpet-media-frame > iframe {
        display: block;
        width: 100%;
        height: 100%;
        border: 0;
    }


/* =========================================================
   ACCESSIBILITY
   ========================================================= */

.qpet-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.qpet-skip-link {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: var(--qpet-z-dialog);
    padding: 12px 18px;
    border-radius: var(--qpet-radius-sm);
    color: var(--qpet-white);
    background: var(--qpet-navy);
    font-family: var(--qpet-font-body);
    font-weight: var(--qpet-weight-semibold);
    transform: translateY(-160%);
}

    .qpet-skip-link:focus {
        transform: translateY(0);
        outline: 3px solid var(--qpet-focus-light);
        outline-offset: 3px;
    }


/* =========================================================
   TABLETS AND MOBILE PHONES
   ========================================================= */

@media (max-width: 767px) {

    :root {
        --qpet-header-height: 76px;
        --qpet-gutter: clamp(16px, 4vw, 24px);
    }

    .qpet-card {
        padding: var(--qpet-space-5);
    }

    .qpet-card-grid {
        gap: var(--qpet-space-4);
    }

    .qpet-form-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: var(--qpet-space-4);
    }

    .qpet-section-heading {
        margin-bottom: var(--qpet-space-6);
    }
}


/* =========================================================
   SMALL MOBILE PHONES
   ========================================================= */

@media (max-width: 480px) {

    .qpet-button-group {
        align-items: stretch;
        flex-direction: column;
    }

        .qpet-button-group > .qpet-btn {
            width: 100%;
        }

    .qpet-card {
        padding: var(--qpet-space-4);
    }
}


/* =========================================================
   REDUCED MOTION PREFERENCES
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    :root {
        --qpet-transition-fast: 0ms;
        --qpet-transition: 0ms;
    }

    .qpet-btn,
    .qpet-control,
    .qpet-skip-link {
        transition: none;
    }
}


/* QPET-GRADIENT-HEADINGS-START */

/* Signature teal -> aqua -> green heading gradient */

.public-body .qbh-home :is(h1, h2) > span,
.public-body .qpc-page :is(h1, h2) > span,
.public-body .qba-page :is(h1, h2) > span,
.public-body .qrx-page :is(h1, h2) > span {
    color: #0B6F8D;

    background-image: linear-gradient(
        100deg,
        #0B6F8D 0%,
        #2AA7C7 54%,
        #549D42 100%
    );

    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Lighter gradient for dark background sections */

.public-body .qbh-home .qbh-hero h1 > span,
.public-body .qbh-home .qbh-cta h2 > span,
.public-body .qpc-page .qpc-hero h1 > span,
.public-body .qba-page .qba-hero h1 > span,
.public-body .qba-page .qba-tethered-intro h2 > span,
.public-body .qrx-page .qrx-hero h1 > span {
    color: #B7EAF0;

    background-image: linear-gradient(
        100deg,
        #B7EAF0 0%,
        #70D6DE 52%,
        #C4EC9A 100%
    );

    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* QPET-GRADIENT-HEADINGS-END */
