/* Public CoS page — visa2 GOV.UK layout (exact). Isolates from admin app.css. */

html:has(.cos-site),
html:has(.cos-site) body {
    color-scheme: light !important;
    background: #ffffff !important;
    background-color: #ffffff !important;
    background-image: none !important;
    background-attachment: scroll !important;
    color: #0b0c0c !important;
    font-family: "GDS Transport", Arial, Helvetica, sans-serif !important;
    line-height: 1.5 !important;
    margin: 0 !important;
    padding: 0 !important;
    min-height: 100% !important;
}

html:has(.cos-site) body > *:not(.cos-site):not(#blazor-error-ui):not(.components-reconnect-modal) {
    /* Keep Blazor chrome out of the visual layout */
}

.cos-site {
    --black: #0b0c0c;
    --white: #ffffff;
    --blue: #1d70b8;
    --blue-dark: #003078;
    --green: #00703c;
    --green-hover: #005a30;
    --focus: #ffdd00;
    --grey: #f3f2f1;
    --border: #b1b4b6;
    --mid-grey: #505a5f;
    --link: #1d70b8;
    --width: 960px;
    --font: "GDS Transport", Arial, Helvetica, sans-serif;

    box-sizing: border-box;
    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    background: var(--white);
    color: var(--black);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.cos-site *,
.cos-site *::before,
.cos-site *::after {
    box-sizing: border-box;
}

.cos-site a {
    color: var(--link);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cos-site a:hover {
    color: var(--blue-dark);
    text-decoration-thickness: 3px;
}

/* ——— Header ——— */
.cos-site .govuk-header {
    background: var(--black);
    border-bottom: 10px solid var(--blue);
}

.cos-site .govuk-header__inner {
    max-width: var(--width);
    margin: 0 auto;
    padding: 10px 15px;
    display: flex;
    align-items: center;
}

.cos-site .govuk-header__logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--white) !important;
    text-decoration: none !important;
    font-weight: 700;
    font-size: 30px;
    line-height: 1;
}

.cos-site .govuk-header__logo:hover {
    color: var(--white) !important;
    text-decoration: underline !important;
    text-decoration-thickness: 3px;
    text-underline-offset: 3px;
}

.cos-site .govuk-header__logo svg {
    width: 36px;
    height: 32px;
    fill: currentColor;
    flex-shrink: 0;
}

/* ——— Main ——— */
.cos-site main,
.cos-site .cos-main {
    flex: 1;
    width: 100%;
}

.cos-site .govuk-width {
    max-width: var(--width);
    margin: 0 auto;
    padding: 0 15px;
}

.cos-site .search-section {
    padding: 40px 0 30px;
}

.cos-site .govuk-heading-xl {
    font-size: 48px;
    font-weight: 700;
    line-height: 1.09375;
    margin: 0 0 30px;
    color: var(--black);
}

.cos-site .govuk-label {
    display: block;
    font-size: 19px;
    font-weight: 400;
    margin-bottom: 10px;
    color: var(--black);
}

.cos-site .govuk-input,
.cos-site input.govuk-input {
    display: block;
    width: 100%;
    max-width: 100%;
    font-family: inherit;
    font-size: 19px;
    line-height: 1.31579;
    padding: 5px;
    border: 2px solid var(--black);
    border-radius: 0;
    appearance: none;
    -webkit-appearance: none;
    margin: 0 0 20px;
    background: var(--white) !important;
    color: var(--black) !important;
    box-shadow: none;
}

.cos-site .govuk-input:focus,
.cos-site input.govuk-input:focus {
    outline: 3px solid var(--focus);
    outline-offset: 0;
    box-shadow: inset 0 0 0 2px;
}

.cos-site .govuk-button,
.cos-site button.govuk-button {
    display: inline-block;
    font-family: inherit;
    font-size: 19px;
    font-weight: 700;
    line-height: 1;
    color: var(--white) !important;
    background: var(--green) !important;
    border: none;
    border-radius: 0;
    box-shadow: 0 2px 0 #002d18;
    padding: 8px 10px 7px;
    min-width: 90px;
    min-height: unset;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    position: relative;
}

.cos-site .govuk-button:hover:not(:disabled),
.cos-site button.govuk-button:hover:not(:disabled) {
    background: var(--green-hover) !important;
    color: var(--white) !important;
}

.cos-site .govuk-button:focus,
.cos-site button.govuk-button:focus {
    outline: 3px solid transparent;
    box-shadow: 0 0 0 3px var(--focus);
    background: var(--focus) !important;
    color: var(--black) !important;
}

.cos-site .govuk-button:active {
    top: 2px;
    box-shadow: none;
}

.cos-site .govuk-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.cos-site .cos-result {
    display: none;
    margin-top: 25px;
    padding: 15px;
    border-left: 5px solid var(--blue);
    background: var(--grey);
    font-size: 19px;
    color: var(--black);
}

.cos-site .cos-result.is-visible,
.cos-site #result.is-visible {
    display: block;
}

.cos-site .cos-result.is-error {
    border-left-color: #d4351c;
}

.cos-site .cos-result.is-success {
    border-left-color: var(--green);
}

.cos-site .cos-result.is-pending {
    border-left-color: #f47738;
}

.cos-site .cos-result p {
    margin: 0;
}

/* ——— Content grid ——— */
.cos-site .content-section {
    border-top: 1px solid var(--border);
    padding: 40px 0 50px;
}

.cos-site .content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    align-items: start;
}

.cos-site .govuk-heading-l {
    font-size: 27px;
    font-weight: 700;
    line-height: 1.11;
    margin: 0 0 20px;
    color: var(--black);
}

.cos-site .govuk-body {
    font-size: 19px;
    margin: 0 0 20px;
    max-width: 38em;
    color: var(--black);
}

.cos-site .related {
    border-top: 2px solid var(--blue);
    padding-top: 15px;
}

.cos-site .related h2 {
    font-size: 19px;
    font-weight: 700;
    margin: 0 0 15px;
    color: var(--black);
}

.cos-site .related ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cos-site .related li {
    margin-bottom: 10px;
}

.cos-site .related a {
    color: var(--link);
    font-size: 16px;
    line-height: 1.25;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cos-site .related a:hover {
    color: var(--blue-dark);
    text-decoration-thickness: 3px;
}

.cos-site .related a:focus {
    outline: 3px solid transparent;
    background: var(--focus);
    box-shadow: 0 -2px var(--focus), 0 4px var(--black);
    color: var(--black);
    text-decoration: none;
}

/* ——— Footer ——— */
.cos-site .govuk-footer {
    background: var(--grey);
    border-top: 10px solid var(--blue);
    padding: 40px 0;
    font-size: 16px;
    color: var(--mid-grey);
    margin-top: auto;
}

.cos-site .govuk-footer__inner {
    max-width: var(--width);
    margin: 0 auto;
    padding: 0 15px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 30px;
    flex-wrap: wrap;
}

.cos-site .govuk-footer__licence {
    display: flex;
    gap: 15px;
    align-items: flex-start;
    flex: 1;
    min-width: 260px;
}

.cos-site .govuk-footer__licence svg {
    width: 41px;
    height: 17px;
    flex-shrink: 0;
    margin-top: 3px;
}

.cos-site .govuk-footer__licence p {
    max-width: 28em;
    line-height: 1.4;
    margin: 0;
    color: var(--mid-grey);
}

.cos-site .govuk-footer__licence a {
    color: inherit;
}

.cos-site .govuk-footer__copyright {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    text-align: right;
}

.cos-site .govuk-footer__copyright img {
    width: 125px;
    height: auto;
    display: block;
}

.cos-site .govuk-footer__copyright span {
    color: var(--mid-grey);
}

@media (max-width: 640px) {
    .cos-site .govuk-header__logo {
        font-size: 24px;
    }

    .cos-site .govuk-header__logo svg {
        width: 30px;
        height: 27px;
    }

    .cos-site .search-section {
        padding: 28px 0 24px;
    }

    .cos-site .govuk-heading-xl {
        font-size: 32px;
        margin-bottom: 20px;
    }

    .cos-site .govuk-label,
    .cos-site .govuk-input,
    .cos-site input.govuk-input,
    .cos-site .govuk-button,
    .cos-site .govuk-body,
    .cos-site .cos-result {
        font-size: 16px;
    }

    .cos-site .govuk-heading-l {
        font-size: 24px;
    }

    .cos-site .content-section {
        padding: 28px 0 36px;
    }

    .cos-site .content-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .cos-site .govuk-footer {
        padding: 28px 0;
    }

    .cos-site .govuk-footer__copyright {
        align-items: flex-start;
        text-align: left;
    }

    .cos-site .govuk-button,
    .cos-site button.govuk-button {
        width: 100%;
    }
}
