/* Contact form. Scoped to .ehz-contact; shares the look of the join form.
   Paragraph rules are prefixed with .ehz-contact to win over the page's .ehz-prose p { margin-bottom: 0 }. */

.ehz-contact {
    --ehz-surface: var(--ehz-shell, #fffdf9);
    --ehz-accent: var(--ehz-sea, #2f6f62);
    --ehz-radius: 12px;

    color: var(--ehz-ink);
    margin: 0 auto;
    max-width: 48rem;
}

/* The page's intro paragraph sits right above the form (.ehz-prose p has no bottom margin): give the box air. */
.ehz-prose > p + .ehz-contact,
.ehz-prose > * + .ehz-contact { margin-top: 2rem; }

.ehz-contact *,
.ehz-contact *::before,
.ehz-contact *::after {
    box-sizing: border-box;
}

.ehz-contact__heading {
    font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.25rem);
    line-height: 1.15;
    margin: 0 0 .35em;
}

.ehz-contact .ehz-contact__lead {
    color: var(--ehz-muted);
    margin: 0 0 1.5rem;
}

.ehz-contact__errors {
    background: var(--ehz-error-bg, #fdf1ee);
    border: 1px solid var(--ehz-error-line, #e0b4a8);
    border-radius: var(--ehz-radius);
    margin: 0 0 1.5rem;
    padding: 1rem 1.25rem;
}

.ehz-contact__errors p {
    font-weight: 600;
    margin: 0 0 .5rem;
}

.ehz-contact__errors ul {
    margin: 0;
    padding-left: 1.25rem;
}

.ehz-contact__errors a {
    color: inherit;
}

.ehz-contact__errors:focus {
    outline: 2px solid var(--ehz-error, #b4522f);
    outline-offset: 2px;
}

.ehz-contact__field-error {
    color: var(--ehz-error, #b4522f);
    display: block;
    font-size: .9rem;
    margin-top: .35rem;
}

.ehz-contact__input[aria-invalid="true"] {
    border-color: var(--ehz-error, #b4522f);
}

.ehz-contact__optional {
    color: var(--ehz-muted);
    font-weight: 400;
}

/* Who the message goes to, in practitioner mode. */

.ehz-contact__to {
    align-items: center;
    border-bottom: 1px solid var(--ehz-line);
    display: flex;
    gap: 1rem;
    margin: 0 0 1.25rem;
    padding: 0 0 1.25rem;
}

.ehz-contact__to-photo {
    border-radius: 50%;
    flex: 0 0 auto;
    height: 56px;
    object-fit: cover;
    width: 56px;
}

.ehz-contact__to-text {
    min-width: 0;
}

.ehz-contact__to-text p {
    margin: 0;
}

.ehz-contact__to-label {
    color: var(--ehz-muted);
    font-size: .9rem;
}

.ehz-contact__to-name {
    font-family: var(--ehz-font-display, inherit);
    font-size: 1.25rem;
    line-height: 1.3;
}

.ehz-contact__to-name a {
    color: inherit;
    text-decoration: none;
}

.ehz-contact__to-name a:hover,
.ehz-contact__to-name a:focus-visible {
    text-decoration: underline;
}

.ehz-contact__to-note {
    color: var(--ehz-muted);
    font-size: .9rem;
    margin-top: .2rem !important;
}

.ehz-contact__panel {
    background: var(--ehz-surface);
    border: 1px solid var(--ehz-line);
    border-radius: var(--ehz-radius);
    margin: 0;
    padding: 1.25rem;
}

.ehz-contact .ehz-contact__field {
    margin: 0 0 1.25rem;
}

.ehz-contact__row {
    display: grid;
    gap: 0 1rem;
    grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
}

.ehz-contact__label {
    display: block;
    font-weight: 600;
    margin-bottom: .35rem;
}

.ehz-contact__req {
    color: var(--ehz-error, #b4522f);
}

.ehz-contact__input {
    background: var(--ehz-shell, #fff);
    border: 1px solid var(--ehz-line);
    border-radius: 8px;
    color: inherit;
    display: block;
    font: inherit;
    min-height: 50px;
    padding: .6rem .75rem;
    width: 100%;
}

.ehz-contact__select {
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--ehz-muted) 50%), linear-gradient(135deg, var(--ehz-muted) 50%, transparent 50%);
    background-position: right 1.15rem center, right .85rem center;
    background-repeat: no-repeat;
    background-size: 6px 6px, 6px 6px;
    padding-right: 2.5rem;
}

.ehz-contact__textarea {
    line-height: 1.5;
    min-height: 9rem;
    resize: vertical;
}

.ehz-contact__input:focus {
    border-color: var(--ehz-accent);
    outline: 2px solid var(--ehz-accent);
    outline-offset: 1px;
}

.ehz-contact__check {
    align-items: flex-start;
    cursor: pointer;
    display: flex;
    gap: .5rem;
    line-height: 1.4;
}

.ehz-contact__check input {
    margin: .2rem 0 0;
}

.ehz-contact .ehz-contact__field--consent {
    margin-bottom: 1.5rem;
}

.ehz-contact__actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: .75rem 1rem;
    margin: 0;
}

.ehz-contact__hint {
    color: var(--ehz-muted);
    font-size: .9rem;
}

/* Under the subject select: practitioners belong to the access request form, not here. */
.ehz-contact__hint--below {
    display: block;
    margin-top: .5rem;
}

.ehz-contact__btn[aria-disabled="true"] {
    cursor: progress;
    opacity: .75;
}

.ehz-contact__btn:focus-visible {
    outline: 2px solid var(--ehz-accent);
    outline-offset: 2px;
}

/* Honeypot: off-screen, never focusable by tabbing. */

.ehz-contact__hp {
    height: 1px;
    left: -9999px;
    overflow: hidden;
    position: absolute;
    width: 1px;
}

.ehz-contact__btn {
    background: var(--ehz-accent);
    border: 1px solid var(--ehz-accent);
    border-radius: 999px;
    color: var(--ehz-on-accent, #fff);
    cursor: pointer;
    display: inline-block;
    font: inherit;
    font-weight: 600;
    min-height: 44px;
    padding: .75rem 1.6rem;
    text-align: center;
    text-decoration: none;
}

.ehz-contact__btn--ghost {
    background: transparent;
    border-color: var(--ehz-line);
    color: var(--ehz-ink);
}

@media (max-width: 40rem) {
    .ehz-contact__panel {
        padding: 1rem;
    }

    .ehz-contact__btn {
        display: block;
        width: 100%;
    }

    .ehz-contact__actions {
        align-items: stretch;
        flex-direction: column;
    }

    .ehz-contact__to {
        align-items: flex-start;
    }
}

/* "Please do not share medical details" above the message (Don, 16.10.). */
.ehz-contact__hint--warn { display: block; margin: 0 0 0.5rem; font-size: 0.9rem; color: var(--ehz-muted, inherit); }
