/* IoT Security Scorecard — Styles */

/* ================================
   Layout
   ================================ */
.scorecard-container {
    max-width: 720px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    padding-top: 5rem;
}

/* ================================
   Header
   ================================ */
/* Header — now handled by tool-shared.css .tool-hero */

.scorecard-intro {
    /* kept for backwards compat if any inline references remain */
    color: var(--color-text-light);
    max-width: 600px;
    font-size: var(--font-size-lg);
    line-height: 1.7;
}

/* ================================
   Progress Bar
   ================================ */
.progress-bar-container {
    height: 6px;
    background: var(--color-border-light);
    border-radius: 3px;
    margin-bottom: 2rem;
    position: relative;
}

.progress-bar {
    height: 100%;
    background: var(--color-primary);
    border-radius: 3px;
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    position: absolute;
    right: 0;
    top: -1.5rem;
}

/* ================================
   Question Groups
   ================================ */
.question-group {
    margin-bottom: 2rem;
}

.question-group h2 {
    font-size: var(--font-size-lg);
    color: var(--color-primary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-border-light);
}
.etsi-ref {
    font-size: var(--font-size-xs);
    color: var(--color-text-muted);
    font-weight: 400;
    margin-left: 0.5rem;
}

/* ================================
   Questions
   ================================ */
.question {
    background: white;
    border: 1px solid var(--color-border-light);
    border-radius: var(--border-radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
    transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.question:focus-within {
    border-color: var(--color-primary-light);
    box-shadow: var(--shadow-sm);
}

.question p {
    font-weight: 500;
    margin-bottom: 0.75rem;
    color: var(--color-text);
    line-height: 1.5;
}

.question label {
    display: block;
    padding: 0.5rem 0.75rem;
    margin: 0.25rem 0;
    border-radius: 4px;
    cursor: pointer;
    font-size: var(--font-size-sm);
    transition: background 0.2s;
    border-left: 3px solid transparent;
    line-height: 1.5;
}

.question label:hover {
    background: var(--color-bg-alt);
}

.question input[type="radio"] {
    margin-right: 0.5rem;
    accent-color: var(--color-primary);
}

.question label.selected {
    background: rgba(37, 99, 235, 0.08);
    border-left: 3px solid var(--color-primary);
}

/* ================================
   Form Actions
   ================================ */
.form-actions {
    text-align: center;
    margin-top: 2rem;
    padding-bottom: 2rem;
}

#submitBtn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ================================
   Results Panel
   ================================ */
.results-panel {
    margin-top: 3rem;
    padding: 2rem;
    background: var(--color-bg-alt);
    border-radius: var(--border-radius-lg);
}

/* Score Display */
.score-display {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--color-border);
}

.score-badge {
    display: inline-flex;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    font-size: 2rem;
    font-weight: 700;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
    box-shadow: var(--shadow-md);
}

.score-badge-a {
    background: #d1fae5;
    color: #065f46;
    border: 3px solid #10b981;
}

.score-badge-b {
    background: #dbeafe;
    color: #1e40af;
    border: 3px solid #3b82f6;
}

.score-badge-c {
    background: #fef3c7;
    color: #92400e;
    border: 3px solid #f59e0b;
}

.score-badge-d {
    background: #ffedd5;
    color: #9a3412;
    border: 3px solid #f97316;
}

.score-badge-f {
    background: #fee2e2;
    color: #991b1b;
    border: 3px solid #ef4444;
}

.risk-tier {
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin-top: 0.5rem;
    display: block;
}

.score-percentage {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    display: block;
    margin-top: 0.25rem;
}

/* Category Scores */
.category-scores {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.category-score-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: var(--font-size-sm);
}

.category-score-label {
    flex: 1;
    text-align: left;
    color: var(--color-text-light);
}

.category-score-bar-track {
    flex: 2;
    height: 6px;
    background: var(--color-border);
    border-radius: 3px;
    overflow: hidden;
}

.category-score-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
}

.category-score-val {
    font-weight: 600;
    color: var(--color-text);
    min-width: 2.5rem;
    text-align: right;
}

/* Recommendations */
.results-section-title {
    font-size: var(--font-size-xl);
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--color-text);
}

.recommendations {
    list-style: none;
    padding: 0;
    margin-bottom: 2rem;
}

.recommendation {
    border: 1px solid var(--color-border-light);
    border-radius: var(--border-radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
    background: white;
}

.recommendation-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.rec-priority-badge {
    display: inline-block;
    font-size: var(--font-size-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    background: var(--color-bg-alt);
    color: var(--color-text-muted);
    white-space: nowrap;
}

.rec-priority-1 {
    background: #fee2e2;
    color: #991b1b;
}

.rec-priority-2 {
    background: #ffedd5;
    color: #9a3412;
}

.rec-priority-3 {
    background: #fef3c7;
    color: #92400e;
}

.recommendation h3 {
    font-size: var(--font-size-base);
    margin-bottom: 0;
}

.recommendation p {
    font-size: var(--font-size-sm);
    color: var(--color-text-light);
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

.recommendation .actions {
    margin-top: 0.75rem;
    padding-left: 1.25rem;
    list-style: disc;
}

.recommendation .actions li {
    font-size: var(--font-size-sm);
    margin: 0.25rem 0;
    color: var(--color-text);
    line-height: 1.5;
}

.recommendation .book-ref {
    font-size: var(--font-size-xs);
    color: var(--color-primary);
    margin-top: 0.75rem;
    display: block;
    font-weight: 500;
}

/* Regulatory Flags */
.regulatory-flags {
    margin-top: 2rem;
    padding: 1rem 1.25rem;
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    border-radius: 4px;
}

.regulatory-flags h3 {
    font-size: var(--font-size-base);
    color: #92400e;
    margin-bottom: 0.5rem;
}

.regulatory-flags ul {
    list-style: none;
    padding: 0;
}

.regulatory-flags li {
    font-size: var(--font-size-sm);
    margin: 0.5rem 0;
    color: #78350f;
    padding-left: 1.25rem;
    position: relative;
    line-height: 1.5;
}

.regulatory-flags li::before {
    content: '⚠';
    position: absolute;
    left: 0;
    font-size: 0.75rem;
}

/* Pass/Fail Indicator */
.pass-indicator {
    margin-top: 1.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: 4px;
    font-size: var(--font-size-sm);
    font-weight: 600;
    text-align: center;
}
.pass-yes {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}
.pass-no {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

/* Mandatory Failures */
.mandatory-failures {
    margin-top: 2rem;
    padding: 1rem 1.25rem;
    background: #fee2e2;
    border-left: 4px solid #ef4444;
    border-radius: 4px;
}
.mandatory-failures h3 {
    font-size: var(--font-size-base);
    color: #991b1b;
    margin-bottom: 0.5rem;
}
.mandatory-failures p {
    font-size: var(--font-size-sm);
    color: #7f1d1d;
    margin-bottom: 0.75rem;
    line-height: 1.5;
}
.mandatory-failures ul { list-style: none; padding: 0; }
.mandatory-failures li {
    font-size: var(--font-size-sm);
    margin: 0.5rem 0;
    color: #7f1d1d;
    line-height: 1.5;
}

/* Category Penalties */
.category-penalties {
    margin-top: 1rem;
    padding: 1rem 1.25rem;
    background: #fff7ed;
    border-left: 4px solid #f97316;
    border-radius: 4px;
}
.category-penalties h3 {
    font-size: var(--font-size-base);
    color: #9a3412;
    margin-bottom: 0.5rem;
}
.category-penalties p {
    font-size: var(--font-size-sm);
    color: #7c2d12;
    margin-bottom: 0.5rem;
    line-height: 1.5;
}
.category-penalties ul { list-style: disc; padding-left: 1.25rem; }
.category-penalties li {
    font-size: var(--font-size-sm);
    color: #7c2d12;
}

/* Print & Reset Buttons */
.result-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

/* ================================
   Scorecard Footer
   ================================ */
/* Footer, export-meta, feedback, version-tag, btn-sm — now in tool-shared.css */

/* ================================
   Mobile
   ================================ */
@media (max-width: 640px) {
    .scorecard-container {
        padding: 1.25rem 1rem;
        padding-top: 4.5rem;
    }

    .scorecard-header h1 {
        font-size: var(--font-size-3xl);
    }

    .scorecard-intro {
        font-size: var(--font-size-base);
    }

    .question {
        padding: 1rem;
    }

    .results-panel {
        padding: 1.25rem;
    }

    .result-actions {
        flex-direction: column;
        align-items: center;
    }

    .result-actions .btn {
        width: 100%;
        max-width: 300px;
    }
}

/* ================================
   Print
   ================================ */
@media print {
    .navbar,
    #scorecardForm,
    .progress-bar-container,
    .result-actions,
    .scorecard-footer {
        display: none !important;
    }

    .scorecard-container {
        padding-top: 1rem;
        max-width: 100%;
    }

    .scorecard-header {
        margin-bottom: 1rem;
    }

    .results-panel {
        display: block !important;
        margin-top: 0;
        padding: 0;
        background: none;
        box-shadow: none;
    }

    .recommendation {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .regulatory-flags {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    body {
        font-size: 12pt;
    }
}

/* ========= v3 additions ========= */

.screener-intro { margin-bottom: 2rem; }
.screener-intro h2 { margin-bottom: .5rem; }
.screener-why { margin-top: 1rem; font-size: 0.95rem; color: #475569; }

.archetype-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.archetype-card {
    display: flex; gap: 1rem;
    text-align: left;
    padding: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: #ffffff;
    cursor: pointer;
    transition: border-color .15s, transform .15s;
}
.archetype-card:hover { border-color: #2563eb; }
.archetype-card.selected { border-color: #2563eb; background: #eff6ff; }
.archetype-num {
    font-size: 1.5rem; font-weight: 700; color: #2563eb;
    width: 2rem; text-align: center;
}
.archetype-body h3 { margin: 0 0 .25rem; font-size: 1rem; }
.archetype-body p { margin: 0 0 .5rem; font-size: .9rem; color: #475569; }
.archetype-bank-hint {
    font-size: .75rem; text-transform: uppercase;
    color: #64748b; letter-spacing: .5px;
}

.env-block { margin-bottom: 2rem; }
.env-block h3 { margin-bottom: .75rem; }
.env-list { display: grid; gap: .5rem; }
.env-option {
    display: flex; flex-direction: column; gap: .25rem;
    padding: .75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: #ffffff;
    text-align: left; cursor: pointer;
}
.env-option.selected { border-color: #2563eb; background: #eff6ff; }
.env-option span { font-size: .85rem; color: #475569; }

.screener-start-row { margin: 1.5rem 0 2.5rem; }

.archetype-medical {
    padding: 1rem 1.25rem;
    border: 1px dashed #94a3b8;
    border-radius: 12px;
    background: #f8fafc;
    margin-top: 1.5rem;
}
.archetype-medical h3 { margin: 0 0 .5rem; }

.assess-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: .75rem 0; margin-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
}
.assess-ctx-badge {
    font-size: .85rem; color: #475569;
    background: #f1f5f9; padding: .25rem .6rem; border-radius: 6px;
}

.standards-disclosure {
    margin-top: .5rem; font-size: .85rem;
}
.standards-disclosure summary {
    cursor: pointer; color: #2563eb;
}
.standards-disclosure ul { margin: .5rem 0 0 1rem; padding: 0; }
.standards-disclosure li { margin-bottom: .35rem; }

.caveat-panel {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    border-radius: 6px;
}
.caveat-panel h3 { margin: 0 0 .5rem; color: #78350f; }
.caveat-panel p { margin: 0 0 .5rem; font-size: .92rem; color: #1f2937; }
.caveat-panel p:last-child { margin-bottom: 0; }

.ceiling-banner {
    background: #fee2e2;
    border-left: 4px solid #ef4444;
    padding: 1rem 1.25rem;
    margin: 1rem 0;
    border-radius: 6px;
}
.ceiling-banner h3 { margin: 0 0 .5rem; color: #7f1d1d; }

.flag-section { margin-top: 1.5rem; }
.flag-section-mandatory h3 { color: #7f1d1d; }
.flag-section-advisory h3 { color: #78350f; }
.flag-chip {
    display: inline-block;
    font-size: .75rem;
    background: #e2e8f0;
    padding: .15rem .5rem;
    border-radius: 4px;
    margin-right: .5rem;
}

.medical-page { max-width: 720px; margin: 0 auto; }
.medical-page h2 { margin-bottom: 1rem; }
.medical-page h3 { margin-top: 1.5rem; }
.medical-teaser li, .medical-sources li { margin-bottom: .5rem; }

.v3-modal-overlay {
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, 0.6);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000;
}
.v3-modal {
    background: #fff; padding: 2rem;
    max-width: 480px; border-radius: 12px;
}
.v3-modal h2 { margin-top: 0; }
.v3-modal button { margin-top: 1rem; }

.btn-link {
    background: none; border: none; padding: 0;
    color: #2563eb; text-decoration: underline; cursor: pointer;
}
