/* Security Requirements Generator — Styles */

.generator-container {
    max-width: 780px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
    padding-top: calc(var(--navbar-height, 64px) + 2rem);
}

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

/* ── Profile Inputs ── */

.profile-section {
    margin-bottom: 2rem;
}

.profile-section h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-text, #1e293b);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-border, #e2e8f0);
}

.profile-section p.section-hint {
    font-size: 0.875rem;
    color: var(--color-text-muted, #94a3b8);
    margin-bottom: 0.75rem;
}

/* Radio groups */
.option-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.option-grid label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--color-text, #1e293b);
    transition: background 150ms, border-color 150ms;
    line-height: 1.4;
}

.option-grid label:hover {
    background: var(--color-bg-alt, #f8fafc);
}

.option-grid label.selected {
    background: #eff6ff;
    border-color: var(--color-primary, #2563eb);
}

.option-grid input[type="radio"],
.option-grid input[type="checkbox"] {
    accent-color: var(--color-primary, #2563eb);
    margin: 0;
    flex-shrink: 0;
}

/* Checkbox groups — same styling */
.checkbox-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.checkbox-grid label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--color-text, #1e293b);
    transition: background 150ms, border-color 150ms;
    line-height: 1.4;
}

.checkbox-grid label:hover {
    background: var(--color-bg-alt, #f8fafc);
}

.checkbox-grid label.checked {
    background: #eff6ff;
    border-color: var(--color-primary, #2563eb);
}

/* ── Form Actions ── */

.form-actions {
    text-align: center;
    margin-top: 2rem;
    margin-bottom: 2rem;
}

#generateBtn {
    padding: 0.75rem 2.5rem;
    font-size: 1rem;
    font-weight: 600;
}

/* ── Results Panel ── */

.results-header {
    margin-bottom: 1.5rem;
}

.results-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text, #1e293b);
    margin-bottom: 0.5rem;
}

.results-summary {
    font-size: 0.95rem;
    color: var(--color-text-light, #64748b);
    line-height: 1.6;
}

/* Export + Filter */

.export-actions {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.export-spacer {
    flex-grow: 1;
}

.filter-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.filter-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-light, #64748b);
}

.filter-btn {
    padding: 0.3rem 0.75rem;
    font-size: 0.8rem;
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: 4px;
    background: white;
    color: var(--color-text-light, #64748b);
    cursor: pointer;
    transition: all 150ms;
}

.filter-btn:hover {
    background: var(--color-bg-alt, #f8fafc);
}

.filter-btn.active {
    background: var(--color-primary, #2563eb);
    color: white;
    border-color: var(--color-primary, #2563eb);
}

/* ── Lifecycle Stage Groups ── */

.stage-group {
    margin-bottom: 2rem;
}

.stage-group h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--color-text, #1e293b);
    margin-bottom: 0.75rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid var(--color-border, #e2e8f0);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stage-icon {
    font-size: 1rem;
    opacity: 0.7;
}

.stage-count {
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--color-text-muted, #94a3b8);
    margin-left: auto;
}

/* ── Requirement Cards ── */

.requirement-card {
    background: white;
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    transition: border-color 200ms;
}

.requirement-card:hover {
    border-color: var(--color-primary-light, #3b82f6);
}

.requirement-card.hidden {
    display: none;
}

.requirement-card.excluded {
    opacity: 0.4;
    border-style: dashed;
}

.requirement-card.excluded .req-body,
.requirement-card.excluded .req-meta {
    display: none;
}

.req-exclude-btn {
    margin-left: auto;
    flex-shrink: 0;
    background: none;
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: 4px;
    color: var(--color-text-muted, #94a3b8);
    font-size: 1.1rem;
    line-height: 1;
    width: 1.6rem;
    height: 1.6rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 150ms;
}

.req-exclude-btn:hover {
    background: #fef2f2;
    border-color: #fecaca;
    color: var(--color-danger, #ef4444);
}

.req-restore-btn {
    margin-left: auto;
    flex-shrink: 0;
    background: none;
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: 4px;
    color: var(--color-primary, #2563eb);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    cursor: pointer;
    transition: all 150ms;
}

.req-restore-btn:hover {
    background: #eff6ff;
    border-color: var(--color-primary, #2563eb);
}

.req-header {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    margin-bottom: 0.5rem;
}

.req-priority {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-radius: 3px;
    flex-shrink: 0;
    margin-top: 0.15rem;
}

.req-priority.mandatory {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.req-priority.recommended {
    background: #fffbeb;
    color: #d97706;
    border: 1px solid #fde68a;
}

.req-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-text, #1e293b);
    line-height: 1.4;
}

.req-body {
    font-size: 0.875rem;
    color: var(--color-text-light, #64748b);
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.req-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.75rem;
    color: var(--color-text-muted, #94a3b8);
}

.req-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.req-meta .etsi-tag {
    background: var(--color-bg-alt, #f8fafc);
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    border: 1px solid var(--color-border-light, #f1f5f9);
    font-family: monospace;
    font-size: 0.7rem;
}

.impact-critical { color: var(--color-danger, #ef4444); font-weight: 600; }
.impact-high { color: var(--color-warning, #f59e0b); }
.impact-medium { color: var(--color-text-muted, #94a3b8); }

.req-owner strong {
    color: var(--color-text, #1e293b);
}

.req-also {
    font-size: 0.72rem;
    color: var(--color-text-muted, #94a3b8);
    font-style: italic;
    margin-top: 0.25rem;
}

.complexity-low { color: var(--color-success, #10b981); }
.complexity-medium { color: var(--color-warning, #f59e0b); }
.complexity-high { color: var(--color-danger, #ef4444); }

/* ── Compliance Section ── */

.compliance-note {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-left: 4px solid var(--color-primary, #2563eb);
    border-radius: 6px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}

.compliance-note h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-text, #1e293b);
    margin-bottom: 0.5rem;
}

.compliance-note ul {
    margin: 0;
    padding-left: 1.25rem;
    font-size: 0.85rem;
    color: var(--color-text-light, #64748b);
    line-height: 1.7;
}

/* Feedback, footer, version-tag — now in tool-shared.css */

/* ── Responsive ── */

@media (min-width: 768px) {
    .generator-header h1 {
        font-size: 2.75rem;
    }
    .option-grid,
    .checkbox-grid {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

@media (max-width: 640px) {
    .generator-container {
        padding: 1rem 1rem 3rem;
        padding-top: calc(var(--navbar-height, 64px) + 1rem);
    }
    .option-grid,
    .checkbox-grid {
        grid-template-columns: 1fr;
    }
    .export-actions {
        flex-direction: column;
    }
    .req-meta {
        flex-direction: column;
        gap: 0.25rem;
    }
}

@media print {
    .navbar, #profileForm, .export-actions, .filter-bar, .generator-footer {
        display: none !important;
    }
    .generator-container {
        padding-top: 0;
    }
    #resultsPanel {
        display: block !important;
    }
    .requirement-card {
        break-inside: avoid;
        border: 1px solid #ccc;
    }
}

/* ========= v2 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: #fff;
    cursor: pointer;
    transition: border-color .15s;
}
.archetype-card:hover { border-color: #10b981; }
.archetype-card.selected { border-color: #10b981; background: #ecfdf5; }
.archetype-num {
    font-size: 1.5rem; font-weight: 700; color: #10b981;
    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: #fff;
    text-align: left; cursor: pointer;
}
.env-option.selected { border-color: #10b981; background: #ecfdf5; }
.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;
}

.profile-intro { margin-bottom: 1.5rem; }
.profile-intro h2 { margin-bottom: .5rem; }

.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; }

.stage-section { margin-top: 2rem; }
.stage-heading {
    display: flex; align-items: baseline; gap: 1rem;
    padding-bottom: .5rem;
    border-bottom: 2px solid #e2e8f0;
}
.stage-standards { font-size: .75rem; font-weight: 400; color: #64748b; letter-spacing: .5px; }

.req-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #94a3b8;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin: .75rem 0;
}
.req-card.priority-mandatory { border-left-color: #ef4444; }
.req-card.priority-recommended { border-left-color: #f59e0b; }
.req-card-header {
    display: flex; align-items: center; gap: .75rem;
    margin-bottom: .5rem;
}
.req-priority {
    font-size: .7rem; font-weight: 700; letter-spacing: .5px;
    padding: .15rem .5rem; border-radius: 4px;
    color: #fff;
}
.req-card.priority-mandatory .req-priority { background: #ef4444; }
.req-card.priority-recommended .req-priority { background: #f59e0b; }
.req-id {
    font-family: 'SF Mono', Menlo, monospace;
    font-size: .75rem;
    color: #64748b;
}
.req-title { margin: 0; font-size: 1rem; flex: 1; }

.req-standards { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .5rem; }
.req-chip {
    font-size: .7rem;
    background: #e2e8f0;
    color: #1f2937;
    padding: .2rem .5rem;
    border-radius: 4px;
    text-decoration: none;
}
.req-chip:hover { background: #cbd5e1; }

.req-body { margin: .5rem 0; font-size: .95rem; }
.req-meta { font-size: .8rem; color: #475569; margin-top: .5rem; }

.req-variant, .req-why {
    margin-top: .5rem; font-size: .85rem;
}
.req-variant summary, .req-why summary {
    cursor: pointer; color: #2563eb;
}
.req-variant-note { font-style: italic; color: #475569; }

.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;
}

.no-results {
    text-align: center;
    color: #64748b;
    padding: 2rem;
}
