/* ============================================================
   UNIPLUS Formularwesen V2 — Frontend Styles
   Bootstrap 3 / 4 / 5 kompatibel
   ============================================================ */

/* ── Honeypot (für Menschen unsichtbar, NICHT display:none) ── */
.uni-fv2-hp {
    position: absolute;
    left: -9999px;
    top: -9999px;
    opacity: 0;
    height: 0;
    overflow: hidden;
    pointer-events: none;
}

/* ── Formular-Wrapper ──────────────────────────────────────── */
.uni-formular-v2 {
    position: relative;
}

/* ── Pflichtfeld-Stern ─────────────────────────────────────── */
.uni-fv2-required {
    color: #c0392b;
    margin-left: 2px;
}

/* ── Hilfetext / Subtitle ──────────────────────────────────── */
.uni-fv2-subtitle {
    display: block;
    font-size: 0.85em;
    margin-top: 2px;
    margin-bottom: 4px;
    color: #6c757d;
}

/* ── Validierungsfeedback ──────────────────────────────────── */

.uni-fv2-field .invalid-feedback {
    display: none;
}

.uni-fv2-field-error .invalid-feedback {
    display: block;
}

/* Red border on inputs and selects when field has an error */
.uni-fv2-field-error .form-control {
    border-color: #dc3545;
}

/* ── Submit / Actions ──────────────────────────────────────── */
.uni-fv2-actions {
    margin-top: 12px;
    text-align: right !important;
}

.uni-fv2-submit[disabled],
.uni-fv2-submit.loading {
    opacity: 0.65;
    cursor: not-allowed;
}

/* ── Captcha ───────────────────────────────────────────────── */
.uni-fv2-captcha {
    /* inherits mb-3 via field wrapper */
}

/* ── Headline / Trenner ────────────────────────────────────── */
.uni-fv2-headline {
    margin-top: 20px;
    margin-bottom: 4px;
}

.uni-fv2-headline__text {
    font-size: 1.1em;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 6px;
    margin-bottom: 8px;
}

/* Feldtyp "Überschrift" (ohne Trennlinie) -- sonst identisch zu "Überschrift / Trenner" */
.uni-fv2-headline--no-divider .uni-fv2-headline__text {
    border-bottom: none;
    padding-bottom: 0;
}

/* ── Hinweistext / WYSIWYG-Inhalt ─────────────────────────── */
.uni-fv2-notice {
    margin-top: 20px;
    margin-bottom: 8px;
}

.uni-fv2-notice__title {
    font-size: 1.1em;
    margin: 0 0 8px;
}

.uni-fv2-notice__content p:last-child {
    margin-bottom: 0;
}

/* ── Callout ───────────────────────────────────────────────── */
.uni-fv2-callout {
    margin-bottom: 8px;
}

/* ── Erfolgsmeldung ────────────────────────────────────────── */
.uni-fv2-success {
    margin-top: 16px;
}

/* ── Datei-Upload ──────────────────────────────────────────── */
.uni-fv2-file input[type="file"] {
    padding: 4px;
}

/* ── Radio / Checkbox: eigenstaendiges Reset + Styling ────────
   Das aktive Theme bringt kein echtes Bootstrap mit, sondern nur eine
   unvollstaendige Bootstrap-4-Nachruestung fuer die "form-check"-Klassen
   (Positionierung per rem-basiertem padding-left) PLUS eine globale,
   px-fixe Groessenerzwingung fuer alle input[type=radio|checkbox]
   innerhalb eines <form> (main.min.css: width/height 20px bzw. 24px).
   Bei aktivem html{font-size:62.5%}-Reset im Theme weichen die rem- und
   px-Werte so weit voneinander ab, dass Radio/Checkbox und Label sich
   sichtbar ueberlappen. Statt das zu flicken, wird hier komplett
   unabhaengig vom Theme neu gestylt (appearance:none + eigene
   Kreis-/Haekchen-Optik) -- funktioniert dadurch unabhaengig davon,
   welches Theme/welche Bootstrap-Teilmenge gerade aktiv ist. */
.uni-fv2-field .form-check {
    position: relative;
    display: flex;
    align-items: flex-start;
    padding-left: 0;
    margin: 0 0 8px;
}

.uni-fv2-field .form-check-input {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    position: relative;
    flex: 0 0 auto;
    box-sizing: border-box;
    width: 18px;
    height: 18px;
    margin: 2px 10px 0 0;
    border: 1px solid #999;
    background-color: #fff;
    cursor: pointer;
}

.uni-fv2-field input[type="radio"].form-check-input {
    border-radius: 50%;
}

.uni-fv2-field input[type="checkbox"].form-check-input {
    border-radius: 3px;
}

.uni-fv2-field .form-check-input:checked {
    border-color: #408fe5;
}

.uni-fv2-field input[type="radio"].form-check-input:checked::before {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #408fe5;
}

.uni-fv2-field input[type="checkbox"].form-check-input:checked {
    background-color: #408fe5;
}

.uni-fv2-field input[type="checkbox"].form-check-input:checked::after {
    content: "";
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.uni-fv2-field .form-check-input:focus-visible {
    outline: 2px solid #408fe5;
    outline-offset: 2px;
}

.uni-fv2-field .form-check-label {
    margin: 0;
    padding: 0;
    color: inherit;
    line-height: 1.4;
    cursor: pointer;
}

/* ── Bootstrap 3 Brücke: col-xs-* → col-* ─────────────────── */
/*
   Bootstrap 3 nutzt .col-xs-{n} als kleinsten Breakpoint.
   Bootstrap 4/5 nutzt .col-{n}.
   Wir geben beide Klassen aus, daher ist keine CSS-Brücke nötig —
   die jeweils nicht bekannte Klasse wird vom Browser ignoriert.
*/

/* ── Lade-Spinner beim Absenden ────────────────────────────── */
.uni-fv2-spinner {
    display: inline-block;
    width: 1em;
    height: 1em;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: uni-fv2-spin 0.75s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

@keyframes uni-fv2-spin {
    to { transform: rotate(360deg); }
}
