/* ── WP Quiz Master — Frontend Styles ── */

.wqm-quiz {
    max-width: 760px;
    margin: 0 auto;
    font-family: inherit;
    position: relative;
}

.wqm-notice {
    padding: 16px 20px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    color: #856404;
    font-size: 15px;
}

/* ── Participant card (подтверждение данных после регистрации) ── */
.wqm-participant-card {
    background: #fff;
    border: 2px solid #2563eb;
    border-radius: 12px;
    padding: 20px 24px;
    box-sizing: border-box;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.15);
}
.wqm-card-name-block {
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid #eee;
}
.wqm-card-name-block .wqm-card-label { display: block; margin-bottom: 3px; }
.wqm-card-name {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a2e;
    word-break: break-word;
}
.wqm-card-rows { display: flex; flex-direction: column; gap: 12px; }
.wqm-card-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f2f2f2;
}
.wqm-card-row:last-child { border-bottom: none; padding-bottom: 0; }
.wqm-card-label { color: #6b7280; font-weight: 600; font-size: 13px; }
.wqm-card-value { color: #111; word-break: break-word; }

.wqm-card-hint {
    color: #92400e;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 14px;
    margin: 16px 0 0;
    text-align: center;
}

@media (max-width: 480px) {
    .wqm-participant-card { padding: 16px 18px; }
}

/* ── Header ── */
.wqm-quiz-header { margin-bottom: 28px; }
.wqm-quiz-title { font-size: 26px; font-weight: 700; margin: 0 0 12px; color: #1a1a2e; }
.wqm-quiz-desc { color: #666; font-size: 15px; margin: 0; }

/* ── Registration step: blue header ── */
.wqm-quiz .wqm-step-reg .wqm-quiz-header {
    background: #2563eb !important;
    padding: 28px 32px !important;
    border-radius: 8px !important;
    margin-bottom: 28px !important;
    text-align: center !important;
}
.wqm-quiz .wqm-step-reg .wqm-quiz-title {
    color: #fff !important;
    line-height: 1.4 !important;
    margin-bottom: 8px !important;
}
.wqm-quiz .wqm-step-reg .wqm-quiz-desc {
    color: rgba(255, 255, 255, 0.88) !important;
    margin: 0 !important;
}

/* ── Progress ── */
.wqm-progress { display: flex; align-items: center; gap: 12px; }
.wqm-progress-bar { flex: 1; height: 8px; background: #e8e8e8; border-radius: 4px; overflow: hidden; }
.wqm-progress-fill { height: 100%; background: linear-gradient(90deg, #2563eb, #3b82f6); border-radius: 4px; transition: width .4s ease; }
.wqm-progress-text { font-size: 13px; color: #888; white-space: nowrap; min-width: 48px; text-align: right; }

/* ── Forms ── */
.wqm-field-wrap { margin-bottom: 20px; }
.wqm-label { display: block; font-weight: 600; font-size: 14px; color: #333; margin-bottom: 6px; }
.wqm-required { color: #e53e3e; }

.wqm-input {
    display: block;
    width: 100%;
    padding: 10px 14px;
    font-size: 15px;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    color: #111;
    transition: border-color .2s;
    box-sizing: border-box;
}
.wqm-input:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.wqm-input.wqm-input-error { border-color: #dc2626 !important; box-shadow: 0 0 0 3px rgba(220,38,38,.12) !important; }
.wqm-field-error-msg { color: #dc2626; font-size: 13px; margin: 4px 0 0; }
.wqm-radio-group.wqm-radio-error .wqm-radio-label { border-color: #fca5a5; }

.wqm-radio-group { display: flex; flex-direction: column; gap: 8px; }
.wqm-radio-label { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 15px; padding: 8px 12px; border-radius: 8px; border: 2px solid #e8e8e8; transition: border-color .2s, background .2s; }
.wqm-radio-label:hover { border-color: #93c5fd; background: #eff6ff; }
.wqm-radio-label input { width: 18px; height: 18px; cursor: pointer; accent-color: #2563eb; }
.wqm-field-hint { font-size: 12px; color: #6b7280; margin: 4px 0 0; }

.wqm-field-wrap-checkbox { padding: 8px; border: 2px solid transparent; border-radius: 8px; transition: border-color .2s, background .2s; }
.wqm-checkbox-label { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 14px; line-height: 1.5; color: #333; }
.wqm-checkbox-label input { width: 18px; height: 18px; flex-shrink: 0; margin-top: 2px; cursor: pointer; accent-color: #2563eb; }
.wqm-checkbox-label a { color: #2563eb; text-decoration: underline; }
.wqm-checkbox-label a:hover { color: #1d4ed8; }

.wqm-field-wrap-checkbox.wqm-checkbox-invalid { border-color: #dc2626; background: #fef2f2; }

/* ── Buttons ── */
.wqm-form-actions { margin-top: 28px; }

.wqm-btn {
    display: inline-block;
    padding: 12px 28px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: background .2s, transform .1s;
    text-decoration: none;
}
.wqm-btn:active { transform: translateY(1px); }
.wqm-btn-primary { background: #2563eb; color: #fff; }
.wqm-btn-primary:hover { background: #1d4ed8; }
.wqm-btn-secondary { background: #e5e7eb; color: #374151; }
.wqm-btn-secondary:hover { background: #d1d5db; }
.wqm-btn-success { background: #16a34a; color: #fff; }
.wqm-btn-success:hover { background: #15803d; }

/* ── Questions ── */
.wqm-question { animation: wqm-fadein .3s ease; }

@keyframes wqm-fadein {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.wqm-question-num { font-size: 13px; font-weight: 600; color: #2563eb; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 12px; }
.wqm-question-text { font-size: 19px; font-weight: 600; color: #111; line-height: 1.5; margin-bottom: 16px; }
.wqm-question-image { margin-bottom: 18px; }
.wqm-question-image img { max-width: 100%; max-height: 340px; object-fit: contain; border-radius: 8px; border: 1px solid #e8e8e8; }
.wqm-multi-hint { font-size: 13px; color: #6b7280; font-style: italic; margin: 0 0 12px; }

/* Answers */
.wqm-answers { display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; }

.wqm-answer {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
    transition: border-color .2s, background .2s;
    user-select: none;
}
.wqm-answer:hover { border-color: #93c5fd; background: #eff6ff; }
.wqm-answer-selected { border-color: #2563eb; background: #eff6ff; }
.wqm-answer input { width: 18px; height: 18px; cursor: pointer; flex-shrink: 0; accent-color: #2563eb; }
.wqm-answer-text { font-size: 15px; color: #111; line-height: 1.4; }

/* Navigation */
.wqm-question-nav { display: flex; gap: 10px; flex-wrap: wrap; }

/* Inline error */
.wqm-inline-error { color: #dc2626; font-size: 14px; padding: 8px 12px; background: #fef2f2; border: 1px solid #fecaca; border-radius: 6px; margin-bottom: 12px; }
.wqm-form-error { color: #dc2626; font-size: 14px; padding: 10px 14px; background: #fef2f2; border: 1px solid #fecaca; border-radius: 6px; margin-top: 12px; }

/* ── Loading Spinner ── */
.wqm-loading { text-align: center; padding: 60px 20px; }
.wqm-spinner { width: 44px; height: 44px; border: 4px solid #e5e7eb; border-top-color: #2563eb; border-radius: 50%; animation: wqm-spin 0.8s linear infinite; margin: 0 auto 16px; }
@keyframes wqm-spin { to { transform: rotate(360deg); } }

/* ── Results ── */
.wqm-results-content { text-align: center; padding: 20px 0 40px; }

.wqm-result-icon { font-size: 48px; width: 80px; height: 80px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 20px; }
.wqm-icon-pass { background: #dcfce7; color: #16a34a; }
.wqm-icon-fail { background: #fee2e2; color: #dc2626; }

.wqm-score-block { margin: 24px 0; }
.wqm-score-circle { width: 120px; height: 120px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 12px; font-size: 28px; font-weight: 700; }
.wqm-score-circle.wqm-pass { background: #dcfce7; color: #16a34a; border: 4px solid #86efac; }
.wqm-score-circle.wqm-fail { background: #fee2e2; color: #dc2626; border: 4px solid #fca5a5; }
.wqm-score-nums { font-size: 18px; color: #555; font-weight: 600; }

.wqm-result-msg { font-size: 16px; color: #374151; line-height: 1.6; max-width: 520px; margin: 0 auto; background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 10px; padding: 20px 24px; }

/* ── Answer Review ── */
.wqm-answers-review { text-align: left; margin-top: 32px; }
.wqm-answers-review h3 { font-size: 18px; border-bottom: 2px solid #e5e7eb; padding-bottom: 10px; margin-bottom: 20px; }

.wqm-review-question {
    background: #fff;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    margin-bottom: 14px;
    overflow: hidden;
}
.wqm-review-question.wqm-right { border-color: #86efac; }
.wqm-review-question.wqm-wrong { border-color: #fca5a5; }

.wqm-review-q-header { display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px; background: #f9fafb; }
.wqm-review-status { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.wqm-review-question.wqm-right .wqm-review-status { color: #16a34a; }
.wqm-review-question.wqm-wrong .wqm-review-status { color: #dc2626; }

.wqm-review-img { max-width: 200px; max-height: 120px; object-fit: contain; margin: 8px 16px; border-radius: 6px; }

.wqm-review-answers { list-style: none; padding: 10px 16px; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.wqm-review-answers li { font-size: 14px; color: #555; padding: 4px 8px; border-radius: 4px; }
.wqm-correct-ans { background: #dcfce7; color: #166534; font-weight: 600; }
.wqm-wrong-ans { background: #fee2e2; color: #991b1b; }

/* ── Responsive ── */
@media (max-width: 600px) {
    .wqm-quiz-title { font-size: 20px; }
    .wqm-question-text { font-size: 16px; }
    .wqm-btn { padding: 10px 20px; font-size: 14px; }
    .wqm-score-circle { width: 100px; height: 100px; font-size: 22px; }
}
