/* ============================================================
   components/forms.css — Public-Formular-Klassen (0.1.3.1)
   ------------------------------------------------------------
   Hotfix 0.1.3.1: box-sizing: border-box auf allen Form-Controls,
   damit width:100% inkl. Padding im Container bleibt (vorher
   ragten Input/Select/Textarea auf Smartphones aus der Card).
============================================================ */

/* ----------------------------------------------------------------
   Form als Block — vertikale Trennung der Felder
   ---------------------------------------------------------------- */
.pub-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.pub-form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.pub-form-row > .pub-field {
    flex: 1 1 220px;
    min-width: 0;
}

/* ----------------------------------------------------------------
   Field — Label + Input zusammen
   ---------------------------------------------------------------- */
.pub-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pub-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--pub-text);
}

.pub-label .pub-required {
    color: var(--pub-danger);
    font-weight: 700;
}

.pub-help {
    font-size: 0.82rem;
    color: var(--pub-text-muted);
}

/* ----------------------------------------------------------------
   Input / Select / Textarea — einheitliche Optik
   0.1.3.1: box-sizing FIX. width:100% + padding 24px schlugen
   auf Mobile durch (Inputs ragten aus der Card).
   ---------------------------------------------------------------- */
.pub-input,
.pub-select,
.pub-textarea {
    box-sizing: border-box;
    width: 100%;
    min-height: var(--pub-control-height);
    padding: 8px 12px;
    font: inherit;
    color: var(--pub-text);
    background: var(--pub-bg-surface);
    border: 1px solid var(--pub-border-strong);
    border-radius: var(--pub-radius-sm);
    transition: border-color var(--pub-transition),
                box-shadow var(--pub-transition);
}

.pub-input:focus,
.pub-select:focus,
.pub-textarea:focus {
    outline: none;
    border-color: var(--pub-brand);
    box-shadow: 0 0 0 3px rgba(107, 79, 43, 0.15);
}

.pub-input:disabled,
.pub-select:disabled,
.pub-textarea:disabled {
    background: var(--pub-bg-subtle);
    color: var(--pub-text-muted);
    cursor: not-allowed;
}

.pub-textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.5;
}

.pub-select { padding-right: 32px; }

/* Hilfetexte unterhalb eines Inputs */
.pub-help-block {
    display: block;
    margin-top: 2px;
    color: var(--pub-text-muted);
    font-size: 0.82rem;
    line-height: 1.4;
}

/* ----------------------------------------------------------------
   Checkbox-Label — Inline-Layout
   ---------------------------------------------------------------- */
.pub-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    color: var(--pub-text);
    cursor: pointer;
    user-select: none;
}

.pub-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--pub-brand);
    cursor: pointer;
}

/* ----------------------------------------------------------------
   Honeypot — visuell + AT-relevant unsichtbar
   ---------------------------------------------------------------- */
.pub-honeypot {
    position: absolute;
    left: -10000px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ----------------------------------------------------------------
   Form-Actions — Submit unten, optional rechtsbündig
   ---------------------------------------------------------------- */
.pub-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-top: 8px;
}

.pub-form-actions--end { justify-content: flex-end; }

.pub-form-actions--spread { justify-content: space-between; }

/* ----------------------------------------------------------------
   Mobile-Anpassungen
   ---------------------------------------------------------------- */
@media (max-width: 480px) {
    .pub-input,
    .pub-select,
    .pub-textarea {
        font-size: 16px;   /* verhindert iOS-Auto-Zoom beim Fokus */
    }
}
