/**
 * Seasonal Video contact form: [seasonal_contact].
 *
 * Sits on the page it is given: text colour and font are inherited, and the
 * fields and the card are tinted from the text colour, so the same rules read
 * on a dark theme and a light one.
 *
 * A theme restyles it by setting these on html:root. The accent falls back to
 * the sign-in modal's, which each theme already sets.
 *
 *   --sv-contact-primary       button and focus ring
 *   --sv-contact-on-primary    button text
 *   --sv-contact-field-bg      inputs
 *   --sv-contact-field-border  inputs and the card's outline
 *   --sv-contact-card-bg       the "who makes this" card
 *   --sv-contact-accent        the card's left edge
 *   --sv-contact-muted         hints and small print
 *   --sv-contact-error         error text
 *   --sv-contact-radius        corners
 *   --sv-contact-width         widest the form gets (640px)
 */
.sv-contact {
    --_primary: var(--sv-contact-primary, var(--sv-login-primary, #1b5e20));
    --_on-primary: var(--sv-contact-on-primary, var(--sv-login-on-primary, #ffffff));
    --_field-bg: var(--sv-contact-field-bg, rgba(127, 127, 127, 0.12));
    --_field-border: var(--sv-contact-field-border, rgba(127, 127, 127, 0.45));
    --_card-bg: var(--sv-contact-card-bg, rgba(127, 127, 127, 0.1));
    --_accent: var(--sv-contact-accent, var(--_primary));
    --_muted: var(--sv-contact-muted, currentColor);
    --_error: var(--sv-contact-error, #ef4444);
    --_radius: var(--sv-contact-radius, 8px);

    /* Left edge on the page's own, so it lines up under the page title. */
    max-width: var(--sv-contact-width, 640px);
    margin: 0;
    text-align: left;
}

/* [seasonal_contact align="center"], for a theme that centres its page title. */
.sv-contact.sv-contact--center {
    margin-left: auto;
    margin-right: auto;
}

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

/* Who makes this */
.sv-contact__founder {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin: 0 0 28px;
    padding: 20px;
    background: var(--_card-bg);
    border-left: 4px solid var(--_accent);
    border-radius: var(--_radius);
}

.sv-contact .sv-contact__photo {
    flex: 0 0 72px;
    width: 72px;
    height: 72px;
    margin: 0;
    border-radius: 50%;
    object-fit: cover;
}

.sv-contact .sv-contact__founder-title {
    margin: 0 0 6px;
    font-size: 1.05em;
    font-weight: 600;
}

.sv-contact .sv-contact__founder-text {
    margin: 0;
    font-size: 0.95em;
    line-height: 1.55;
}

/* The form */
.sv-contact__form {
    display: grid;
    gap: 18px;
    margin: 0;
}

.sv-contact__row {
    display: grid;
    gap: 18px;
}

@media (min-width: 560px) {
    .sv-contact__row {
        grid-template-columns: 1fr 1fr;
    }
}

.sv-contact__field label {
    display: block;
    margin: 0 0 6px;
    font-size: 0.95em;
    font-weight: 600;
}

.sv-contact__optional {
    font-weight: 400;
    opacity: 0.7;
}

.sv-contact__field input,
.sv-contact__field textarea {
    display: block;
    width: 100%;
    margin: 0;
    padding: 12px 14px;
    font: inherit;
    /* 16px or more, or iOS zooms the page when a field is focused. */
    font-size: max(16px, 1em);
    line-height: 1.4;
    color: inherit;
    background: var(--_field-bg);
    border: 1px solid var(--_field-border);
    border-radius: var(--_radius);
    appearance: none;
}

.sv-contact__field textarea {
    min-height: 9em;
    resize: vertical;
}

.sv-contact__field input:focus-visible,
.sv-contact__field textarea:focus-visible {
    outline: 2px solid var(--_primary);
    outline-offset: 1px;
    border-color: var(--_primary);
}

.sv-contact__field [aria-invalid="true"] {
    border-color: var(--_error);
}

.sv-contact .sv-contact__hint,
.sv-contact .sv-contact__small {
    margin: 6px 0 0;
    font-size: 0.85em;
    line-height: 1.5;
    color: var(--_muted);
    opacity: 0.8;
}

.sv-contact .sv-contact__small {
    margin: 0;
}

.sv-contact .sv-contact__small a {
    color: inherit;
    text-decoration: underline;
}

.sv-contact .sv-contact__error {
    margin: 0;
    font-size: 0.95em;
    font-weight: 600;
    color: var(--_error);
}

.sv-contact .sv-contact__error a {
    color: inherit;
}

.sv-contact .sv-contact__submit {
    justify-self: start;
    min-height: 48px;
    padding: 12px 28px;
    font: inherit;
    font-weight: 600;
    color: var(--_on-primary);
    background: var(--_primary);
    border: 0;
    border-radius: var(--_radius);
    cursor: pointer;
}

.sv-contact .sv-contact__submit:hover {
    filter: brightness(1.08);
}

.sv-contact .sv-contact__submit:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.sv-contact .sv-contact__submit:disabled {
    opacity: 0.6;
    cursor: default;
}

/* Sent */
.sv-contact__sent {
    padding: 24px;
    background: var(--_card-bg);
    border-left: 4px solid var(--_accent);
    border-radius: var(--_radius);
}

.sv-contact__sent:focus {
    outline: none;
}

.sv-contact .sv-contact__sent-title {
    margin: 0 0 6px;
    font-size: 1.2em;
    font-weight: 600;
}

.sv-contact .sv-contact__sent p:last-child {
    margin-bottom: 0;
}

/* The author's display rules above would otherwise beat the attribute. */
.sv-contact [hidden] {
    display: none !important;
}

/* Not for people. Off-screen rather than display:none, which some bots skip. */
.sv-contact__trap {
    position: absolute !important;
    left: -9999px !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
}
