/* ARACare Kostenrechner (mu-plugin ac-rechner) */
.ac-rc {
  --rc-pg: var(--ac-aqua);
  --rc-fd: var(--ac-green);
  --rc-ei: var(--ac-navy);
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr);
  grid-template-areas: "in out" "extra out" "form form";
  gap: 28px clamp(24px, 4vw, 48px);
  width: 100%;
  max-width: var(--ac-max);
  margin: 0 auto;
  text-align: left;
  font-family: var(--ac-font-body);
  color: var(--ac-text);
}
.ac-rc__in { grid-area: in; display: grid; gap: 18px; margin: 0; }
.ac-rc__out { grid-area: out; }
.ac-rc__extra { grid-area: extra; }
.ac-rc__form { grid-area: form; }

/* Schritte */
.ac-rc__step {
  margin: 0;
  padding: 22px clamp(18px, 3vw, 28px) 24px;
  border: 1px solid var(--ac-line);
  border-radius: var(--ac-radius-lg);
  background: #fff;
  box-shadow: var(--ac-shadow);
  min-width: 0;
  animation: acRcIn .7s var(--ac-ease) both;
  animation-delay: calc(var(--i) * 90ms);
  transition: border-color .3s, box-shadow .3s;
}
.ac-rc__step:focus-within { border-color: var(--ac-aqua); box-shadow: 0 0 0 4px rgba(108, 199, 187, .18), var(--ac-shadow); }
.ac-rc__step legend {
  float: left;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
  padding: 0;
  font: 600 1.12rem/1.3 var(--ac-font-head);
  color: var(--ac-ink);
}
.ac-rc__step legend + * { clear: both; }
.ac-rc__step legend b {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 50%;
  background: var(--ac-grad);
  color: #fff;
  font: 700 .9rem/1 var(--ac-font-body);
}
.ac-rc__hint { margin: 10px 0 0; font-size: .86rem; line-height: 1.5; color: var(--ac-muted); }

/* Chips (Bundesland) */
.ac-rc__chips { display: flex; flex-wrap: wrap; gap: 10px; }
.ac-rc__chip { position: relative; cursor: pointer; margin: 0; }
.ac-rc__chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.ac-rc__chip > span {
  display: inline-flex;
  align-items: center;
  padding: 10px 18px;
  border: 1.5px solid var(--ac-line);
  border-radius: 999px;
  background: var(--ac-mint-2);
  font-weight: 700;
  font-size: .95rem;
  color: var(--ac-ink);
  transition: background .25s, color .25s, border-color .25s, transform .35s var(--ac-spring), box-shadow .25s;
}
.ac-rc__chip:hover > span { border-color: var(--ac-aqua); transform: translateY(-2px); }
.ac-rc__chip input:checked + span { background: var(--ac-grad); border-color: transparent; color: #fff; box-shadow: 0 10px 22px -12px rgba(0, 114, 123, .8); transform: translateY(-2px) scale(1.03); }
.ac-rc__chip input:focus-visible + span { outline: 3px solid var(--ac-aqua); outline-offset: 3px; }

/* Pflegestufen 1-7 als Treppe */
.ac-rc__stufen { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; align-items: end; }
.ac-rc__stufen .ac-rc__chip > span {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 4px;
  width: 100%;
  min-height: calc(58px + var(--s) * 9px);
  padding: 10px 2px 9px;
  border-radius: 16px;
  text-align: center;
}
.ac-rc__stufen em { font: 600 1.35rem/1 var(--ac-font-head); font-style: normal; }
.ac-rc__stufen small { font-size: .7rem; font-weight: 600; opacity: .75; white-space: nowrap; }
.ac-rc__stufen .ac-rc__chip input:checked + span { transform: translateY(-4px); }

/* Schalter Demenz */
.ac-rc__switch { display: inline-flex; align-items: center; gap: 12px; margin-top: 16px; cursor: pointer; font-weight: 600; color: var(--ac-ink); position: relative; }
.ac-rc__switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ac-rc__knob { position: relative; width: 48px; height: 28px; flex: none; border-radius: 999px; background: #cfdadd; transition: background .3s; }
.ac-rc__knob::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 40, 76, .25); transition: transform .4s var(--ac-spring); }
.ac-rc__switch input:checked + .ac-rc__knob { background: var(--ac-green); }
.ac-rc__switch input:checked + .ac-rc__knob::after { transform: translateX(20px); }
.ac-rc__switch input:focus-visible + .ac-rc__knob { outline: 3px solid var(--ac-aqua); outline-offset: 3px; }

/* Schieberegler */
.ac-rc__range { display: flex; align-items: center; gap: 16px; }
.ac-rc__range output { min-width: 92px; padding: 8px 14px; border-radius: 12px; background: var(--ac-mint); font: 700 1.05rem/1 var(--ac-font-body); color: var(--ac-teal-600); text-align: center; font-variant-numeric: tabular-nums; }
.ac-rc input[type=range] { -webkit-appearance: none; appearance: none; flex: 1; height: 8px; margin: 0; border-radius: 999px; background: linear-gradient(90deg, var(--ac-teal), var(--ac-green)) 0 / var(--p, 50%) 100% no-repeat, #dbe7ea; cursor: pointer; }
.ac-rc input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; border-radius: 50%; background: #fff; border: 6px solid var(--ac-teal); box-shadow: 0 4px 12px -2px rgba(0, 40, 76, .35); transition: transform .3s var(--ac-spring); }
.ac-rc input[type=range]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 6px solid var(--ac-teal); box-shadow: 0 4px 12px -2px rgba(0, 40, 76, .35); }
.ac-rc input[type=range]:active::-webkit-slider-thumb { transform: scale(1.18); }
.ac-rc input[type=range]:focus-visible { outline: 3px solid var(--ac-aqua); outline-offset: 6px; }

.ac-rc__more { margin-top: 12px; }
.ac-rc__more summary { cursor: pointer; font-weight: 700; font-size: .92rem; color: var(--ac-teal); }
.ac-rc__nums { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; }
.ac-rc__nums label { display: grid; gap: 6px; font-size: .85rem; font-weight: 600; }
.ac-rc__nums select { min-width: 120px; padding: 9px 12px; border: 1.5px solid var(--ac-line); border-radius: 12px; background: #fff; font: inherit; color: var(--ac-ink); }

/* Ergebnis */
.ac-rc__out { position: relative; }
.ac-rc__card {
  position: sticky;
  top: calc(var(--ac-header-h) + 24px);
  padding: clamp(22px, 3vw, 32px);
  border-radius: var(--ac-radius-lg);
  background: var(--ac-grad);
  color: #fff;
  box-shadow: var(--ac-shadow-lg);
  overflow: hidden;
  isolation: isolate;
  animation: acRcIn .8s var(--ac-ease) .15s both;
}
.ac-rc__card::before, .ac-rc__card::after { content: ""; position: absolute; z-index: -1; border-radius: 50%; background: rgba(255, 255, 255, .08); animation: acRcFloat 9s ease-in-out infinite alternate; }
.ac-rc__card::before { width: 260px; height: 260px; top: -110px; right: -90px; }
.ac-rc__card::after { width: 180px; height: 180px; bottom: -70px; left: -60px; animation-delay: -4s; }
.ac-rc__card.is-pulse .ac-rc__big { animation: acRcPop .5s var(--ac-spring); }
.ac-rc__card { display: grid; grid-template-columns: minmax(0, 1fr) 128px; column-gap: 18px; align-items: center; }
.ac-rc__card > * { grid-column: 1 / -1; }
.ac-rc__card > .ac-rc__label, .ac-rc__card > .ac-rc__big, .ac-rc__card > .ac-rc__day { grid-column: 1; }
.ac-rc__card > .ac-rc__viz { grid-column: 2; grid-row: 1 / span 3; }
.ac-rc__label { margin: 0; font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; opacity: .85; }
.ac-rc__big { margin: 6px 0 2px; font: 600 clamp(2.3rem, 4.6vw, 3.2rem)/1.05 var(--ac-font-head); font-variant-numeric: tabular-nums; }
.ac-rc__day { margin: 0; opacity: .9; }
.ac-rc__day strong { font-variant-numeric: tabular-nums; }

.ac-rc__viz { position: relative; width: 128px; height: 128px; margin: 0; }
.ac-rc__ring { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.ac-rc__ring circle { fill: none; stroke-width: 14; }
.ac-rc__track { stroke: rgba(255, 255, 255, .14); }
.ac-rc__seg { stroke-linecap: round; stroke-dasharray: 0 100; transition: stroke-dasharray .8s var(--ac-ease), stroke-dashoffset .8s var(--ac-ease); }
.ac-rc__seg--pg { stroke: var(--rc-pg); }
.ac-rc__seg--fd { stroke: #b6f0e4; }
.ac-rc__seg--ei { stroke: #fff; }
.ac-rc__ringtxt { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ac-rc__ringtxt small { font-size: .62rem; opacity: .8; }
.ac-rc__ringtxt strong { font-size: .95rem; font-variant-numeric: tabular-nums; }

.ac-rc__lines { list-style: none; margin: 18px 0 0; padding: 0; font-size: .92rem; }
.ac-rc__lines li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid rgba(255, 255, 255, .14); }
.ac-rc__lines li > span:last-child { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 700; }
.ac-rc__lines .is-sum { font-weight: 700; }
.ac-rc__lines .is-minus > span:last-child::before { content: "− "; }
.ac-rc__lines .is-pg > span:first-child::before, .ac-rc__lines .is-fd > span:first-child::before, .ac-rc__lines .is-total > span:first-child::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 8px; border-radius: 50%; vertical-align: 1px; }
.ac-rc__lines .is-pg > span:first-child::before { background: var(--rc-pg); }
.ac-rc__lines .is-fd > span:first-child::before { background: #b6f0e4; }
.ac-rc__lines .is-total > span:first-child::before { background: #fff; }
.ac-rc__lines .is-total { border-bottom: 0; padding-top: 12px; font-size: 1.05rem; font-weight: 800; }
.ac-rc__once { margin: 10px 0 0; font-size: .82rem; opacity: .85; }
.ac-rc__notes p { margin: 10px 0 0; padding: 8px 12px; border-radius: 12px; background: rgba(255, 255, 255, .12); font-size: .85rem; line-height: 1.5; animation: acRcIn .45s var(--ac-ease) both; }

.ac-rc__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 20px;
  padding: 15px 22px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: var(--ac-navy);
  font: 800 1rem/1.2 var(--ac-font-body);
  cursor: pointer;
  box-shadow: 0 12px 24px -12px rgba(0, 0, 0, .45);
  transition: transform .35s var(--ac-spring), box-shadow .3s;
}
.ac-rc__cta:hover { transform: translateY(-3px); box-shadow: 0 18px 30px -14px rgba(0, 0, 0, .5); }
.ac-rc__cta:focus-visible { outline: 3px solid var(--ac-aqua); outline-offset: 3px; }

/* Zusätzliche Möglichkeiten */
.ac-rc__h { margin: 4px 0 14px; font: 600 1.3rem/1.3 var(--ac-font-head); color: var(--ac-ink); }
.ac-rc__extras { display: grid; gap: 12px; }
.ac-rc__x { padding: 16px 18px; border-radius: var(--ac-radius); background: var(--ac-mint-2); border: 1px solid var(--ac-line); border-left: 5px solid var(--ac-green); animation: acRcIn .5s var(--ac-ease) both; animation-delay: calc(var(--i) * 70ms); transition: opacity .3s; }
.ac-rc__x > div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 14px; align-items: baseline; }
.ac-rc__x strong { color: var(--ac-ink); }
.ac-rc__xv { font-weight: 800; color: var(--ac-teal-600); white-space: nowrap; }
.ac-rc__x p { margin: 6px 0 4px; font-size: .9rem; line-height: 1.55; }
.ac-rc__x small { font-size: .76rem; color: var(--ac-muted); }
.ac-rc__x.is-off { opacity: .6; border-left-color: #b9c6cb; }
.ac-rc__legal { margin: 16px 0 0; font-size: .8rem; line-height: 1.55; color: var(--ac-muted); }

/* Anfrageformular */
.ac-rc__form { opacity: 0; transform: translateY(24px); transition: opacity .6s var(--ac-ease), transform .6s var(--ac-ease); scroll-margin-top: calc(var(--ac-header-h) + 20px); }
.ac-rc__form.is-open { opacity: 1; transform: none; }
.ac-rc__form .ac-formcard { max-width: 760px; margin: 0 auto; padding: clamp(22px, 4vw, 40px); border-radius: var(--ac-radius-lg); background: #fff; box-shadow: var(--ac-shadow-lg); border: 1px solid var(--ac-line); }
.ac-rc__lead { display: grid; gap: 14px; margin-top: 14px; }
.ac-rc__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ac-rc__lead > label:not(.ac-rc__check), .ac-rc__grid label { display: grid; gap: 6px; font-weight: 700; font-size: .9rem; color: var(--ac-ink); }
.ac-rc__lead input:not([type=checkbox]), .ac-rc__lead textarea { width: 100%; padding: 13px 15px; border: 1.5px solid var(--ac-line); border-radius: 14px; background: var(--ac-mint-2); font: 400 1rem/1.4 var(--ac-font-body); color: var(--ac-ink); transition: border-color .25s, box-shadow .25s, background .25s; }
.ac-rc__lead input:not([type=checkbox]):focus, .ac-rc__lead textarea:focus { outline: 0; border-color: var(--ac-teal); background: #fff; box-shadow: 0 0 0 4px rgba(0, 114, 123, .12); }
.ac-rc__check { display: flex; gap: 12px; align-items: flex-start; font-size: .86rem; line-height: 1.5; cursor: pointer; }
.ac-rc__check input { width: 20px; height: 20px; flex: none; margin-top: 1px; accent-color: var(--ac-teal); }
.ac-rc__art9 { padding: 12px 14px; border-radius: 14px; background: var(--ac-sky); animation: acRcIn .4s var(--ac-ease) both; }
.ac-rc__art9[hidden] { display: none; }
.ac-rc__hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.ac-rc__lead .ac-rc__cta { background: var(--ac-grad); color: #fff; width: auto; justify-self: start; padding-inline: 34px; }
.ac-rc__lead .ac-rc__cta.is-busy { opacity: .7; pointer-events: none; }
.ac-rc__msg { margin: 0; font-weight: 700; }
.ac-rc__msg.is-ok { color: var(--ac-green); }
.ac-rc__msg.is-err { color: #b3261e; }

/* Mobile Ergebnisleiste */
.ac-rc__bar { display: none; }

@media (max-width: 960px) {
  .ac-rc { grid-template-columns: minmax(0, 1fr); grid-template-areas: "in" "out" "extra" "form"; }
  .ac-rc__card { position: relative; top: 0; }
  .ac-rc__bar {
    position: fixed;
    z-index: 60;
    left: 12px;
    right: 84px;
    bottom: 12px;
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 14px 20px;
    border-radius: 999px;
    background: var(--ac-grad);
    color: #fff;
    box-shadow: var(--ac-shadow-lg);
    transform: translateY(140%);
    transition: transform .45s var(--ac-spring);
    cursor: pointer;
  }
  .ac-rc__bar.is-on { transform: none; }
  .ac-rc__bar span { font-size: .85rem; opacity: .9; }
  .ac-rc__bar strong { margin-left: auto; font-size: 1.2rem; font-variant-numeric: tabular-nums; }
  .ac-rc__bar em { font-style: normal; font-size: .8rem; opacity: .85; }
}
@media (max-width: 560px) {
  .ac-rc__stufen { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .ac-rc__stufen .ac-rc__chip > span { min-height: 64px; }
  .ac-rc__grid { grid-template-columns: 1fr; }
  .ac-rc__lead .ac-rc__cta { width: 100%; }
}

@keyframes acRcIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes acRcPop { 0% { transform: scale(1); } 40% { transform: scale(1.07); } 100% { transform: scale(1); } }
@keyframes acRcFloat { from { transform: translate(0, 0); } to { transform: translate(-24px, 18px); } }

@media (prefers-reduced-motion: reduce) {
  .ac-rc *, .ac-rc *::before, .ac-rc *::after { animation: none !important; transition: none !important; }
  .ac-rc__form { opacity: 1; transform: none; }
}

/* Breakdance: Bereich volle Breite */
body.breakdance .ac-sec.ac-rcsec > .section-container { max-width: none !important; width: 100% !important; }
body.breakdance .ac-rcsec .bde-code-block { width: 100%; }
