/* components/forms.css */

.form-group {
    margin-bottom: 1.2rem;
}

.form-label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--color-text);
}

/* Vollbreites Formularelement (z.B. in Modals, Verwaltungsseiten) */
.form-control {
    width: 100%;
    height: 50px;
    padding: 0.5rem 0.7rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    background-color: var(--color-white);
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px var(--color-primary-focus);
}

textarea.form-control {
    height: auto;
    min-height: 80px;
    resize: vertical;
    line-height: 1.4;
}

/* Begrenztes Formularelement (z.B. in Listen, schmaleren Bereichen) */
.form-input {
    width: 100%;
    max-width: 400px;
    padding: 0.6rem 0.8rem;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    background-color: var(--color-bg-secondary);
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
    display: block;
    box-sizing: border-box;
}

/* Vollbreite Variante (z.B. Suche, Verwaltungsseiten) */
.form-input.full-width,
.search-input {
    max-width: none;
    width: 100%;
}

.form-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-focus);
    background-color: var(--color-white);
}

.form-input:disabled,
.form-input[readonly] {
    background-color: var(--color-bg);
    color: var(--color-text-muted);
    cursor: not-allowed;
}

/* Select-Elemente (gleiche Darstellung wie form-input) */
.form-select {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    background-color: var(--color-bg-secondary);
    transition: all 0.3s ease;
    box-sizing: border-box;
    cursor: pointer;
}

.form-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-focus);
}

/* Formular-Aktionen (Button-Zeile am Ende von Formularen) */
.form-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border-light);
}

/* Fehlermeldung unter Formularfeldern */
.form-error {
    color: var(--color-danger);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

/* Custom Checkbox Styling */
.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: normal;
}

.form-checkbox {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-sm);
    margin-right: 10px;
    position: relative;
    background: var(--color-white);
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.form-checkbox:checked + .checkmark {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
}

.form-checkbox:checked + .checkmark::after {
    content: "";
    position: absolute;
    left: 4px;
    top: 0px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-label:hover .checkmark {
    border-color: var(--color-primary);
}

/* Checkbox-Gruppe (für mehrere Checkboxen nebeneinander) */
.form-checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

/* Abschnitts-Container in Formular-Editoren (weißes Card-Panel) */
.form-section {
    background: var(--color-white);
    padding: 1.5rem;
    margin-bottom: 2rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}
