/* Audit specific styles */

/* ── Domain blocks ── */
.audit-domain {
    background: white;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 0.75rem;
    margin-bottom: 1rem;
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.audit-domain:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.audit-domain-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    cursor: pointer;
    user-select: none;
    gap: 1rem;
}

.audit-domain-header:hover {
    background: var(--bg-light, #f8fafc);
}

.audit-domain-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

.audit-domain-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary, #1e40af);
    color: white;
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
}

.audit-domain-title strong {
    font-size: 1rem;
    color: var(--text-dark, #1e293b);
}

.audit-domain-article {
    display: block;
    font-size: 0.8rem;
    color: var(--text-light, #64748b);
    margin-top: 0.15rem;
}

.audit-domain-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.audit-domain-score {
    font-weight: 700;
    font-size: 0.9rem;
    color: #94a3b8;
}

.audit-domain-percentage {
    font-weight: 600;
    font-size: 0.9rem;
}

.audit-domain-toggle-icon {
    color: var(--text-light, #64748b);
    font-size: 0.85rem;
    transition: transform 0.3s;
}

/* ── Domain progress bar ── */
.audit-domain-progress {
    height: 4px;
    background: var(--bg-light, #f1f5f9);
    overflow: hidden;
}

.audit-domain-progress-bar {
    height: 100%;
    border-radius: 2px;
    transition: width 0.5s ease, background 0.3s;
}

/* ── Questions ── */
.audit-questions {
    padding: 0.5rem 1.5rem 1.5rem;
    border-top: 1px solid var(--border-color, #e2e8f0);
}

.audit-question {
    padding: 1rem 0;
    border-bottom: 1px solid var(--bg-light, #f1f5f9);
}

.audit-question:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.audit-question-text {
    font-size: 0.95rem;
    color: var(--text-dark, #1e293b);
    line-height: 1.5;
    margin-bottom: 0.75rem;
}

.audit-question-number {
    font-weight: 700;
    color: var(--primary, #1e40af);
}

/* ── Option buttons ── */
.audit-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}

.audit-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.6rem 0.5rem;
    border: 2px solid var(--border-color, #e2e8f0);
    border-radius: 0.5rem;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    font-size: 0.75rem;
    color: var(--text-dark, #1e293b);
    text-align: center;
    gap: 0.25rem;
}

.audit-option:hover {
    border-color: var(--primary, #1e40af);
    background: rgba(30, 64, 175, 0.03);
}

.audit-option-score {
    font-weight: 800;
    font-size: 1rem;
}

.audit-option-label {
    font-size: 0.7rem;
    line-height: 1.2;
    color: var(--text-light, #64748b);
}

/* Score colors */
.audit-option.score-0 { border-color: #fecaca; }
.audit-option.score-0:hover { border-color: #ef4444; background: rgba(239, 68, 68, 0.05); }
.audit-option.score-0 .audit-option-score { color: #ef4444; }

.audit-option.score-1 { border-color: #fed7aa; }
.audit-option.score-1:hover { border-color: #f59e0b; background: rgba(245, 158, 11, 0.05); }
.audit-option.score-1 .audit-option-score { color: #f59e0b; }

.audit-option.score-2 { border-color: #bfdbfe; }
.audit-option.score-2:hover { border-color: #3b82f6; background: rgba(59, 130, 246, 0.05); }
.audit-option.score-2 .audit-option-score { color: #3b82f6; }

.audit-option.score-3 { border-color: #bbf7d0; }
.audit-option.score-3:hover { border-color: #10b981; background: rgba(16, 185, 129, 0.05); }
.audit-option.score-3 .audit-option-score { color: #10b981; }

/* Selected states */
.audit-option.selected.score-0 {
    background: #fef2f2;
    border-color: #ef4444;
    box-shadow: 0 0 0 1px #ef4444;
}

.audit-option.selected.score-1 {
    background: #fffbeb;
    border-color: #f59e0b;
    box-shadow: 0 0 0 1px #f59e0b;
}

.audit-option.selected.score-2 {
    background: #eff6ff;
    border-color: #3b82f6;
    box-shadow: 0 0 0 1px #3b82f6;
}

.audit-option.selected.score-3 {
    background: #f0fdf4;
    border-color: #10b981;
    box-shadow: 0 0 0 1px #10b981;
}

/* ── Summary card ── */
.audit-summary-card {
    background: white;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 1rem;
    padding: 2rem;
    text-align: center;
}

/* ── Org name input ── */
.audit-org-name input:focus {
    outline: none;
    border-color: var(--primary, #1e40af);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

/* ── Password error ── */
#audit-password.error {
    border-color: var(--error, #ef4444);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* ── Report content ── */
.audit-report-content h3,
.audit-report-content h4,
.audit-report-content h5 {
    color: var(--text-dark, #1e293b);
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .audit-domain-header {
        flex-wrap: wrap;
        padding: 1rem;
    }

    .audit-domain-title {
        width: 100%;
    }

    .audit-domain-meta {
        width: 100%;
        justify-content: flex-end;
    }

    .audit-options {
        grid-template-columns: repeat(2, 1fr);
    }

    .audit-questions {
        padding: 0.5rem 1rem 1rem;
    }

    .audit-summary-card {
        padding: 1.5rem 1rem;
    }
}

@media (max-width: 480px) {
    .audit-options {
        grid-template-columns: 1fr 1fr;
    }

    .audit-option {
        padding: 0.5rem 0.25rem;
    }

    .audit-option-label {
        font-size: 0.65rem;
    }
}
