/* Shared styles for interactive tools in /werkzeuge/
 * - Wizard progress + step flow
 * - Radio/checkbox options
 * - Result panels with traffic-light badges
 * - Form controls for Richtlinien-Generator
 * - Modell-Canvas grid
 */

/* ===== Wizard progress ===== */
.wizard-progress {
    width: 100%;
    height: 6px;
    background: var(--border, #d4d4d8);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 0.4rem;
}
.wizard-progress-bar {
    height: 100%;
    background: var(--primary, #18181b);
    transition: width 0.3s ease;
}
.wizard-progress-label {
    font-size: 0.85rem;
    color: var(--muted, #71717a);
    margin: 0 0 1.5rem 0;
}

/* ===== Wizard steps ===== */
.wizard-step {
    border: 0;
    padding: 0;
    margin: 0 0 1.5rem 0;
    display: none;
}
.wizard-step.active { display: block; }
.wizard-step legend {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text, #18181b);
    margin-bottom: 0.75rem;
    padding: 0;
}
.wizard-hint {
    color: var(--muted, #71717a);
    font-size: 0.9rem;
    margin: -0.25rem 0 0.75rem 0;
    max-width: 60ch;
}

/* Radio/checkbox option cards */
.wizard-option {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    border: 1.5px solid var(--border, #d4d4d8);
    border-radius: 10px;
    cursor: pointer;
    margin-bottom: 0.6rem;
    transition: border-color 0.15s ease, background-color 0.15s ease;
    background: var(--background, #fff);
}
.wizard-option:hover,
.wizard-option:focus-within {
    border-color: var(--primary, #18181b);
    background: var(--paper, #f4f4f5);
}
.wizard-option input[type="radio"],
.wizard-option input[type="checkbox"] {
    margin-top: 0.25rem;
    flex-shrink: 0;
}
.wizard-option input:checked ~ span {
    color: var(--primary, #18181b);
}
.wizard-option:has(input:checked) {
    border-color: var(--primary, #18181b);
    background: var(--paper, #f4f4f5);
}
.wizard-option small {
    display: block;
    color: var(--muted, #71717a);
    margin-top: 0.2rem;
    font-size: 0.85rem;
    line-height: 1.5;
}

/* ===== Navigation ===== */
.wizard-nav {
    display: flex;
    gap: 0.75rem;
    justify-content: space-between;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}
.wizard-nav .btn { min-width: 130px; }

/* ===== Result / traffic-light ===== */
.wizard-result {
    margin-top: 2rem;
    padding: 1.5rem;
    border-radius: 14px;
    background: var(--paper, #f4f4f5);
    border: 1.5px solid var(--border, #d4d4d8);
}
.result-badge {
    display: inline-block;
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.02em;
    margin-bottom: 0.75rem;
}
.result-badge.green { background: #dcfce7; color: #166534; }
.result-badge.yellow { background: #fef3c7; color: #854d0e; }
.result-badge.red { background: #fee2e2; color: #991b1b; }
.result-lead { font-size: 1.05rem; line-height: 1.6; margin: 0.5rem 0 1rem; max-width: 70ch; }
.wizard-result ul { margin: 0.5rem 0 1rem 1.1rem; }
.wizard-result li { margin-bottom: 0.35rem; color: var(--text, #18181b); line-height: 1.55; }
.result-reasons { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border, #d4d4d8); }
.result-reasons h3 { margin: 0 0 0.4rem; font-size: 1rem; }

/* ===== Form grid (generators) ===== */
.form-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 720px) {
    .form-grid { grid-template-columns: 1fr 1fr; }
    .form-grid .col-span-2 { grid-column: span 2; }
}
.form-grid label {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text, #18181b);
}
.form-grid label small {
    font-weight: 400;
    color: var(--muted, #71717a);
    font-size: 0.82rem;
}
.form-grid input[type="text"],
.form-grid input[type="number"],
.form-grid select,
.form-grid textarea {
    width: 100%;
    padding: 0.6rem 0.7rem;
    border: 1.5px solid var(--border, #d4d4d8);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 400;
    background: var(--background, #fff);
    color: var(--text, #18181b);
    transition: border-color 0.15s ease;
}
.form-grid textarea { min-height: 100px; resize: vertical; }
.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus {
    outline: none;
    border-color: var(--primary, #18181b);
}
.chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.25rem;
}
.chip-group label {
    font-weight: 400;
    font-size: 0.85rem;
    padding: 0.35rem 0.75rem;
    border: 1.5px solid var(--border, #d4d4d8);
    border-radius: 999px;
    cursor: pointer;
    background: var(--background, #fff);
    transition: border-color 0.15s ease, background-color 0.15s ease;
}
.chip-group label:has(input:checked) {
    border-color: var(--primary, #18181b);
    background: var(--paper, #f4f4f5);
    font-weight: 600;
}
.chip-group input { display: none; }

/* ===== Output panel (generators) ===== */
.tool-output {
    margin-top: 2rem;
    padding: 1.5rem;
    border: 1.5px solid var(--border, #d4d4d8);
    border-radius: 12px;
    background: var(--background, #fff);
}
.tool-output h1,
.tool-output h2,
.tool-output h3 { margin-top: 1.25rem; }
.tool-output h1:first-child,
.tool-output h2:first-child { margin-top: 0; }
.tool-output .output-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border, #d4d4d8);
}
.tool-output pre {
    font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
    background: var(--paper, #f4f4f5);
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ===== Readiness-check scorecards ===== */
.score-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin: 1rem 0; }
.score-card {
    padding: 1rem;
    border: 1.5px solid var(--border, #d4d4d8);
    border-radius: 10px;
    background: var(--background, #fff);
}
.score-card h3 { margin: 0 0 0.4rem; font-size: 1rem; }
.score-value { font-size: 2.2rem; font-weight: 700; color: var(--primary, #18181b); line-height: 1; }
.score-max { color: var(--muted, #71717a); font-size: 1rem; font-weight: 400; }
.score-bar {
    width: 100%;
    height: 4px;
    background: var(--border, #d4d4d8);
    border-radius: 999px;
    margin: 0.4rem 0;
    overflow: hidden;
}
.score-bar-fill { height: 100%; background: var(--primary, #18181b); transition: width 0.3s ease; }

/* ===== Canvas ===== */
.canvas-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr;
    margin-top: 1.5rem;
}
@media (min-width: 860px) {
    .canvas-grid { grid-template-columns: repeat(3, 1fr); }
    .canvas-grid .cell-wide { grid-column: span 3; }
}
.canvas-cell {
    border: 1.5px solid var(--border, #d4d4d8);
    border-radius: 10px;
    background: var(--background, #fff);
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    min-height: 140px;
}
.canvas-cell label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted, #71717a);
    margin-bottom: 0.35rem;
}
.canvas-cell textarea {
    flex: 1;
    border: 0;
    resize: none;
    background: transparent;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text, #18181b);
    line-height: 1.5;
    outline: none;
}

/* ===== Print styles ===== */
@media print {
    .nav, .nav-toggle, .breadcrumbs, .footer, .wizard-progress, .wizard-progress-label,
    .wizard-nav, #restartBtn, #shareBtn, #printBtn,
    .portal-chip-row, .output-actions { display: none !important; }
    .hero-expert { padding: 1rem 0 !important; }
    body { background: #fff !important; }
    .section { padding: 0.75rem 0 !important; break-inside: avoid; }
    .wizard-result, .tool-output, .canvas-cell { border-color: #000 !important; }
    a { color: #000 !important; text-decoration: underline; }
}

/* ===== Utility: visibility toggles (no JS flash) ===== */
[hidden] { display: none !important; }
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
