/* Boinx Forms — default styling (plugin v1.0)
 *
 * Every visual decision is a custom property on .bxf, so a page (or the kit)
 * can restyle a form by overriding tokens instead of fighting selectors:
 *
 *   .my-section .bxf { --bxf-accent: #E93CAC; --bxf-radius: 4px; }
 *
 * theme="dark" (or the auto-detected .bxf--dark) swaps the neutral tokens;
 * the accent stays brand green in both. All rules are scoped under .bxf and
 * written as .bxf .bxf-* so they outrank the Elementor kit's element rules
 * (e.g. `.elementor-kit-8 button`).
 */

.bxf {
    --bxf-accent: #1EB268;
    --bxf-accent-hover: #16B666;
    --bxf-on-accent: #ffffff;
    --bxf-text: #1a1a1a;
    --bxf-muted: rgba(26, 26, 26, 0.62);
    --bxf-field-bg: #ffffff;
    --bxf-field-border: rgba(26, 26, 26, 0.28);
    --bxf-field-text: #1a1a1a;
    --bxf-radius: 12px;
    --bxf-gap: 28px;
    --bxf-error: #d02b40;
    --bxf-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%23888888' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");

    color: var(--bxf-text);
    max-width: 100%;
}

.bxf--dark {
    --bxf-text: #ffffff;
    --bxf-muted: rgba(255, 255, 255, 0.65);
    --bxf-field-bg: rgba(255, 255, 255, 0.07);
    --bxf-field-border: rgba(255, 255, 255, 0.25);
    --bxf-field-text: #ffffff;
    --bxf-error: #fd6a7c;
    --bxf-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%23bbbbbb' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}

/* ---- links inside feed copy (privacy label, header, appendix) --------- */

.bxf a { color: var(--bxf-accent); text-decoration: underline; }
.bxf a:hover { color: var(--bxf-text); }

/* ---- header / copy blocks -------------------------------------------- */

.bxf .bxf-header img { width: 64px; height: auto; margin-bottom: 12px; }
.bxf .bxf-header h1,
.bxf .bxf-header h2 { margin: 0.4em 0 0.5em; color: var(--bxf-text); font-size: 28px; line-height: 1.4; }
.bxf .bxf-header p { color: var(--bxf-muted); }
.bxf .bxf-header p:empty { display: none; }
.bxf .bxf-header { margin-bottom: 30px; }
.bxf .bxf-header p,
.bxf .bxf-parenthesis p,
.bxf .bxf-appendix p { margin: 0 0 1em; }
.bxf .bxf-parenthesis { color: var(--bxf-muted); }
.bxf .bxf-appendix { margin-top: 24px; color: var(--bxf-muted); font-size: 0.9em; }
.bxf .bxf-appendix small { display: block; margin-top: 6px; opacity: 0.8; }

/* ---- form skeleton ---------------------------------------------------- */

.bxf .bxf-form {
    display: flex;
    flex-direction: column;
    gap: var(--bxf-gap);
    margin: 0;
}

.bxf .bxf-q { min-width: 0; }

/* Divider between one question and the next (not inside the contact grid). */
.bxf .bxf-form > .bxf-q + .bxf-q,
.bxf .bxf-form > .bxf-q + .bxf-parenthesis,
.bxf .bxf-form > .bxf-q + .bxf-contact {
    border-top: 1px solid var(--bxf-field-border);
    padding-top: calc(var(--bxf-gap) - 6px);
}

.bxf .bxf-q-title {
    display: block;
    font-weight: 600;
    line-height: 1.4;
    margin: 0 0 8px;
}

.bxf .bxf-req { color: var(--bxf-accent); margin-left: 3px; font-weight: 700; }

.bxf .bxf-q-comment {
    margin: -4px 0 10px;
    font-size: 0.875em;
    color: var(--bxf-muted);
}

/* ---- text-like controls ----------------------------------------------- */

.bxf .bxf-control {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    background: var(--bxf-field-bg);
    border: 1px solid var(--bxf-field-border);
    border-radius: var(--bxf-radius);
    color: var(--bxf-field-text);
    font: inherit;
    font-size: max(16px, 1em); /* keeps iOS from zooming into the field */
    line-height: 1.4;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.bxf .bxf-control:focus {
    outline: none;
    border-color: var(--bxf-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--bxf-accent) 25%, transparent);
}

.bxf textarea.bxf-control { resize: vertical; min-height: 120px; }

.bxf select.bxf-control {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 42px;
    background-image: var(--bxf-chevron);
    background-repeat: no-repeat;
    background-position: right 16px center;
    cursor: pointer;
}

.bxf--dark select.bxf-control option { color: #1a1a1a; background: #ffffff; }

/* ---- choice controls --------------------------------------------------- */

.bxf .bxf-choices { display: flex; flex-direction: column; gap: 4px; }
.bxf .bxf-choices--inline { flex-direction: row; gap: 24px; }

.bxf .bxf-choice {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 5px 0;
    cursor: pointer;
    line-height: 1.45;
    font-weight: 400;
}

.bxf input[type="radio"],
.bxf input[type="checkbox"] {
    accent-color: var(--bxf-accent);
    width: 18px;
    height: 18px;
    margin: 2px 0 0;
    flex: none;
    cursor: pointer;
}

/* Separator WITHIN an option list (the feed's {separator:true} rows). Kept
 * short and faint so it groups options instead of reading as a question
 * divider — full question dividers are the .bxf-q + .bxf-q rule above. */
.bxf .bxf-sep {
    border: 0;
    border-top: 1px solid var(--bxf-field-border);
    margin: 10px auto 10px 0;
    width: min(240px, 70%);
    opacity: 0.55;
}

.bxf .bxf-other {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    color: var(--bxf-muted);
}
.bxf .bxf-other .bxf-control { flex: 1; }

/* ---- grade-scale grid (schulnoten) ------------------------------------ */

.bxf .bxf-scale { overflow-x: auto; }

.bxf .bxf-scale-row {
    display: grid;
    grid-template-columns: minmax(130px, 1fr) repeat(5, 36px);
    align-items: center;
    gap: 4px 10px;
    padding: 4px 0;
}

.bxf .bxf-scale-head { color: var(--bxf-muted); font-size: 0.875em; }
.bxf .bxf-scale-num { text-align: center; }
.bxf .bxf-scale-cell { display: flex; justify-content: center; cursor: pointer; }
.bxf .bxf-scale-label { padding-right: 6px; }

.bxf .bxf-scale-row-select {
    display: grid;
    grid-template-columns: minmax(130px, 1fr) minmax(120px, 220px);
    align-items: center;
    gap: 10px;
    padding: 4px 0;
}

/* ---- contact block ----------------------------------------------------- */

.bxf .bxf-contact {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--bxf-gap) 24px;
}

.bxf .bxf-contact-field--wide { grid-column: 1 / -1; }
.bxf .bxf-consent { font-size: 0.9em; }
.bxf .bxf-consent a { color: var(--bxf-accent); text-decoration: underline; }

@media (max-width: 640px) {
    .bxf .bxf-contact { grid-template-columns: 1fr; }
    .bxf .bxf-choices--inline { flex-direction: column; gap: 4px; }
}

/* ---- submit / status --------------------------------------------------- */

.bxf .bxf-submit {
    align-self: center;
    min-width: 220px;
    padding: 14px 36px;
    background-color: var(--bxf-accent);
    color: var(--bxf-on-accent);
    border: 0;
    border-radius: 999px;
    font: inherit;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.1s ease;
}

.bxf .bxf-submit:hover { background-color: var(--bxf-accent-hover); }
.bxf .bxf-submit:active { transform: scale(0.98); }
.bxf .bxf-submit[disabled] { opacity: 0.6; cursor: default; transform: none; }

.bxf .bxf-status {
    border: 1px solid var(--bxf-error);
    color: var(--bxf-error);
    background: color-mix(in srgb, var(--bxf-error) 8%, transparent);
    border-radius: var(--bxf-radius);
    padding: 12px 16px;
}

.bxf .bxf-success {
    border: 1px solid var(--bxf-accent);
    border-radius: var(--bxf-radius);
    padding: 20px 24px;
}
.bxf .bxf-success p { margin: 0; }
.bxf .bxf-error-inline { color: var(--bxf-error); }

/* ---- utilities --------------------------------------------------------- */

/* Honeypot: visually gone, still in the accessibility-hidden DOM for bots. */
.bxf .bxf-hp {
    position: absolute !important;
    left: -9999px !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.bxf .bxf-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}
