*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 0.95rem;
    color: #1a1a2e;
    line-height: 1.5;
}

h1 { font-size: 1.75rem; margin: 0 0 1rem; }
h2 { font-size: 1.35rem; margin: 1.5rem 0 0.75rem; color: #1a1a2e; }
h3 { font-size: 1.1rem; margin: 1rem 0 0.5rem; }

.card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}
.card-title { font-size: 1.05rem; font-weight: 600; margin: 0; }

.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-weight: 600; margin-bottom: 0.25rem; font-size: 0.85rem; }
.form-control {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.9rem;
    font-family: inherit;
}
.form-control:focus { outline: none; border-color: #0078d4; box-shadow: 0 0 0 2px rgba(0,120,212,0.15); }
select.form-control { appearance: auto; }
textarea.form-control { resize: vertical; min-height: 60px; }
.form-row { display: flex; gap: 1rem; }
.form-row > .form-group { flex: 1; }

.btn {
    display: inline-block;
    padding: 0.55rem 1.25rem;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
    transition: background-color 0.15s;
}
.btn-primary { background: #0078d4; color: #fff; }
.btn-primary:hover { background: #006cbe; }
.btn-secondary { background: #e0e0e0; color: #333; }
.btn-secondary:hover { background: #d0d0d0; }
.btn-success { background: #107c10; color: #fff; }
.btn-success:hover { background: #0e6b0e; }
.btn-outline { background: transparent; border: 1px solid #0078d4; color: #0078d4; }
.btn-outline:hover { background: #f0f7ff; }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.82rem; }
.btn-row { display: flex; gap: 0.75rem; margin-top: 1.5rem; }
.btn-row-right { justify-content: flex-end; }
.btn-row-between { justify-content: space-between; }

.badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.badge-critical { background: #d13438; color: #fff; }
.badge-high { background: #f7630c; color: #fff; }
.badge-medium { background: #0078d4; color: #fff; }

.readiness-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.85rem;
}
.readiness-not-ready { background: #fde7e9; color: #d13438; border: 1px solid #d13438; }
.readiness-at-risk { background: #fff4ce; color: #c67a00; border: 1px solid #f7630c; }
.readiness-conditional { background: #dff6dd; color: #107c10; border: 1px solid #54a254; }
.readiness-ready { background: #dff6dd; color: #0e6b0e; border: 1px solid #107c10; }

.maturity-options { display: flex; gap: 0.35rem; margin: 0.4rem 0; }
.maturity-option { flex: 1; text-align: center; }
.maturity-option input[type="radio"] { display: none; }
.maturity-option label {
    display: block;
    padding: 0.4rem 0.25rem;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    line-height: 1.2;
}
.maturity-option input[type="radio"]:checked + label {
    border-color: #0078d4;
    background: #f0f7ff;
    color: #0078d4;
}
.maturity-option label:hover { border-color: #999; }

.progress-bar-container { display: flex; gap: 4px; margin-bottom: 2rem; }
.progress-step {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: #e0e0e0;
    transition: background 0.2s;
}
.progress-step.completed { background: #107c10; }
.progress-step.current { background: #0078d4; }

.domain-nav { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.5rem; }
.domain-nav-item {
    padding: 0.35rem 0.75rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid #e0e0e0;
    background: #fff;
    text-decoration: none;
    color: #333;
}
.domain-nav-item.active { background: #0078d4; color: #fff; border-color: #0078d4; }
.domain-nav-item.active .nav-manual-badge { background: rgba(255,255,255,0.3); color: #fff; }
.domain-nav-item.done { border-color: #107c10; color: #107c10; }

.nav-manual-badge {
    display: inline-block;
    background: #c67a00;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.05rem 0.35rem;
    border-radius: 8px;
    margin-left: 0.25rem;
    vertical-align: middle;
    line-height: 1.3;
}

.badge-automated { background: #107c10; color: #fff; }
.badge-review { background: #6b4f00; color: #fff; }
.badge-manual { background: #c67a00; color: #fff; }
.badge-eu { background: #003399; color: #fff; }

.nav-verify-badge {
    display: inline-block;
    background: #6b4f00;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.05rem 0.35rem;
    border-radius: 8px;
    margin-left: 0.25rem;
    vertical-align: middle;
    line-height: 1.3;
}

.nav-eu-badge {
    display: inline-block;
    background: #003399;
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 0.05rem 0.3rem;
    border-radius: 3px;
    margin-left: 0.25rem;
    vertical-align: middle;
    line-height: 1.3;
}

.score-table { width: 100%; border-collapse: collapse; }
.score-table th { text-align: left; padding: 0.5rem; border-bottom: 2px solid #1a1a2e; font-size: 0.82rem; }
.score-table td { padding: 0.5rem; border-bottom: 1px solid #e0e0e0; font-size: 0.88rem; }
.score-table td:nth-child(3), .score-table th:nth-child(3) { text-align: right; }

.score-bar-bg { background: #e0e0e0; border-radius: 3px; height: 8px; width: 100%; min-width: 80px; }
.score-bar-fill { height: 8px; border-radius: 3px; transition: width 0.3s; }
.score-bar-fill.low { background: #d13438; }
.score-bar-fill.mid { background: #f7630c; }
.score-bar-fill.high { background: #107c10; }

.criteria-text { font-size: 0.78rem; color: #666; margin-top: 0.25rem; line-height: 1.35; font-style: italic; }
.risk-text { font-size: 0.82rem; color: #a4262c; background: #fde7e9; padding: 0.5rem 0.75rem; border-radius: 4px; margin-top: 0.5rem; }

.download-section { display: flex; gap: 1rem; margin-top: 1.5rem; flex-wrap: wrap; }

.blocker-item { background: #fde7e9; border: 1px solid #d13438; border-radius: 6px; padding: 1rem; margin-bottom: 0.75rem; }
.blocker-item h4 { margin: 0 0 0.25rem; color: #a4262c; font-size: 0.95rem; }
.blocker-item p { margin: 0; font-size: 0.85rem; color: #666; }

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}
.modal-content {
    background: #fff;
    border-radius: 10px;
    width: 100%;
    max-width: 780px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e0e0e0;
}
.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    line-height: 1;
    padding: 0.25rem;
}
.modal-close:hover { color: #d13438; }
.modal-subheader {
    padding: 0.75rem 1.5rem;
    background: #f5f6fa;
    border-bottom: 1px solid #e0e0e0;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

/* Remedy content markdown */
.remedy-content { font-size: 0.9rem; line-height: 1.6; }
.remedy-content h1 { font-size: 1.2rem; margin: 1.25rem 0 0.5rem; border-bottom: 1px solid #e0e0e0; padding-bottom: 0.35rem; }
.remedy-content h2 { font-size: 1.05rem; margin: 1rem 0 0.5rem; }
.remedy-content h3 { font-size: 0.95rem; margin: 0.75rem 0 0.35rem; }
.remedy-content ol, .remedy-content ul { padding-left: 1.5rem; }
.remedy-content li { margin-bottom: 0.4rem; }
.remedy-content code {
    background: #f0f0f0;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    font-size: 0.82rem;
}
.remedy-content pre {
    background: #1a1a2e;
    color: #e0e0e0;
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    font-size: 0.82rem;
}
.remedy-content pre code { background: none; padding: 0; color: inherit; }
.remedy-content table { width: 100%; border-collapse: collapse; margin: 0.75rem 0; }
.remedy-content th { text-align: left; padding: 0.4rem 0.5rem; border-bottom: 2px solid #1a1a2e; font-size: 0.82rem; }
.remedy-content td { padding: 0.4rem 0.5rem; border-bottom: 1px solid #e0e0e0; font-size: 0.85rem; }

/* Loading spinner */
.loading-indicator { text-align: center; padding: 3rem 1rem; color: #666; }
.loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e0e0e0;
    border-top-color: #0078d4;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 1rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Remedy button */
.btn-remedy {
    background: #5c2d91;
    color: #fff;
    padding: 0.3rem 0.65rem;
    border-radius: 4px;
    font-size: 0.78rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    font-family: inherit;
}
.btn-remedy:hover { background: #4a2578; }
