/* High Society applicant form. Mobile first: one column, large touch targets, no web fonts and no
   images to wait for. Colours: the purple of the old site (#533162), with text and borders dark enough
   for WCAG 2.2 AA. No inline styles anywhere: the content security policy forbids them. */

:root {
    --brand: #533162;
    --brand-dark: #3f274c;
    --brand-tint: #f4eff7;
    --text: #1d1a22;
    --muted: #55505c;
    --border: #6b6474;
    --line: #d8d3dd;
    --error: #a33a24; /* a warm terracotta: clear, not alarming (6.6:1 on white) */
    --error-tint: #fdf6f3;
    --success: #1b6b3a;
    --success-tint: #eef7f1;
    --warning-tint: #fff7e0;
    --warning-line: #8a6100;
    --page: #ffffff;
    --measure: 40rem;
}

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

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--page);
    color: var(--text);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 1.0625rem;
    line-height: 1.5;
}

[hidden] {
    display: none !important;
}

a {
    color: var(--brand);
    text-underline-offset: 0.15em;
}

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

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

h1 {
    margin: 0 0 1rem;
    font-size: 1.75rem;
    line-height: 1.2;
}

h1:focus {
    outline: none;
}

h2 {
    margin: 0 0 0.5rem;
    font-size: 1.25rem;
    line-height: 1.3;
}

p {
    margin: 0 0 1rem;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* The box people never see (Honeypot.razor). Off screen rather than display:none, which some software skips. */
.hp {
    position: absolute;
    left: -10000px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.skip-link {
    position: absolute;
    left: 0.5rem;
    top: -10rem;
    z-index: 10;
    padding: 0.75rem 1rem;
    background: var(--page);
    color: var(--brand);
    font-weight: 600;
}

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

/* ---- Page furniture ---- */

.site-header {
    background: #ffffff;
    border-bottom: 0.25rem solid var(--brand);
}

.site-header__inner,
.site-footer__inner,
.page {
    width: 100%;
    max-width: var(--measure);
    margin: 0 auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

.site-header__inner {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.site-header__brand {
    display: inline-block;
    padding: 0.25rem 0;
    line-height: 0;
}

.site-header__brand:focus-visible {
    outline-color: var(--brand);
}

/* The standard logo, transparent, at a height that reads well on a phone and a little larger above it. */
.site-header__logo {
    display: block;
    width: auto;
    max-width: 100%;
    height: 2.25rem;
}

@media (min-width: 40em) {
    .site-header__logo {
        height: 2.75rem;
    }
}

.page {
    padding-top: 1.25rem;
    padding-bottom: 2.5rem;
}

.page:focus {
    outline: none;
}

.page__context {
    margin: 0 0 0.25rem;
    color: var(--muted);
    font-size: 1rem;
}

.lead {
    font-size: 1.125rem;
}

.hint-block {
    color: var(--muted);
}

.site-footer {
    border-top: 1px solid var(--line);
    background: var(--brand-tint);
    font-size: 1rem;
}

.site-footer__inner {
    padding-top: 1.25rem;
    padding-bottom: 1.5rem;
}

.site-footer__links {
    display: flex;
    flex-wrap: wrap;
    gap: 0 1.25rem;
    margin: 0 0 1rem;
    padding: 0;
    list-style: none;
}

.site-footer__links a {
    display: inline-block;
    padding: 0.625rem 0;
}

.site-footer__address {
    margin-bottom: 1rem;
    font-style: normal;
}

/* ---- Progress ---- */

.progress {
    margin: 0 0 1.25rem;
}

.progress__text {
    margin: 0 0 0.375rem;
    font-weight: 600;
}

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

/* On a phone the steps are a bar of six segments; their names are for screen readers only. */
.progress__step {
    flex: 1 1 0;
    height: 0.5rem;
    overflow: hidden;
    border-radius: 0.25rem;
    background: var(--line);
    color: transparent;
    font-size: 0;
}

.progress__step--done,
.progress__step--current {
    background: var(--brand);
}

.progress__step a,
.progress__step span {
    display: block;
    height: 100%;
}

.progress__step a {
    pointer-events: none;
}

@media (min-width: 46rem) {
    .progress__steps {
        gap: 0.5rem;
    }

    .progress__step {
        height: auto;
        overflow: visible;
        padding-top: 0.5rem;
        border-top: 0.375rem solid var(--line);
        border-radius: 0;
        background: none;
        color: var(--muted);
        font-size: 0.875rem;
        line-height: 1.3;
    }

    .progress__step--done,
    .progress__step--current {
        border-top-color: var(--brand);
        background: none;
    }

    .progress__step--current {
        color: var(--text);
        font-weight: 600;
    }

    .progress__step a {
        min-height: 1.5rem;
        pointer-events: auto;
    }
}

/* ---- Messages ---- */

.notice,
.warning,
.error-summary,
.panel {
    margin: 0 0 1.5rem;
    padding: 1rem;
    border-radius: 0.25rem;
}

.notice {
    border-left: 0.375rem solid var(--brand);
    background: var(--brand-tint);
}

.warning {
    border: 0.1875rem solid var(--warning-line);
    background: var(--warning-tint);
}

/* These panels take focus only from the page's script, so a screen reader reads them first; nobody can
   tab to them or act on them, so they need no focus ring (as the headings and the main area). */
.warning:focus,
.notice:focus,
.error-summary:focus {
    outline: none;
}

.warning .checkbox {
    margin-bottom: 0;
}

/* The list of answers to check: a calm note in the page's own colours, not an alarm. */
.error-summary {
    border: 1px solid var(--line);
    border-left: 0.375rem solid var(--error);
    background: var(--error-tint);
}

.error-summary__title {
    margin: 0 0 0.5rem;
    font-size: 1.125rem;
}

.error-summary__list {
    margin: 0;
    padding-left: 1.25rem;
}

.error-summary__list li {
    margin-bottom: 0.25rem;
    color: var(--text);
}

.error-summary__list li:last-child {
    margin-bottom: 0;
}

.error-summary__list a {
    color: var(--brand);
}

.panel--done {
    background: var(--success-tint);
    border-left: 0.375rem solid var(--success);
}

.panel--done h1,
.panel--done p {
    margin-bottom: 0.25rem;
}

/* ---- Fields ---- */

.form {
    margin: 0;
}

.field {
    margin: 0 0 1.5rem;
}

/* "Find address" sits under the postcode box it belongs to. */
.lookup {
    margin: -0.75rem 0 1.5rem;
}

.lookup .hint-block {
    margin: 0.5rem 0 0;
}

.lookup__choices .button {
    margin-top: 0.75rem;
}

.field--error {
    padding-left: 0.75rem;
    border-left: 0.1875rem solid var(--error);
}

.field__label,
.fieldset__legend {
    display: block;
    margin: 0 0 0.25rem;
    padding: 0;
    font-size: 1.125rem;
    font-weight: 600;
}

.field__optional {
    color: var(--muted);
    font-weight: 400;
}

.field__hint {
    margin: 0 0 0.5rem;
    color: var(--muted);
}

.field__error {
    margin: 0 0 0.5rem;
    color: var(--error);
    font-weight: 500;
}

.field__note {
    margin: 0.5rem 0 0;
    color: var(--muted);
    font-size: 1rem;
}

.field__input {
    display: block;
    width: 100%;
    min-height: 2.75rem;
    margin: 0;
    padding: 0.5rem 0.625rem;
    border: 0.125rem solid var(--border);
    border-radius: 0.25rem;
    background: #ffffff;
    color: var(--text);
    font: inherit;
    font-size: 1.0625rem;
}

.field__input--area {
    min-height: 9rem;
    resize: vertical;
}

.field__input--2 {
    width: 4.25rem;
}

.field__input--4 {
    width: 6rem;
}

.field__input--10 {
    max-width: 11rem;
}

.field__input--20 {
    max-width: 20rem;
}

.field--error .field__input,
.field__input[aria-invalid="true"] {
    border-color: var(--error);
}

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

.fieldset--group {
    margin: 0 0 1.5rem;
    padding: 1rem 1rem 0;
    border: 1px solid var(--line);
    border-radius: 0.25rem;
}

.fieldset--group .fieldset__legend {
    padding: 0 0.375rem;
}

.fieldset--group .field__label {
    font-size: 1.0625rem;
}

.date {
    display: flex;
    gap: 0.75rem;
}

.date__label {
    display: block;
    margin-bottom: 0.25rem;
}

/* ---- Tick boxes ---- */

.checkbox {
    position: relative;
    display: grid;
    grid-template-columns: 2.75rem 1fr;
    align-items: start;
    margin: 0 0 0.5rem;
}

.checkbox__input {
    width: 1.75rem;
    height: 1.75rem;
    margin: 0.5rem 0 0.5rem 0.125rem;
    accent-color: var(--brand);
}

.checkbox__label {
    display: block;
    min-height: 2.75rem;
    padding: 0.625rem 0 0.375rem;
}

.checkbox__hint {
    grid-column: 2;
    margin: 0;
}

.checkboxes--columns {
    display: grid;
    grid-template-columns: 1fr;
    column-gap: 1rem;
}

@media (min-width: 34rem) {
    .checkboxes--columns {
        grid-template-columns: 1fr 1fr;
    }
}

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

.form__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 2rem;
}

.button {
    display: inline-block;
    min-width: 8.5rem;
    min-height: 3rem;
    padding: 0.625rem 1.25rem;
    border: 0.125rem solid var(--brand);
    border-radius: 0.25rem;
    background: var(--brand);
    color: #ffffff;
    font: inherit;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
}

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

.button--secondary {
    background: #ffffff;
    color: var(--brand);
}

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

.button[disabled] {
    opacity: 0.65;
    cursor: default;
}

.link-button {
    min-height: 2.75rem;
    padding: 0.5rem 0;
    border: 0;
    background: none;
    color: var(--brand);
    font: inherit;
    text-align: left;
    text-decoration: underline;
    text-underline-offset: 0.15em;
    cursor: pointer;
}

.link-button:hover {
    color: var(--brand-dark);
}

.form--clear {
    margin-top: 1.5rem;
}

@media (max-width: 26rem) {
    .form__actions .button {
        flex: 1 1 100%;
    }
}

/* ---- Uploads ---- */

.upload__drop {
    padding: 1rem;
    border: 0.125rem dashed var(--border);
    border-radius: 0.25rem;
    background: #ffffff;
}

.upload--over .upload__drop {
    border-style: solid;
    border-color: var(--brand);
    background: var(--brand-tint);
}

.upload__input {
    display: block;
    width: 100%;
    min-height: 2.75rem;
    font: inherit;
}

.upload__drophint {
    margin: 0.5rem 0 0;
    color: var(--muted);
}

.upload__camera {
    margin-top: 0.75rem;
}

.upload__current {
    margin: 0 0 0.75rem;
    padding: 0.75rem 1rem 0.25rem;
    border-left: 0.375rem solid var(--success);
    background: var(--success-tint);
}

.upload__file {
    display: flex;
    gap: 0.5rem;
    margin: 0;
    overflow-wrap: anywhere;
}

.upload__tick {
    color: var(--success);
    font-weight: 700;
}

.upload__progress {
    display: block;
    width: 100%;
    height: 0.75rem;
    margin-top: 0.75rem;
    accent-color: var(--brand);
}

.upload__status {
    min-height: 1.5rem;
    margin: 0.375rem 0 0;
    color: var(--muted);
}

/* ---- Check your answers ---- */

.summary {
    margin: 0 0 1.5rem;
    border-top: 0.125rem solid var(--brand);
}

.summary__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 0.5rem;
}

.summary__title {
    margin: 0;
}

.summary__change {
    display: inline-block;
    padding: 0.625rem 0;
    font-weight: 600;
}

.summary__list {
    margin: 0;
}

.summary__row {
    padding: 0.625rem 0;
    border-bottom: 1px solid var(--line);
}

.summary__row dt {
    font-weight: 600;
}

.summary__row dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.summary__value {
    white-space: pre-line;
}

.summary__empty {
    color: var(--muted);
}

@media (min-width: 34rem) {
    .summary__row {
        display: grid;
        grid-template-columns: 12rem 1fr;
        gap: 1rem;
    }
}

.tag {
    display: inline-block;
    padding: 0.0625rem 0.5rem;
    border-radius: 0.25rem;
    background: var(--brand-tint);
    color: var(--brand-dark);
    font-size: 0.875rem;
    font-weight: 600;
}

.g-recaptcha,
.cf-turnstile {
    min-height: 78px;
}
