/* Content-sized rows, so the side column hugs its text instead of stretching to a fixed height. */
.grid { grid-auto-rows: auto; }
/* The form sits on a plain surface so the fields read as ordinary fields. */
.formtile {
    --f-bg: #dfe6ff;
    --f-text: var(--ink);
    --f-field: #fff;
    --f-line: #aab6e6;
    --f-focus: var(--cobalt);
    --f-error: #c4161c;
    --f-muted: #4b5073;
    grid-column: span 3;
    padding: clamp(1.25rem, 3vw, 2.25rem);
    background: var(--f-bg);
    color: var(--f-text);
}
@media (prefers-color-scheme: dark) {
    .formtile {
        --f-bg: #1d1d3d;
        --f-text: #fff;
        --f-field: #11112b;
        --f-line: #3b3b6b;
        --f-focus: #8da9fc;
        --f-error: #ff9d9d;
        --f-muted: #a9acc8;
    }
}
.privacy { grid-column: span 1; min-height: 0; background: var(--purple); padding: 1.25rem; }
.privacy p { font-size: 0.9375rem; line-height: 1.5; }
.privacy p:last-child { margin-bottom: 0; }
/* Light mode gets color; dark mode keeps the quiet indigo. */
.about { background: var(--yellow); color: var(--ink); }
@media (prefers-color-scheme: dark) {
    .privacy { background: #1d1d3d; }
    .about { background: #1d1d3d; color: #fff; }
}
.formtile form { max-width: 40rem; }

.field { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 1.1rem; }
.field label {
    font-family: 'EMH Mono', ui-monospace, monospace;
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.04em;
}
.field .opt { font-weight: 400; }
.field input, .field textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 2px solid var(--f-line);
    border-radius: 0.75rem;
    background: var(--f-field);
    color: var(--f-text);
    caret-color: var(--f-focus);
    font: inherit;
    font-size: 1.0625rem;
    line-height: 1.4;
}
.field textarea { resize: vertical; min-height: 9rem; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--f-focus); }
.field input.field-error, .field textarea.field-error { border-color: var(--f-error); }
.field-error-msg { color: var(--f-error); font-size: 0.9375rem; font-weight: 600; }
.field-error-msg::before { content: "! "; font-family: 'EMH Mono', ui-monospace, monospace; }
.field .opt { color: var(--f-muted); opacity: 1; }
.count { align-self: flex-end; color: var(--f-muted); font-family: 'EMH Mono', ui-monospace, monospace; font-size: 0.8125rem; font-variant-numeric: tabular-nums; }
.count.near-limit { color: var(--f-error); font-weight: 700; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.form-error {
    margin: 0 0 1rem;
    padding: 0.8rem 1rem;
    border: 2px solid var(--f-error);
    border-radius: 0.75rem;
    color: var(--f-error);
    font-weight: 600;
}
#turnstileContainer { margin: 0 0 1.1rem; min-height: 65px; }

.send {
    padding: 0.9rem 1.75rem;
    border: 0;
    border-radius: 0.75rem;
    background: var(--cobalt);
    color: #fff;
    font: inherit;
    font-size: 1.0625rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s;
}
.send:hover { background: #1a1ab8; }
.send:focus-visible { outline: 2px solid var(--f-focus); outline-offset: 3px; }
.send:disabled { opacity: 0.6; cursor: progress; }
@media (prefers-color-scheme: dark) {
    .send { background: #8da9fc; color: var(--ink); }
    .send:hover { background: #a8bdfd; }
}
.nojs { margin-top: 1rem; }

.form-success { padding: 1rem 0 0.5rem; }
.form-success svg { width: 4rem; height: 4rem; color: var(--f-focus); }
.form-success h2 { margin: 0.75rem 0 0.25rem; font-size: clamp(2rem, 6vw, 3.25rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.form-success p { margin: 0; font-size: 1.125rem; }

@media (max-width: 52rem) {
    .formtile, .privacy { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) {
    .send { transition: none; }
}
