/* AmeriFind Privacy: the DCS privacy centre. Self-hosted type, no inline styles (the Content Security
   Policy forbids them), no scripts of our own.

   Layout: a sticky white header over a light canvas; content in a 1200px column. The policy reads in a
   prose column beside a sticky table of contents; forms sit in a card with paired fields side by side.

   Colours (contrast against the surface they sit on):
     #00539f  DCS blue     7.9:1 on white    links, buttons, focus
     #15202e  ink         16.3:1 on white    text
     #4b5a6b  ink-2        7.0:1 on white    hints, secondary text
     #b42318  danger       6.4:1 on white    errors
     #ffffff  on navy     15.0:1 on #0e2541  footer text
*/

@font-face {
    font-family: "Public Sans";
    src: url("../fonts/public-sans-latin-wght-normal.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Public Sans";
    src: url("../fonts/public-sans-latin-wght-italic.woff2") format("woff2");
    font-weight: 100 900;
    font-style: italic;
    font-display: swap;
}

:root {
    --brand: #00539f;
    --brand-dark: #003d75;
    --brand-tint: #eaf2fb;
    --brand-tint-strong: #d6e6f6;
    --navy: #0e2541;
    --navy-2: #17345a;
    --ink: #15202e;
    --ink-2: #4b5a6b;
    --line: #e1e6ed;
    --line-strong: #c3ccd7;
    --canvas: #f5f7fa;
    --surface: #ffffff;
    --danger: #b42318;
    --danger-tint: #fef3f2;
    --notice: #fff8e6;
    --notice-line: #e7c46a;

    --font: "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --header-height: 72px;
    --radius: 10px;
    --radius-sm: 7px;
    --shadow: 0 1px 2px rgb(16 32 56 / 6%), 0 4px 16px rgb(16 32 56 / 6%);
}

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

html {
    font-size: 100%;
    -webkit-text-size-adjust: 100%;
    scroll-padding-top: calc(var(--header-height) + 16px);
}

body {
    margin: 0;
    font-family: var(--font);
    font-size: 1.0625rem;
    line-height: 1.65;
    color: var(--ink);
    background: var(--canvas);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: "kern", "liga";
    /* A long URL or email address must wrap rather than push the page wider than a phone. */
    overflow-wrap: break-word;
}

.container {
    max-width: 75rem;
    margin: 0 auto;
    padding-left: max(1rem, env(safe-area-inset-left, 0px));
    padding-right: max(1rem, env(safe-area-inset-right, 0px));
}

@media (min-width: 48rem) {
    .container {
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

/* ---- Typography -------------------------------------------------------- */

h1,
h2,
h3 {
    color: var(--ink);
    text-wrap: balance;
    letter-spacing: -0.015em;
}

h1 {
    font-size: clamp(1.875rem, 1.4rem + 1.6vw, 2.5rem);
    line-height: 1.15;
    font-weight: 750;
    margin: 0 0 0.75rem;
}

h2 {
    font-size: 1.5rem;
    line-height: 1.25;
    font-weight: 700;
    margin: 2.75rem 0 0.875rem;
}

h3 {
    font-size: 1.125rem;
    line-height: 1.35;
    font-weight: 650;
    margin: 1.75rem 0 0.5rem;
}

p {
    margin: 0 0 1rem;
}

ul,
ol {
    margin: 0 0 1rem;
    padding-left: 1.4rem;
}

li {
    margin-bottom: 0.35rem;
}

li::marker {
    color: var(--ink-2);
}

strong {
    font-weight: 650;
}

a {
    color: var(--brand);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;
}

a:hover {
    color: var(--brand-dark);
    text-decoration-thickness: 2px;
}

code {
    font-size: 0.95em;
    overflow-wrap: anywhere;
}

.lede {
    font-size: 1.125rem;
    color: var(--ink-2);
    max-width: 62ch;
}

/* ---- Focus and skip link ---------------------------------------------- */

:focus-visible {
    outline: 3px solid var(--brand);
    outline-offset: 2px;
    border-radius: 3px;
}

main:focus {
    outline: none;
}

.skip-link {
    position: absolute;
    left: 1rem;
    top: -4rem;
    z-index: 100;
    padding: 0.6rem 1rem;
    background: var(--surface);
    color: var(--brand);
    font-weight: 650;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
}

.skip-link:focus {
    top: 0.75rem;
}

/* ---- Header (sticky) ---------------------------------------------------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgb(255 255 255 / 96%);
    border-bottom: 1px solid var(--line);
    backdrop-filter: saturate(1.2) blur(8px);
}

.header-inner {
    min-height: var(--header-height);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1.5rem;
    padding-block: 0.5rem;
}

.logo-link {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--ink);
    text-decoration: none;
}

.logo-link img {
    display: block;
    width: 84px;
    height: auto;
}

.logo-link .site-name {
    font-weight: 650;
    font-size: 0.95rem;
    letter-spacing: -0.005em;
    padding-left: 0.75rem;
    border-left: 1px solid var(--line-strong);
    color: var(--ink-2);
}

.nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.nav-list li {
    margin: 0;
}

.site-header .nav-list a {
    display: inline-block;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    color: var(--ink);
    font-size: 0.95rem;
    font-weight: 550;
    text-decoration: none;
}

.site-header .nav-list a:hover {
    background: var(--canvas);
    color: var(--brand-dark);
}

.site-header .nav-list a[aria-current="page"] {
    background: var(--brand-tint);
    color: var(--brand-dark);
}

.site-header .nav-list a.nav-cta {
    background: var(--brand);
    color: #ffffff;
}

.site-header .nav-list a.nav-cta:hover {
    background: var(--brand-dark);
    color: #ffffff;
}

/* ---- Main ------------------------------------------------------------- */

main {
    padding-block: 2.5rem 4.5rem;
}

main > p,
main > ul,
main > ol {
    max-width: 68ch;
}

/* The page intro above a form or a policy. */
.page-intro {
    max-width: 52rem;
    margin-bottom: 2rem;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

/* The request instructions at the top of the policy: the page the data broker registry links to must display
   them prominently. */
.request-box {
    margin-top: 1.5rem;
    padding: 1.25rem 1.5rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.request-box h2 {
    margin: 0 0 0.5rem;
    font-size: 1.15rem;
}

.request-box ul {
    margin: 0;
    padding-left: 1.25rem;
}

.request-box li + li {
    margin-top: 0.35rem;
}

/* ---- Policy: table of contents beside the text ------------------------- */

.policy-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
}

@media (min-width: 64rem) {
    .policy-layout {
        grid-template-columns: 15rem minmax(0, 1fr);
        gap: 3.5rem;
        align-items: start;
    }
}

.contents {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.1rem 1.25rem;
}

@media (min-width: 64rem) {
    .contents {
        position: sticky;
        top: calc(var(--header-height) + 1.5rem);
        max-height: calc(100vh - var(--header-height) - 3rem);
        overflow-y: auto;
        background: transparent;
        border: 0;
        padding: 0;
    }
}

.contents h2 {
    margin: 0 0 0.6rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-2);
}

.contents ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.1rem;
}

.contents li {
    margin: 0;
}

.contents a {
    display: block;
    padding: 0.35rem 0.75rem;
    border-left: 2px solid var(--line);
    color: var(--ink-2);
    font-size: 0.925rem;
    line-height: 1.4;
    text-decoration: none;
}

.contents a:hover {
    color: var(--brand-dark);
    border-left-color: var(--brand);
}

.policy-body {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 2rem clamp(1.25rem, 3vw, 2.75rem) 1rem;
    box-shadow: var(--shadow);
}

.policy-body > section:first-child h2 {
    margin-top: 0;
}

.policy-body section + section {
    border-top: 1px solid var(--line);
    margin-top: 2.25rem;
}

.policy-body section + section h2 {
    margin-top: 2.25rem;
}

/* The rights section is the one people come for: set it apart. */
.policy-body section.rights {
    background: var(--brand-tint);
    border-top: 0;
    border-radius: var(--radius);
    margin-inline: calc(-1 * clamp(0.5rem, 1.5vw, 1.25rem));
    padding: 0.25rem clamp(0.5rem, 1.5vw, 1.25rem) 0.5rem;
}

.policy-body section.rights + section {
    border-top: 0;
}

.contacts {
    list-style: none;
    padding: 0;
}

/* ---- Preview banner ------------------------------------------------------ */

.preview-banner {
    background: var(--notice);
    border-bottom: 1px solid var(--notice-line);
    padding: 0.6rem 0;
    font-weight: 600;
    font-size: 0.95rem;
    text-align: center;
}

/* ---- Notice (data broker) ---------------------------------------------- */

.notice {
    background: var(--notice);
    border: 1px solid var(--notice-line);
    border-radius: var(--radius-sm);
    padding: 1rem 1.25rem;
}

.notice .notice-text,
p.notice {
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.01em;
    line-height: 1.55;
}

/* ---- Buttons ------------------------------------------------------------ */

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 2.875rem;
    padding: 0.65rem 1.4rem;
    font: inherit;
    font-size: 1rem;
    font-weight: 650;
    line-height: 1.2;
    color: #ffffff;
    background: var(--brand);
    border: 1px solid var(--brand);
    border-radius: var(--radius-sm);
    text-decoration: none;
    cursor: pointer;
}

.button:hover {
    color: #ffffff;
    background: var(--brand-dark);
    border-color: var(--brand-dark);
}

.button:disabled,
.button:disabled:hover {
    color: var(--ink-2);
    background: var(--line);
    border-color: var(--line-strong);
    cursor: not-allowed;
}

.button.secondary {
    color: var(--brand-dark);
    background: var(--surface);
    border-color: var(--line-strong);
}

.button.secondary:hover {
    background: var(--brand-tint);
    border-color: var(--brand);
}

/* ---- Forms ------------------------------------------------------------- */

.form-card {
    max-width: 56rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: clamp(1.25rem, 3vw, 2.25rem);
    box-shadow: var(--shadow);
}

.form-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0 1.5rem;
}

@media (min-width: 45rem) {
    .form-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.form-group {
    margin-bottom: 1.5rem;
}

fieldset {
    border: 0;
    margin: 0;
    padding: 0;
    min-width: 0;
}

legend,
.form-group > label {
    display: block;
    font-weight: 650;
    font-size: 1rem;
    margin-bottom: 0.3rem;
    padding: 0;
}

/* Hints sit below their input, the same on every form. */
.hint {
    margin: 0.4rem 0 0;
    color: var(--ink-2);
    font-size: 0.925rem;
}

input[type="text"],
input[type="email"],
select,
textarea {
    display: block;
    width: 100%;
    min-height: 2.875rem;
    padding: 0.6rem 0.8rem;
    font: inherit;
    font-size: 1rem;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    box-shadow: inset 0 1px 1px rgb(16 32 56 / 4%);
}

input[type="text"]:hover,
input[type="email"]:hover,
select:hover,
textarea:hover {
    border-color: #9eabba;
}

input[type="text"]:focus,
input[type="email"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-tint-strong);
}

textarea {
    min-height: 8rem;
    resize: vertical;
}

[aria-invalid="true"] {
    border-color: var(--danger) !important;
}

/* Choices: each check box or radio is a selectable row. */
.choices {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.6rem;
}

@media (min-width: 45rem) {
    .choices.two-up {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.choice {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 0.9rem;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
}

.choice:hover {
    border-color: var(--brand);
}

.choice:has(input:checked) {
    border-color: var(--brand);
    background: var(--brand-tint);
}

.choice:has(input:focus-visible) {
    outline: 3px solid var(--brand);
    outline-offset: 2px;
}

.choice input {
    flex: none;
    width: 1.2rem;
    height: 1.2rem;
    margin: 0.2rem 0 0;
    accent-color: var(--brand);
}

.choice input:focus-visible {
    outline: none;
}

.choice label {
    flex: 1;
    cursor: pointer;
}

/* The label covers the whole row, so the row is the target. */
.choice label::after {
    content: "";
    position: absolute;
    inset: 0;
}

.field-error {
    margin: 0.4rem 0 0.5rem;
    color: var(--danger);
    font-weight: 600;
    font-size: 0.925rem;
}

.error-summary {
    max-width: 56rem;
    margin: 0 0 1.5rem;
    padding: 1rem 1.25rem;
    background: var(--danger-tint);
    border: 1px solid #f4b9b2;
    border-left: 4px solid var(--danger);
    border-radius: var(--radius-sm);
}

.error-summary h2 {
    margin: 0 0 0.4rem;
    font-size: 1.05rem;
    color: var(--danger);
}

.error-summary ul {
    margin: 0;
}

.error-summary p {
    margin: 0;
}

.error-summary a {
    color: var(--danger);
    font-weight: 600;
}

.form-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--line);
}

.form-footer .hint {
    margin: 0;
}

/* ---- Confirmation summary -------------------------------------------- */

.summary {
    max-width: 56rem;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    margin: 0 0 1.5rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

@media (min-width: 40rem) {
    .summary {
        grid-template-columns: 13rem minmax(0, 1fr);
    }
}

.summary dt,
.summary dd {
    margin: 0;
    padding: 0.8rem 1.25rem;
    border-bottom: 1px solid var(--line);
}

.summary dt {
    color: var(--ink-2);
    font-size: 0.925rem;
    font-weight: 600;
    background: var(--canvas);
}

.summary dt:last-of-type,
.summary dd:last-child {
    border-bottom: 0;
}

.summary ul {
    margin: 0;
    padding-left: 1.2rem;
}

.preserve-lines {
    white-space: pre-line;
}

/* ---- Footer ----------------------------------------------------------- */

.site-footer {
    background: var(--navy);
    color: #d9e2ee;
    padding-block: 2.75rem 2rem;
    font-size: 0.95rem;
}

.site-footer a {
    color: #ffffff;
}

.footer-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
}

@media (min-width: 56rem) {
    .footer-grid {
        grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
        gap: 3.5rem;
    }
}

.site-footer .notice {
    background: var(--navy-2);
    border: 1px solid #36557f;
    color: #ffffff;
}

.site-footer .notice h2 {
    margin: 0 0 0.5rem;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #b9cbe2;
}

.site-footer .notice p {
    margin: 0 0 0.75rem;
}

.site-footer .notice p:last-child {
    margin-bottom: 0;
}

.site-footer .nav-list {
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 1.25rem;
}

.site-footer .nav-list a {
    text-decoration: none;
    font-weight: 550;
}

.site-footer .nav-list a:hover {
    text-decoration: underline;
}

.copyright {
    margin: 2rem 0 0;
    padding-top: 1.25rem;
    border-top: 1px solid #2a4569;
    color: #a9bbd2;
    font-size: 0.875rem;
}

/* ---- Small screens ------------------------------------------------------ */

@media (max-width: 40rem) {
    :root {
        --header-height: 108px;
    }

    main {
        padding-block: 1.75rem 3rem;
    }

    .logo-link .site-name {
        display: none;
    }

    .site-header .nav-list a {
        padding: 0.4rem 0.6rem;
        font-size: 0.9rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }

    .site-header .nav-list a,
    .contents a,
    .button,
    .choice {
        transition: background-color 120ms, border-color 120ms, color 120ms;
    }
}

@media (forced-colors: active) {
    .button,
    .choice,
    .notice,
    .error-summary {
        border: 1px solid CanvasText;
    }
}
