/* Petite salle de bain : plans types (SVG) + outil "Qu'est-ce qui rentre ?" */

/* ---------- Plans types ---------- */
.sps-plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.2rem;
  margin: 2rem 0 1rem;
}
.sps-plan-card {
  margin: 0;
  background: #fff;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 1rem 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  scroll-margin-top: calc(var(--header-h, 80px) + 1rem);
  transition: box-shadow var(--tr), border-color var(--tr);
}
.sps-plan-card:target,
.sps-plan-card.is-suggested {
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, .18);
}
.sps-plan-card__tag {
  align-self: flex-start;
  font-family: var(--ff-head);
  font-weight: 700;
  font-size: .72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--c-accent-dark);
  background: rgba(249, 115, 22, .1);
  border-radius: 999px;
  padding: .25rem .7rem;
  margin-bottom: .6rem;
}
.sps-plan-card h3 { font-size: 1.02rem; margin: 0 0 .6rem; color: var(--c-primary); }
.sps-plan-card figcaption { font-size: .88rem; color: var(--c-muted); line-height: 1.55; margin-top: .7rem; }
.sps-plan-card figcaption strong { color: var(--c-text); }
.sps-plan { display: block; width: 100%; height: auto; max-height: 340px; }

.sps-plan .p-floor { fill: #f8fafc; }
.sps-plan .p-wall { fill: none; stroke: var(--c-primary); stroke-width: 6; }
.sps-plan .p-shower { fill: #e0f2fe; }
.sps-plan .p-drain { stroke: #0369a1; stroke-width: 3; stroke-linecap: round; }
.sps-plan .p-drainc { fill: #fff; stroke: #0369a1; stroke-width: 2; }
.sps-plan .p-glass { stroke: #38bdf8; stroke-width: 3; stroke-linecap: round; }
.sps-plan .p-fix { fill: #fff; stroke: var(--c-primary); stroke-width: 1.6; }
.sps-plan .p-inner { fill: #f1f5f9; stroke: var(--c-primary-light); stroke-width: 1.2; }
.sps-plan .p-frame { fill: #e2e8f0; stroke: #94a3b8; stroke-width: 1; stroke-dasharray: 3 2; }
.sps-plan .p-cab { fill: #e2e8f0; stroke: #94a3b8; stroke-width: 1; }
.sps-plan .p-niche { fill: #fff; stroke: #0369a1; stroke-width: 1.2; stroke-dasharray: 3 2; }
.sps-plan .p-part { stroke: var(--c-primary); stroke-width: 4; }
.sps-plan .p-rail { fill: var(--c-accent-light); }
.sps-plan .p-circ { fill: rgba(249, 115, 22, .08); stroke: var(--c-accent); stroke-width: 1.2; stroke-dasharray: 5 4; }
.sps-plan .p-gap { fill: #f8fafc; }
.sps-plan .p-pocket { fill: none; stroke: #94a3b8; stroke-width: 1; stroke-dasharray: 3 2; }
.sps-plan .p-leaf { stroke: var(--c-accent-dark); stroke-width: 3; stroke-linecap: round; }
.sps-plan .p-swing { fill: none; stroke: var(--c-accent); stroke-width: 1; stroke-dasharray: 4 3; }
.sps-plan .p-dim line { stroke: #94a3b8; stroke-width: 1; }
.sps-plan text { font-family: var(--ff-sans, 'Inter', system-ui, sans-serif); fill: var(--c-primary); }
.sps-plan .p-lbl { font-size: 9.5px; font-weight: 600; }
.sps-plan .p-lbl--s { font-size: 8.5px; }
.sps-plan .p-lbl--xs { font-size: 7.5px; font-weight: 500; fill: var(--c-muted); }
.sps-plan .p-lbl--c { font-size: 9px; fill: var(--c-accent-dark); font-weight: 700; }
.sps-plan .p-dimt { font-size: 9px; fill: var(--c-muted); }

.sps-legend {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.2rem;
  list-style: none;
  padding: 0;
  margin: .4rem 0 1.5rem;
  font-size: .82rem;
  color: var(--c-muted);
}
.sps-legend li { display: inline-flex; align-items: center; gap: .45rem; }
.sps-legend i { display: inline-block; width: 18px; height: 12px; border-radius: 3px; }
.sps-legend .l-shower { background: #e0f2fe; border: 1px solid #7dd3fc; }
.sps-legend .l-glass { height: 3px; background: #38bdf8; }
.sps-legend .l-circ { background: rgba(249, 115, 22, .08); border: 1.5px dashed var(--c-accent); }
.sps-legend .l-frame { background: #e2e8f0; border: 1px dashed #94a3b8; }
.sps-legend .l-rail { width: 6px; background: var(--c-accent-light); }
.sps-legend .l-door { height: 3px; background: var(--c-accent-dark); }

/* ---------- Tableau de cotes ---------- */
.sps-cotes td:last-child { white-space: nowrap; }

/* ---------- Outil ---------- */
.sps-tool {
  margin: 2rem 0;
  border-radius: var(--radius-lg);
  border: 1px solid var(--c-border);
  background: #fff;
  box-shadow: var(--shadow);
  overflow: hidden;
  scroll-margin-top: calc(var(--header-h, 80px) + 1rem);
}
.sps-tool__head {
  background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-primary-light) 100%);
  color: #fff;
  padding: 1.4rem 1.6rem;
}
.sps-tool__head h3 { color: #fff; margin: 0; font-size: 1.2rem; }
.sps-tool__head p { margin: .4rem 0 0; color: #cbd5e1; font-size: .9rem; }
.sps-tool__body { padding: 1.6rem; display: grid; gap: 1.4rem; }
.sps-tool fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.sps-tool__legend,
.sps-tool__label {
  display: block;
  font-family: var(--ff-head);
  font-weight: 700;
  font-size: .78rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--c-primary);
  margin-bottom: .7rem;
}
.sps-dims { display: grid; grid-template-columns: 1fr auto 1fr; gap: .6rem; align-items: end; }
.sps-dims label { display: block; font-size: .85rem; color: var(--c-muted); margin-bottom: .3rem; }
.sps-dims__x { padding-bottom: .8rem; font-weight: 700; color: var(--c-muted); }
.sps-input { position: relative; }
.sps-input input {
  width: 100%;
  padding: .75rem 2.8rem .75rem 1rem;
  border-radius: var(--radius);
  border: 1.5px solid var(--c-border);
  font: inherit;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--c-primary);
  background: #fff;
  -moz-appearance: textfield;
}
.sps-input input::-webkit-outer-spin-button,
.sps-input input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.sps-input input:focus { outline: 2px solid var(--c-accent); outline-offset: 1px; }
.sps-input span { position: absolute; right: 1rem; top: 50%; transform: translateY(-50%); color: var(--c-muted); font-size: .9rem; pointer-events: none; }
.sps-area { margin: .6rem 0 0; font-size: .9rem; color: var(--c-muted); }
.sps-area b { color: var(--c-primary); font-family: var(--ff-head); }

.sps-chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.sps-chip { position: relative; }
.sps-chip input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.sps-chip span {
  display: block;
  padding: .6rem 1rem;
  border-radius: 999px;
  border: 1.5px solid var(--c-border);
  background: #fff;
  font-size: .9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--tr);
}
.sps-chip input:hover + span { border-color: var(--c-accent-light); }
.sps-chip input:checked + span { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.sps-chip input:focus-visible + span { outline: 2px solid var(--c-accent); outline-offset: 2px; }
.sps-chip--check input:checked + span { background: #fff7ed; border-color: var(--c-accent); color: var(--c-text); }
.sps-chip--check span::before { content: '+ '; color: var(--c-accent); font-weight: 700; }
.sps-chip--check input:checked + span::before { content: '✓ '; }

.sps-result { border-top: 1px solid var(--c-border); background: var(--c-bg-alt); padding: 1.6rem; }
.sps-verdict {
  display: flex;
  gap: .9rem;
  align-items: flex-start;
  padding: 1rem 1.1rem;
  border-radius: var(--radius);
  border: 1.5px solid var(--c-border);
  background: #fff;
}
.sps-verdict__dot { flex: 0 0 auto; width: 14px; height: 14px; border-radius: 50%; margin-top: .35rem; background: var(--c-muted); }
.sps-verdict strong { display: block; font-family: var(--ff-head); color: var(--c-primary); font-size: 1.08rem; line-height: 1.3; }
.sps-verdict p { margin: .25rem 0 0; font-size: .9rem; color: var(--c-muted); }
.sps-verdict[data-level="ok"] { border-color: #86efac; background: #f0fdf4; }
.sps-verdict[data-level="ok"] .sps-verdict__dot { background: var(--c-success); }
.sps-verdict[data-level="tight"] { border-color: #fdba74; background: #fff7ed; }
.sps-verdict[data-level="tight"] .sps-verdict__dot { background: var(--c-accent); }
.sps-verdict[data-level="hard"] { border-color: #fcd34d; background: #fffbeb; }
.sps-verdict[data-level="hard"] .sps-verdict__dot { background: #d97706; }
.sps-verdict[data-level="no"] { border-color: #fca5a5; background: #fef2f2; }
.sps-verdict[data-level="no"] .sps-verdict__dot { background: var(--c-danger); }

.sps-gauge { margin: 1.2rem 0 .4rem; }
.sps-gauge__row { display: flex; justify-content: space-between; gap: 1rem; font-size: .88rem; color: var(--c-muted); margin-bottom: .35rem; }
.sps-gauge__row b { color: var(--c-primary); font-family: var(--ff-head); white-space: nowrap; }
.sps-gauge__bar { position: relative; height: 12px; border-radius: 999px; background: var(--c-border); overflow: hidden; }
.sps-gauge__fill { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 999px; background: var(--c-success); transition: width .35s ease, background .35s ease; }
.sps-gauge__fill[data-level="tight"] { background: var(--c-accent); }
.sps-gauge__fill[data-level="hard"] { background: #d97706; }
.sps-gauge__fill[data-level="no"] { background: var(--c-danger); }

.sps-list { list-style: none; padding: 0; margin: 1rem 0 0; }
.sps-list li { display: flex; justify-content: space-between; gap: 1rem; padding: .5rem 0; border-bottom: 1px dashed var(--c-border); font-size: .9rem; }
.sps-list li:last-child { border-bottom: 0; }
.sps-list li b { font-family: var(--ff-head); color: var(--c-primary); white-space: nowrap; }
.sps-list li.is-total { border-top: 2px solid var(--c-primary); border-bottom: 0; margin-top: .3rem; padding-top: .7rem; font-weight: 600; }

.sps-tips { margin: 1.2rem 0 0; padding: 0; list-style: none; display: grid; gap: .5rem; }
.sps-tips li { position: relative; padding: .7rem .9rem .7rem 2.2rem; background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius-sm); font-size: .9rem; line-height: 1.5; }
.sps-tips li::before { content: '!'; position: absolute; left: .75rem; top: .72rem; width: 18px; height: 18px; border-radius: 50%; background: var(--c-accent); color: #fff; font-size: .72rem; font-weight: 700; display: grid; place-items: center; }
.sps-tips li.is-block::before { background: var(--c-danger); }
.sps-tips li.is-tip::before { content: 'i'; background: var(--c-primary-light); }

.sps-suggest {
  margin: 1.2rem 0 0;
  padding: 1rem 1.1rem;
  border-radius: var(--radius);
  background: #fff;
  border: 1px solid var(--c-border);
  font-size: .92rem;
}
.sps-suggest a { font-weight: 600; color: var(--c-accent-dark); }
.sps-result .btn { margin-top: 1.2rem; }
.sps-note { font-size: .8rem; color: var(--c-muted); margin: 1rem 0 0; line-height: 1.6; }

@media (max-width: 560px) {
  .sps-tool__body, .sps-result { padding: 1.2rem; }
  .sps-tool__head { padding: 1.2rem; }
  .sps-dims { grid-template-columns: 1fr 1fr; }
  .sps-dims__x { display: none; }
  .sps-plans { grid-template-columns: 1fr; }
}
