/* Prismamed.Forms - Ansicht */

.pf-heading {
    font-size: 1.25em;
    font-weight: 600;
    margin-top: 8px;
    margin-bottom: 4px;
}

.pf-paragraph {
    color: var(--kendo-color-subtle);
    white-space: pre-wrap;
    margin-bottom: 8px;
}

.pf-choices {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pf-choice {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.pf-image {
    max-width: 100%;
    max-height: 320px;
    border: 1px solid var(--kendo-color-border);
    border-radius: 4px;
}

/* Skizze */

.pf-sketch {
    border: 1px solid var(--kendo-color-border);
    border-radius: 4px;
    background: var(--kendo-color-surface);
}

.pf-sketch-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    padding: 4px 6px;
    border-bottom: 1px solid var(--kendo-color-border);
}

.pf-sketch-color,
.pf-sketch-width {
    width: 26px;
    height: 26px;
    border: 2px solid transparent;
    border-radius: 50%;
    cursor: pointer;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--kendo-color-surface-alt);
}

/* Feiner Rand, damit auch Schwarz auf dunklem Grund (Dark Mode) als Knopf erkennbar bleibt */
.pf-sketch-color {
    box-shadow: inset 0 0 0 1px var(--kendo-color-subtle);
}

.pf-sketch-width span {
    display: inline-block;
    border-radius: 50%;
    background: var(--kendo-color-on-app-surface);
}

.pf-sketch-color-active {
    border-color: var(--kendo-color-primary);
}

.pf-sketch-canvas {
    display: block;
    width: 100%;
    height: auto;
    cursor: crosshair;
    touch-action: none;
}

/* Unterschrift: höchstens so breit wie ihre Fläche (600 × 180), damit sie auch über die ganze Breite eine
   Unterschriftszeile bleibt. Nur die Breite begrenzen - das Seitenverhältnis muss bleiben, sonst sitzen die Striche
   neben dem Zeiger. */
.pf-signature .pf-sketch-canvas {
    max-width: 600px;
}

/* Zustimmung: längerer Text bricht um, das Häkchen bleibt oben */
.pf-consent {
    align-items: flex-start;
}

.pf-consent .k-checkbox {
    margin-top: 2px;
    flex: none;
}

/* Meldung am Feld nach FormView.Validate() - Teleriks k-form-error gibt Farbe und Größe */
.pf-fehler {
    margin-top: 4px;
}

/* Prismamed.Forms - Designer */

.pf-designer {
    height: 100%;
}

.pf-pane {
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: auto;
    padding: 8px;
}

.pf-pane-title {
    font-weight: 600;
    margin-bottom: 8px;
}

.pf-palette-label {
    font-size: 12px;
    color: var(--kendo-color-subtle);
    margin: 8px 0 4px 0;
}

.pf-palette-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    margin-bottom: 4px;
    border: 1px solid var(--kendo-color-border);
    border-radius: 4px;
    background: var(--kendo-color-surface-alt);
    cursor: grab;
    user-select: none;
}

.pf-palette-item:active {
    cursor: grabbing;
}

.pf-canvas {
    padding: 8px;
}

.pf-block {
    margin-bottom: 12px;
}

.pf-block-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    cursor: pointer;
}

.pf-block-title {
    font-weight: 600;
    flex: 1;
}

.pf-fields {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 6px;
    padding: 6px;
    min-height: 40px;
}

.pf-field {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    border: 1px solid var(--kendo-color-border);
    border-radius: 4px;
    background: var(--kendo-color-surface-alt);
    cursor: pointer;
    overflow: hidden;
}

.pf-field-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pf-field-type {
    font-size: 11px;
    color: var(--kendo-color-subtle);
}

.pf-selected {
    outline: 2px solid var(--kendo-color-primary);
    outline-offset: 1px;
}

.pf-drag-handle {
    cursor: grab;
    color: var(--kendo-color-subtle);
}

.pf-drop-zone {
    margin: 6px;
    padding: 8px;
    border: 2px dashed var(--kendo-color-border);
    border-radius: 4px;
    text-align: center;
    font-size: 12px;
    color: var(--kendo-color-subtle);
}

.pf-drop-active {
    border-color: var(--kendo-color-primary);
    background: color-mix(in srgb, var(--kendo-color-primary) 8%, transparent);
}

.pf-help {
    font-size: 12px;
    color: var(--kendo-color-subtle);
}

.pf-rule {
    margin-bottom: 8px;
}

.pf-rule-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.pf-rule-word {
    font-weight: 600;
    min-width: 48px;
}

/* BlazorSortable legt um jedes Element einen eigenen div - das Rasterkind ist also der Wrapper,
   nicht das Feld. Die Breite muss deshalb über :has() vom Feld auf den Wrapper übertragen werden. */
.pf-fields > div {
    display: flex;
    min-width: 0;
}

.pf-fields > div > .pf-field {
    flex: 1;
    min-width: 0;
}

.pf-fields > div:has(> .pf-field[data-columns="12"]) {
    grid-column: span 12;
}

.pf-fields > div:has(> .pf-field[data-columns="6"]) {
    grid-column: span 6;
}

.pf-fields > div:has(> .pf-field[data-columns="4"]) {
    grid-column: span 4;
}
