/* Shared styles for companion site tools */

/* ── Tool Hero ── */

.tool-hero {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2.5rem;
    align-items: center;
    margin-bottom: 2.5rem;
    padding: 2.5rem 2.5rem 2rem;
    background: var(--color-bg-dark, #0f172a);
    border-radius: 12px;
    color: white;
}

.tool-hero-text h1 {
    font-size: 2.25rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.tool-hero-text .tool-badge-inline {
    display: inline-block;
    padding: 0.25rem 0.7rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 4px;
    background: var(--color-primary, #2563eb);
    color: white;
    margin-bottom: 0.75rem;
}

.tool-hero-text .tool-audience {
    font-size: 0.85rem;
    color: #94a3b8;
    margin-top: 0.75rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 0.75rem;
}

.tool-hero-text p {
    font-size: 1.05rem;
    color: #cbd5e1;
    line-height: 1.7;
}

.tool-hero-text a {
    color: #60a5fa;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.tool-hero-visual {
    width: 160px;
    height: 160px;
    flex-shrink: 0;
}

/* Scorecard visual — grade ring */
.hero-grade-ring {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    border: 6px solid rgba(255,255,255,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: rgba(255,255,255,0.05);
}

.hero-grade-ring::before {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 6px solid transparent;
    border-top-color: #10b981;
    border-right-color: #10b981;
    border-bottom-color: #f59e0b;
    transform: rotate(-45deg);
}

.hero-grade-letter {
    font-size: 3rem;
    font-weight: 700;
    color: white;
    z-index: 1;
}

.hero-grade-sub {
    position: absolute;
    bottom: 18px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    z-index: 1;
}

/* Generator visual — lifecycle flow */
.hero-lifecycle {
    width: 160px;
    height: 160px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.5rem;
}

.hero-lifecycle-step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #cbd5e1;
}

.hero-lifecycle-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 8px rgba(255,255,255,0.15);
}

.hero-lifecycle-step:nth-child(1) .hero-lifecycle-dot { background: #3b82f6; }
.hero-lifecycle-step:nth-child(2) .hero-lifecycle-dot { background: #10b981; }
.hero-lifecycle-step:nth-child(3) .hero-lifecycle-dot { background: #f59e0b; }
.hero-lifecycle-step:nth-child(4) .hero-lifecycle-dot { background: #8b5cf6; }

.hero-lifecycle-line {
    width: 2px;
    height: 10px;
    background: rgba(255,255,255,0.15);
    margin-left: 5px;
}

/* ── Tool Footer (shared) ── */

.tool-footer {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border, #e2e8f0);
    font-size: 0.8rem;
    color: var(--color-text-muted, #94a3b8);
    line-height: 1.6;
    text-align: left;
}

.tool-footer a {
    color: var(--color-primary, #2563eb);
}

.tool-footer .tool-footer-book {
    margin-bottom: 0.5rem;
}

.tool-footer .tool-footer-standards {
    font-size: 0.75rem;
    margin-bottom: 0.5rem;
}

.tool-footer .tool-footer-version {
    font-family: monospace;
    font-size: 0.75rem;
    color: var(--color-text-muted, #94a3b8);
    margin-top: 0.75rem;
    text-align: right;
}

/* ── Feedback (shared) ── */

.feedback-section {
    background: var(--color-bg-alt, #f8fafc);
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    margin-top: 2.5rem;
}

.feedback-section h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-text, #1e293b);
    margin-bottom: 0.4rem;
}

.feedback-section > p {
    font-size: 0.825rem;
    color: var(--color-text-light, #64748b);
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.feedback-section textarea {
    width: 100%;
    padding: 0.5rem 0.625rem;
    font-size: 0.85rem;
    font-family: inherit;
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: 4px;
    color: var(--color-text, #1e293b);
    background: white;
    box-sizing: border-box;
    resize: vertical;
    min-height: 2.5rem;
}

.feedback-section textarea:focus {
    outline: none;
    border-color: var(--color-primary, #2563eb);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.feedback-actions {
    margin-top: 0.625rem;
}

/* ── Export Meta (shared) ── */

.export-meta {
    background: var(--color-bg-alt, #f8fafc);
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}

.export-meta-row {
    margin-bottom: 0.75rem;
}

.export-meta-row:last-child {
    margin-bottom: 0;
}

.export-meta-row label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text, #1e293b);
    margin-bottom: 0.3rem;
}

.export-meta-row .optional {
    font-weight: 400;
    color: var(--color-text-muted, #94a3b8);
}

.export-meta-row input,
.export-meta-row textarea {
    width: 100%;
    padding: 0.5rem 0.625rem;
    font-size: 0.875rem;
    font-family: inherit;
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: 4px;
    color: var(--color-text, #1e293b);
    background: white;
    box-sizing: border-box;
}

.export-meta-row input:focus,
.export-meta-row textarea:focus {
    outline: none;
    border-color: var(--color-primary, #2563eb);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.export-meta-row textarea {
    resize: vertical;
    min-height: 2.5rem;
}

.btn-sm {
    padding: 0.4rem 0.875rem;
    font-size: 0.8rem;
}

/* ── Regulatory Landscape Screen ── */

.reg-intro {
    margin-bottom: 1.5rem;
}

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

.reg-intro p {
    color: var(--color-text-muted, #64748b);
    line-height: 1.6;
}

.reg-table-wrap {
    margin-bottom: 1.5rem;
    overflow-x: auto;
}

.reg-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.reg-table th {
    text-align: left;
    padding: 0.625rem 0.75rem;
    font-weight: 600;
    color: var(--color-text, #1e293b);
    border-bottom: 2px solid var(--color-border, #e2e8f0);
    background: var(--color-bg-alt, #f8fafc);
}

.reg-table td {
    padding: 0.625rem 0.75rem;
    border-bottom: 1px solid var(--color-border, #e2e8f0);
    vertical-align: top;
}

.reg-table a {
    color: var(--color-primary, #2563eb);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.reg-scope-cell {
    font-size: 0.8rem;
    color: var(--color-text-muted, #64748b);
    max-width: 300px;
}

.reg-manual-row {
    background: rgba(16, 185, 129, 0.05);
}

.reg-manual-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    background: #10b981;
    color: white;
    vertical-align: middle;
    margin-left: 0.4rem;
}

.reg-removed-row {
    opacity: 0.45;
}

.reg-removed-text {
    text-decoration: line-through;
}

.reg-removed-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    background: #ef4444;
    color: white;
    vertical-align: middle;
    margin-left: 0.4rem;
}

.reg-remove-btn,
.reg-restore-btn {
    background: none;
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    padding: 0.15rem 0.5rem;
    color: var(--color-text-muted, #64748b);
    transition: background 0.15s, color 0.15s;
}

.reg-remove-btn:hover {
    background: #fef2f2;
    color: #ef4444;
    border-color: #ef4444;
}

.reg-restore-btn:hover {
    background: #f0fdf4;
    color: #10b981;
    border-color: #10b981;
}

.reg-add-block {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.reg-add-block label {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--color-text, #1e293b);
}

.reg-add-block select {
    padding: 0.4rem 0.625rem;
    font-size: 0.85rem;
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: 4px;
    background: white;
    color: var(--color-text, #1e293b);
    min-width: 280px;
}

.reg-focus-block {
    margin-bottom: 1.5rem;
    padding: 0.75rem 1rem;
    background: var(--color-bg-alt, #f8fafc);
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: 6px;
}

.reg-focus-label {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--color-text, #1e293b);
    line-height: 1.5;
    cursor: pointer;
}

.reg-focus-label input[type="checkbox"] {
    margin-top: 0.2rem;
}

.reg-proceed-row {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

/* ── Regulatory Scope Bar (Results) ── */

.reg-scope-bar {
    padding: 0.75rem 1rem;
    background: var(--color-bg-alt, #f8fafc);
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: 6px;
    margin-bottom: 1.25rem;
    font-size: 0.85rem;
    line-height: 1.8;
}

.reg-scope-chip {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    background: white;
    border: 1px solid var(--color-border, #e2e8f0);
    border-radius: 4px;
    font-size: 0.8rem;
    margin: 0.15rem 0.2rem;
}

.reg-focus-indicator {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    background: var(--color-primary, #2563eb);
    color: white;
    margin-left: 0.5rem;
    vertical-align: middle;
}

/* ── Suggested Frameworks (Regulatory Landscape) ── */

.reg-suggested-block {
    margin-bottom: 1.5rem;
    padding: 1rem 1.25rem;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
}

.reg-suggested-block h3 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
    color: var(--color-text, #1e293b);
}

.reg-suggested-hint {
    font-size: 0.82rem;
    color: var(--color-text-muted, #64748b);
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.reg-suggested-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.reg-suggested-option {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--color-text, #1e293b);
    cursor: pointer;
    line-height: 1.5;
}

.reg-suggested-option input[type="checkbox"] {
    margin-top: 0.25rem;
}

/* ── Out-of-scope dimming ── */

.reg-out-of-scope {
    opacity: 0.35;
    transition: opacity 0.2s;
}

.reg-out-of-scope:hover {
    opacity: 0.7;
}

/* ── Organizational security note ── */

.reg-org-note {
    margin-top: 1.25rem;
    padding: 1rem 1.25rem;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
}

.reg-org-note h3 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
    color: var(--color-text, #1e293b);
}

.reg-org-note p {
    font-size: 0.85rem;
    color: var(--color-text-muted, #64748b);
    line-height: 1.6;
}

/* ── Markets (Scorecard screener) ── */

.markets-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.5rem;
}

.market-checkbox {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.9rem;
    color: var(--color-text, #1e293b);
    cursor: pointer;
}

.screener-field-hint {
    font-size: 0.85rem;
    color: var(--color-text-muted, #64748b);
    margin-bottom: 0.75rem;
}

/* ── Responsive ── */

@media (max-width: 640px) {
    .tool-hero {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 1.75rem 1.5rem 1.5rem;
    }
    .tool-hero-visual {
        margin: 0 auto;
    }
    .tool-hero-text h1 {
        font-size: 1.75rem;
    }
    .tool-footer {
        text-align: center;
    }
    .tool-footer .tool-footer-version {
        text-align: center;
    }
}

@media (min-width: 768px) {
    .tool-hero-text h1 {
        font-size: 2.75rem;
    }
}

@media print {
    .tool-hero-visual,
    .feedback-section {
        display: none !important;
    }
}
