/* Public calculators (/tools/*, /embed/*). Built on the site tokens in site.css; the embed layout
   loads this file on its own, so the few tokens it needs have fallbacks. Large targets and a visible
   focus ring throughout: many users are seniors or on a phone. */

.nde-tool {
    --tool-primary: var(--color-primary, #252d48);
    --tool-accent: var(--color-secondary, #2a9690);
    --tool-border: var(--color-border, #E2E8F0);
    --tool-muted: var(--color-text-muted, #4c4c4c);
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--color-text, #1E293B);
}

.nde-tool .tool-card {
    background: #fff;
    border: 1px solid var(--tool-border);
    border-radius: 16px;
    padding: 1.25rem;
    box-shadow: 0 2px 12px rgba(37,45,72,.08);
}

@media (max-width: 575.98px) {
    .nde-tool .tool-card { padding: 1rem .85rem; border-radius: 12px; }
}

.nde-tool .tool-progress-label { font-weight: 600; margin: .5rem 0 1rem; }
.nde-tool .progress { height: .6rem; border-radius: 999px; background: #eaebf0; }
.nde-tool .progress-bar { background: var(--tool-accent); border-radius: 999px; transition: width .25s ease; }

.nde-tool .tool-step h2 { font-size: 1.3rem; font-weight: 700; margin-bottom: 1rem; }
.nde-tool .tool-step:focus { outline: none; }

.nde-tool fieldset { border: 0; padding: 0; margin: 0 0 1.5rem; min-width: 0; }
.nde-tool legend { font-size: 1.08rem; font-weight: 700; margin-bottom: .4rem; float: none; width: auto; padding: 0; }
.nde-tool .tool-help { color: var(--tool-muted); font-size: .95rem; margin: -.1rem 0 .6rem; }

/* One option = one big tappable row. The input stays visible for screen readers and keyboard users. */
.nde-tool .tool-option {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    min-height: 48px;
    padding: .7rem .9rem;
    margin-bottom: .5rem;
    border: 2px solid var(--tool-border);
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    transition: border-color .15s, background-color .15s;
}
.nde-tool .tool-option:hover { border-color: #b8c3d6; }
.nde-tool .tool-option input { width: 1.35rem; height: 1.35rem; margin-top: .15rem; flex-shrink: 0; accent-color: var(--tool-accent); cursor: pointer; }
.nde-tool .tool-option:has(input:checked) { border-color: var(--tool-accent); background: #e4f4f3; }
.nde-tool .tool-option:has(input:focus-visible) { outline: 3px solid var(--tool-primary); outline-offset: 2px; }

.nde-tool .tool-inline { display: flex; flex-wrap: wrap; gap: .75rem; }
.nde-tool .tool-inline .tool-option { flex: 1 1 8rem; }
.nde-tool .tool-field label { font-weight: 600; display: block; margin-bottom: .3rem; }
.nde-tool .tool-field input, .nde-tool .tool-field select { min-height: 48px; font-size: 1.05rem; }

.nde-tool .tool-list { margin: 0 0 .6rem; padding-inline-start: 1.2rem; color: var(--tool-muted); }

.nde-tool .tool-error { color: #b42318; font-weight: 600; margin: .25rem 0 0; }
.nde-tool fieldset[aria-invalid="true"] .tool-option { border-color: #f1aeb5; }

.nde-tool .tool-nav { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: space-between; margin-top: 1rem; }
.nde-tool .tool-nav .btn, .nde-tool .tool-result .btn { min-height: 48px; padding-inline: 1.4rem; font-size: 1.05rem; border-radius: 999px; }

.nde-tool .btn:focus-visible, .nde-tool a:focus-visible, .nde-tool input:focus-visible,
.nde-tool select:focus-visible, .nde-tool textarea:focus-visible {
    outline: 3px solid var(--tool-primary);
    outline-offset: 2px;
    box-shadow: none;
}

/* ── Result ───────────────────────────────────────────────────────── */
.nde-tool .tool-result:focus { outline: none; }
.nde-tool .tool-outcome { border-radius: 14px; padding: 1rem 1.1rem; margin-bottom: 1rem; border: 2px solid; }
.nde-tool .tool-outcome h2 { font-size: 1.35rem; font-weight: 800; margin: 0 0 .25rem; }
.nde-tool .tool-outcome h2:focus { outline: none; }
.nde-tool .outcome-likely { background: #ecfdf3; border-color: #34a368; }
.nde-tool .outcome-possible { background: #fffaeb; border-color: #e0a106; }
.nde-tool .outcome-unlikely { background: #f8fafc; border-color: #94a3b8; }

.nde-tool .tool-disclaimer { background: #f1f5f9; border-inline-start: 4px solid var(--tool-primary); border-radius: 8px; padding: .8rem 1rem; margin: 1rem 0; font-size: .97rem; }
.nde-tool .tool-banner { background: #fff4e5; border: 1px solid #f5c26b; border-radius: 10px; padding: .65rem .9rem; margin-bottom: 1rem; font-weight: 600; }
.nde-tool .tool-banner.draft { background: #fdecec; border-color: #f1aeb5; }
.nde-tool .tool-steps-next { padding-inline-start: 1.2rem; }
.nde-tool .tool-steps-next li { margin-bottom: .75rem; }
.nde-tool .tool-cta-row { display: flex; flex-wrap: wrap; gap: .6rem; margin: .5rem 0 1rem; }

/* ── Embed code box on the tool page ───────────────────────────────── */
.tool-embed-code textarea { font-family: ui-monospace, Consolas, monospace; font-size: .85rem; direction: ltr; text-align: left; }

/* ── Printable "how to file" page ─────────────────────────────────── */
@media print {
    .site-header, .site-footer, .a11y-trigger, .a11y-panel, .no-print, .breadcrumb-nav { display: none !important; }
    body { background: #fff !important; }
    .print-sheet { box-shadow: none !important; border: 0 !important; padding: 0 !important; }
    .print-sheet a[href^="http"]::after { content: " (" attr(href) ")"; font-size: .8em; word-break: break-all; }
}

@media (prefers-reduced-motion: reduce) {
    .nde-tool .progress-bar, .nde-tool .tool-option { transition: none; }
}
