/**
 * Wspólne style formularzy portalu — radio, checkbox, pola, siatki.
 */

/* ── Pola formularza ── */
.pjm-form-field,
.pjm-edit-field,
.pjm-asg-fld {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.pjm-form-field > label,
.pjm-edit-field > .pjm-label,
.pjm-asg-fld > label {
    font-size: 12px;
    font-weight: 600;
    color: #4b5563;
    letter-spacing: 0.01em;
}

.pjm-form-grid,
.pjm-edit-grid,
.pjm-asg-grid {
    display: grid;
    gap: 14px 16px;
    align-items: start;
}

.pjm-form-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pjm-form-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

@media (max-width: 720px) {
    .pjm-form-grid--2,
    .pjm-form-grid--3,
    .pjm-edit-grid,
    .pjm-asg-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Checkbox (custom) ── */
.pjm-check,
.pjm-choice-group label.pjm-check {
    display: inline-flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.45;
    color: #374151;
    font-weight: 500;
    user-select: none;
}

.pjm-check input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    margin: 2px 0 0;
    flex-shrink: 0;
    border: 2px solid #c5cec8;
    border-radius: 5px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.pjm-check input[type="checkbox"]:hover {
    border-color: #0d7a5f;
}

.pjm-check input[type="checkbox"]:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(13, 122, 95, 0.22);
}

.pjm-check input[type="checkbox"]:checked {
    border-color: #0d7a5f;
    background: #0d7a5f url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M3.5 8.2l3 3 6-6.5' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px no-repeat;
}

/* ── Radio — grupa pill / segment ── */
.pjm-choice-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pjm-choice-group--stack {
    flex-direction: column;
    align-items: stretch;
}

.pjm-choice-group label {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 0;
    padding: 8px 14px;
    min-height: 38px;
    border: 1.5px solid #dde5e0;
    border-radius: 10px;
    background: #fafcfb;
    font-size: 13px;
    font-weight: 600;
    color: #4b5563;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, color 0.15s, box-shadow 0.15s;
}

.pjm-choice-group label:hover {
    border-color: #9ec4b6;
    background: #f3faf7;
}

.pjm-choice-group input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.pjm-choice-group input[type="radio"]:focus-visible + span,
.pjm-choice-group input[type="radio"]:focus-visible ~ .pjm-choice-label {
    outline: 2px solid rgba(13, 122, 95, 0.35);
    outline-offset: 2px;
    border-radius: 4px;
}

.pjm-choice-group input[type="radio"]:checked + span,
.pjm-choice-group label:has(input[type="radio"]:checked) {
    border-color: #0d7a5f;
    background: #e8f6f1;
    color: #0b5c47;
    box-shadow: 0 0 0 1px rgba(13, 122, 95, 0.12);
}

/* Tryb naliczania kosztu — przypisania */
.pjm-asg-calcmodes.pjm-choice-group label {
    flex: 1 1 auto;
    min-width: 120px;
    font-size: 12px;
    padding: 8px 12px;
}

/* Para językowa w edycji pozycji */
.pjm-edit-langpair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 8px;
}

.pjm-edit-langpair .pjm-small {
    grid-column: 1 / -1;
    margin: 0;
}

@media (max-width: 520px) {
    .pjm-edit-langpair {
        grid-template-columns: 1fr;
    }
}

.pjm-modal-body .pjm-input,
.pjm-modal-body input[type="text"],
.pjm-modal-body input[type="email"],
.pjm-modal-body input[type="number"],
.pjm-modal-body input[type="date"],
.pjm-modal-body input[type="time"],
.pjm-modal-body select,
.pjm-modal-body textarea,
#pjm-order-edit-form .pjm-input {
    width: 100%;
    box-sizing: border-box;
}

.pjm-modal-body .pjm-form-section,
#pjm-order-edit-form .pjm-card {
    margin-bottom: 16px;
}

.pjm-modal-body .pjm-form-section-title {
    font-size: 13px;
    font-weight: 700;
    color: #14352a;
    margin: 0 0 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}
