/* BHP Tests - style frontu */

.bhp-test-wrapper {
    max-width: 760px;
    margin: 0 auto;
    font-size: 16px;
    line-height: 1.5;
}

.bhp-test-error {
    padding: 12px 16px;
    background: #fde8e8;
    border-left: 4px solid #e02424;
    color: #9b1c1c;
    border-radius: 4px;
}

.bhp-test-intro {
    background: #f3f4f6;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 24px;
}

.bhp-test-required-note {
    margin: 0 0 6px;
    font-weight: 600;
    color: #1f2937;
}

.bhp-test-required-mark {
    margin: 0;
    font-size: 14px;
    color: #6b7280;
}

/* Pola danych osobowych */
.bhp-test-personal {
    margin-bottom: 28px;
}

.bhp-field {
    margin-bottom: 16px;
}

.bhp-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: #1f2937;
}

.bhp-field .req {
    color: #e02424;
}

.bhp-field input {
    width: 100%;
    max-width: 420px;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 16px;
    box-sizing: border-box;
}

.bhp-field input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Pytania */
.bhp-question {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 18px 20px;
    margin-bottom: 16px;
    transition: border-color 0.2s;
}

.bhp-question.bhp-question-error {
    border-color: #e02424;
    background: #fef6f6;
}

.bhp-question-text {
    font-weight: 600;
    margin: 0 0 14px;
    color: #111827;
}

.bhp-question-num {
    color: #2563eb;
    margin-right: 4px;
}

.bhp-answers {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bhp-answer {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.bhp-answer:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.bhp-answer input[type="radio"] {
    margin-top: 3px;
    flex-shrink: 0;
}

.bhp-answer span {
    flex: 1;
}

/* Przycisk wysyłania */
.bhp-test-submit {
    margin-top: 24px;
}

.bhp-submit-btn {
    background: #2563eb;
    color: #fff;
    border: none;
    padding: 12px 32px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.bhp-submit-btn:hover {
    background: #1d4ed8;
}

.bhp-submit-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

/* Komunikaty */
.bhp-test-message {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 6px;
    font-weight: 500;
}

.bhp-msg-error {
    background: #fde8e8;
    border-left: 4px solid #e02424;
    color: #9b1c1c;
}

.bhp-msg-success {
    background: #def7ec;
    border-left: 4px solid #0e9f6e;
    color: #03543f;
}

/* Wynik */
.bhp-result-summary {
    padding: 24px;
    border-radius: 8px;
    margin-bottom: 24px;
    text-align: center;
}

.bhp-result-summary h3 {
    margin: 0 0 8px;
    font-size: 22px;
}

.bhp-result-score {
    margin: 0;
    font-size: 18px;
}

.bhp-result-pass {
    background: #def7ec;
    border: 2px solid #0e9f6e;
    color: #03543f;
}

.bhp-result-fail {
    background: #fde8e8;
    border: 2px solid #e02424;
    color: #9b1c1c;
}

.bhp-result-meta {
    margin: 2px 0;
    font-size: 15px;
}

.bhp-result-date {
    margin: 8px 0 0;
    font-size: 13px;
    opacity: 0.8;
}

/* Przyciski akcji pod wynikiem */
.bhp-result-actions {
    margin-top: 20px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.bhp-print-btn,
.bhp-retry-btn {
    border: none;
    padding: 11px 24px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.bhp-print-btn {
    background: #374151;
    color: #fff;
}
.bhp-print-btn:hover { background: #1f2937; }

.bhp-retry-btn {
    background: #2563eb;
    color: #fff;
}
.bhp-retry-btn:hover { background: #1d4ed8; }

/* Przegląd odpowiedzi */
.bhp-result-review h4 {
    margin: 0 0 16px;
    font-size: 18px;
}

.bhp-review-q {
    border: 1px solid #e5e7eb;
    border-left-width: 4px;
    border-radius: 6px;
    padding: 14px 16px;
    margin-bottom: 12px;
}

.bhp-review-q.is-correct {
    border-left-color: #0e9f6e;
    background: #f3faf7;
}

.bhp-review-q.is-wrong {
    border-left-color: #e02424;
    background: #fdf6f6;
}

.bhp-review-question {
    font-weight: 600;
    margin: 0 0 10px;
}

.bhp-review-q ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.bhp-review-q li {
    padding: 6px 10px;
    border-radius: 4px;
    margin-bottom: 4px;
}

.bhp-review-q li.correct-answer {
    background: #def7ec;
    color: #03543f;
    font-weight: 600;
}

.bhp-review-q li.given-wrong {
    background: #fde8e8;
    color: #9b1c1c;
    text-decoration: line-through;
}

.bhp-mark {
    color: #0e9f6e;
    font-weight: 700;
    font-size: 14px;
}

.bhp-mark-given {
    color: #6b7280;
    font-size: 14px;
    font-style: italic;
}

/* Responsywność */
@media (max-width: 600px) {
    .bhp-test-wrapper {
        font-size: 15px;
    }
    .bhp-field input {
        max-width: 100%;
    }
    .bhp-submit-btn {
        width: 100%;
    }
}

/* Druk komunikatu z wynikiem - ukryj wszystko poza obszarem wyniku */
@media print {
    body:has(.bhp-printing) *,
    body.bhp-print-active * {
        visibility: hidden;
    }
    .bhp-printing .bhp-result-printable,
    .bhp-printing .bhp-result-printable * {
        visibility: visible;
    }
    .bhp-printing .bhp-result-printable {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }
    .no-print {
        display: none !important;
    }
}
