/* Product page of the compulsory fire and explosion insurance. */
.fire-page { --ink: var(--brand-primary); --fire: var(--brand-accent); --wash: var(--brand-soft); }

.page-jumps .container { display: flex; flex-wrap: wrap; gap: .5rem; padding-top: 1rem; padding-bottom: 1rem; }
.page-jumps a { display: inline-flex; align-items: center; min-height: 44px; padding: .4rem .9rem; background: var(--wash); color: var(--ink); font-weight: 600; line-height: 1.3; text-decoration: none; transition: background-color .15s ease, color .15s ease; }
.page-jumps a:hover { background: var(--ink); color: #fff; }

/* Checker: choose on the left, read the answer on the right. */
.tool { background: #fff; }
.tool-form { padding: clamp(20px, 3vw, 40px); }
.tool legend { margin-bottom: 1rem; color: var(--ink); font-size: 1.3rem; font-stretch: 80%; font-weight: 750; }
.tool .form-label { font-weight: 700; }
.tool .form-select, .tool .form-control, .tool .input-group-text { border: 2px solid var(--ink); }
.tool .input-group-text { background: var(--wash); font-weight: 700; }
.choice { display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: .35rem; width: 100%; height: 100%; padding: .6rem .5rem .8rem; border: 2px solid var(--rule); text-align: center; color: var(--ink); font-weight: 600; line-height: 1.3; cursor: pointer; transition: background-color .15s ease, border-color .15s ease, color .15s ease; }
.choice .art { width: 92px; }
.choice:hover { border-color: var(--ink); background: var(--wash); }
.btn-check:checked + .choice { border-color: var(--ink); background: var(--ink); color: #fff; }
.btn-check:focus-visible + .choice { outline: 3px solid #2f6fd6; outline-offset: 3px; }
.tool-hint { color: var(--muted); }
.tool-result { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 1.5rem; padding: clamp(24px, 3vw, 48px); background: #f4f7fd; transition: background-color .25s ease, color .25s ease; }
.landing .tool-result h3 { margin-bottom: 1rem; }
.tool-verdict { margin-bottom: .75rem; color: var(--ink); font-size: clamp(1.75rem, 2.5vw, 2.35rem); font-stretch: 74%; font-weight: 850; line-height: 1.08; text-wrap: balance; }
.tool-result-body p:last-child { margin: 0; font-size: 1.1rem; }
.tool-result[data-state="empty"] .tool-verdict { color: #66759a; }
.tool-result[data-state="no"] { background: #fff; }
.tool-result[data-state="yes"] { background: var(--ink); color: #fff; }
.landing .tool-result[data-state="yes"] h3, .tool-result[data-state="yes"] .tool-verdict { color: #fff; }
.tool-result[data-state="yes"] .tool-verdict::before { display: block; width: 40px; height: 40px; margin-bottom: 1rem; background: var(--fire); content: ''; }
.tool-result[data-state="yes"] :focus-visible { outline-color: #fff; }

/* The drawing. */
#scene { display: block; width: 100%; height: auto; }
#scene .face { stroke: var(--ink); stroke-width: 1.6; stroke-linejoin: round; transition: fill .45s ease, stroke .45s ease; }
#scene .top { fill: #fff; }
#scene .left { fill: #eef3fb; }
#scene .right { fill: url(#shade); }
#scene .hatch { stroke: #a9bbd9; stroke-width: 2.2; }
#scene .hatch-red { stroke: var(--fire); stroke-width: 2.6; }
#scene .wall { fill: #fff; fill-opacity: .6; stroke: var(--ink); stroke-width: 1.6; }
#scene .edge { fill: none; stroke: var(--ink); stroke-width: 1.6; }
#scene .pane { fill: #dde7f6; }
#scene .grid-line { stroke: var(--rule); stroke-width: 1; stroke-dasharray: 3 6; }
#scene .roof { fill: none; stroke: var(--rule); stroke-width: 1.6; stroke-dasharray: 10 8; transition: stroke .4s ease; }
#scene .bolt { fill: var(--fire); opacity: 0; }
#scene .is-hit .top { fill: #ffd9db; }
#scene .is-hit .left { fill: #f9a9ae; }
#scene .is-hit .right { fill: #ee6f77; }
#scene .is-hit .face, #scene .is-hit .edge, #scene .is-hit .roof { stroke: #a30f18; }
#scene [data-part="roof"].is-hit .bolt { opacity: 1; animation: strike .5s steps(2, end) 2; }
@keyframes strike { 50% { opacity: .15; } }
#scene .is-out .face { fill: url(#refused); stroke: var(--fire); stroke-width: 2.4; stroke-dasharray: 8 5; }
#scene .is-out .edge { stroke: var(--fire); }
#scene .ring { fill: var(--fire); fill-opacity: .07; stroke: var(--fire); stroke-width: 1.4; animation: spread .9s cubic-bezier(.15, .7, .2, 1) both; }
#scene .ring-0 { fill-opacity: 0; stroke-dasharray: 5 9; animation-delay: .24s; }
#scene .ring-1 { animation-delay: .12s; }
@keyframes spread { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }
#scene .note { cursor: pointer; }
#scene .note line { stroke: var(--ink); stroke-width: 1.6; }
#scene .note circle { fill: var(--ink); }
#scene .note rect { fill: #fff; stroke: var(--ink); stroke-width: 1.6; }
#scene .note text { fill: var(--ink); font-size: 28px; font-weight: 700; text-anchor: middle; }
#scene .note:hover rect, #scene .note.is-active rect { fill: var(--ink); }
#scene .note:hover text, #scene .note.is-active text { fill: #fff; }
.legend { display: flex; flex-wrap: wrap; gap: .5rem 2rem; margin: .5rem 0 0; font-size: .92rem; }
.legend li { display: flex; align-items: center; gap: .6rem; }
.key { width: 28px; height: 16px; border: 1.5px solid var(--fire); }
.key-hit { background: #f9a9ae; }
.key-refused { border-style: dashed; background: repeating-linear-gradient(45deg, #fff 0 3px, var(--fire) 3px 5px); }
.case { margin-bottom: .5rem; }
.case > button { display: flex; align-items: center; justify-content: space-between; gap: 1rem; width: 100%; padding: 1rem .9rem; border: 0; background: var(--wash); color: var(--ink); font-size: 1.2rem; font-stretch: 80%; font-weight: 750; line-height: 1.25; text-align: left; transition: background-color .15s ease; }
.case > button:hover { background: #d5e1f6; }
.case > button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.case-body { padding: 1.1rem .75rem .5rem; }
.landing .case-body h3 { margin: 0 0 .25rem; font-size: 1rem; font-stretch: 100%; font-weight: 800; }
.landing .case-body h3.is-refused { color: #c1121c; }

/* The scale. */
.scale-range { display: block; width: 100%; height: 44px; margin-bottom: 1.5rem; -webkit-appearance: none; appearance: none; background: transparent; --fill: 30%; }
.scale-range::-webkit-slider-runnable-track { height: 14px; border: 2px solid var(--ink); background: linear-gradient(90deg, var(--ink) var(--fill), #fff var(--fill)); }
.scale-range::-moz-range-track { height: 14px; border: 2px solid var(--ink); background: #fff; }
.scale-range::-moz-range-progress { height: 14px; background: var(--ink); }
.scale-range::-webkit-slider-thumb { width: 18px; height: 44px; margin-top: -17px; -webkit-appearance: none; border: 3px solid #fff; background: var(--fire); box-shadow: 0 0 0 2px var(--ink); cursor: grab; }
.scale-range::-moz-range-thumb { width: 14px; height: 40px; border: 3px solid #fff; border-radius: 0; background: var(--fire); cursor: grab; }
.fire-page output { font-weight: 850; }
.scale-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: .5rem; }
.scale-step { padding: 1.25rem 1.1rem; background: #fff; color: #6b7a96; transition: background-color .25s ease, color .25s ease; }
.scale-step.is-reached { background: var(--ink); color: #fff; }
.landing .scale-step h3 { margin-bottom: 1rem; font-size: clamp(1.45rem, 1.8vw, 1.7rem); font-stretch: 72%; font-weight: 800; line-height: 1.15; font-variant-numeric: tabular-nums; }
.landing .scale-step.is-reached h3 { color: #fff; }
.scale-step li { padding: .35rem 0; font-size: .95rem; line-height: 1.4; }
.scale-step ul { margin: 0; }
.scale-count { display: none; }

.case > button i { flex: none; font-size: 1.2rem; }
.case > button[aria-pressed="true"] i { color: #ff9aa0; }
.exclusion-list li > div { display: flex; gap: .75rem; height: 100%; padding: .75rem .9rem; background: var(--wash); }
.exclusion-list i { color: var(--fire); }
.scale-ticks { display: flex; justify-content: space-between; margin: -1rem 0 1.5rem; color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; }

/* Premium formula and claim steps. */
.formula { display: flex; flex-wrap: wrap; align-items: center; gap: .3em .6em; margin: 1.5rem 0 2.5rem; padding: 1.5rem; background: var(--wash); color: var(--ink); font-size: clamp(1.45rem, 2.4vw, 2.2rem); font-stretch: 74%; font-weight: 800; line-height: 1.15; }
.formula b { font-weight: 500; }
.actions { counter-reset: action; }
.actions li { counter-increment: action; }
.actions li > div { position: relative; padding: .75rem 0 .75rem 3rem; }
.actions li > div::before { position: absolute; top: .65rem; left: 0; font-size: 2rem; font-stretch: 66%; font-weight: 800; line-height: 1; content: counter(action); }
.actions p { margin: 0; }

@media (max-width: 991.98px) {
    #scene .notes { display: none; }
}
/* Phones and tablets: the four cases sit in a grid right under the drawing, the chosen text below them. */
@media (max-width: 991.98px) {
    .cases { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
    .case { display: contents; }
    .case > button { gap: .5rem; min-height: 64px; padding: .6rem .75rem; font-size: 1.05rem; }
    .case-body { grid-column: 1 / -1; order: 1; padding: .75rem .25rem 0; }
}
@media (max-width: 575.98px) {
    .scale-steps { grid-template-columns: 1fr !important; }
    /* Only the groups the chosen area reaches are listed; the others show how many they hold. */
    .scale-step:not(.is-reached) ul { display: none; }
    .landing .scale-step:not(.is-reached) h3 { display: flex; justify-content: space-between; align-items: baseline; margin: 0; }
    .scale-step:not(.is-reached) .scale-count { display: inline; font-size: 1rem; font-weight: 600; }
    .legend { margin-bottom: .5rem; font-size: .875rem; }
    #phi .art { width: 112px; }
    .choice .art { width: 84px; }
    .page-jumps .container { gap: .4rem; }
    .page-jumps a { padding: .35rem .7rem; font-size: .95rem; }
    .tool-result .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
    .fire-page *, #scene * { animation: none !important; transition: none !important; }
}

/* On narrow screens the drawing uses the full width and keeps its lines visible when scaled down. */
@media (max-width: 991.98px) {
    #scene { width: calc(100% + 32px); max-width: none; margin: 0 -16px; }
    #scene .face, #scene .edge, #scene .wall { stroke-width: .9; vector-effect: non-scaling-stroke; }
    #scene .grid-line, #scene .roof { vector-effect: non-scaling-stroke; stroke-width: .8; }
}
