/*
 * Kursseite · Digitaler Studienberater (ersetzt FAQ + Vorteile optisch, sobald das Skript ihn gebaut hat; Originale bleiben im HTML und sind
 * über „Alle Fragen und Antworten als Liste“ aufklappbar). Die Dame über dem Fußbereich wechselt in den Berater.
 */

html.iffa-mit-berater:not(.iffa-liste-offen) :is(.iff-mayo:has(#faq), .iff-mayo:has(#plan)) {
  display: none;
}

html.iffa-mit-berater .mayolove-footer-decoration__image {
  visibility: hidden;
}

.iffa-berater {
  --b-blau: var(--iffa-blau, #213a8f);
  --b-text: var(--iffa-text, #1b2340);
  --b-leise: var(--iffa-text-leise, #495057);
  padding: 72px 16px 56px;
  background: linear-gradient(180deg, #fff 0%, #f1f4fa 38%, #f1f4fa 100%);
}

.iffa-berater__innen {
  display: grid;
  gap: 24px;
  max-width: 1170px;
  margin: 0 auto;
}

.iffa-berater__kopf {
  display: grid;
  gap: 8px;
}

.iffa-berater__kopf p {
  max-width: 64ch;
  margin: 0;
  color: var(--b-leise);
  font-size: 18px;
}

.iffa-berater__buehne {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
  gap: 28px;
  align-items: end;
}

/* Chatfenster */
.iffa-berater__chat {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  height: 640px;
  overflow: hidden;
  border: 1px solid #e3e7ef;
  border-radius: 26px;
  background: #fff;
  box-shadow: 0 24px 60px rgb(27 35 64 / 12%);
}

.iffa-berater__leiste {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--b-blau);
  color: #fff;
}

.iffa-berater__avatar {
  flex: none;
  width: 46px;
  height: 46px;
  border: 2px solid #fff;
  border-radius: 50%;
  background-color: #e9ecef;
  background-position: 50% 5%;
  background-repeat: no-repeat;
  background-size: 380% auto;
}

.iffa-berater__wer {
  display: grid;
  flex: 1;
  line-height: 1.25;
}

.iffa-berater__wer strong {
  font-size: 17px;
}

.iffa-berater__status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  opacity: 0.9;
}

.iffa-berater__status::before {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #51cf66;
  content: "";
}

.iffa-berater__neu {
  min-height: 36px;
  padding: 6px 12px;
  border: 1px solid rgb(255 255 255 / 45%);
  border-radius: 999px;
  background: none;
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

/* Themen immer greifbar (Querspringen) */
.iffa-berater__themen {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 16px;
  border-bottom: 1px solid #edf0f5;
  scrollbar-width: thin;
}

.iffa-berater__themen button {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 12px;
  border: 1px solid #d6dbe6;
  border-radius: 999px;
  background: #f8f9fb;
  color: var(--b-text);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.iffa-berater__themen svg {
  width: 18px;
  height: 18px;
  color: var(--b-blau);
}

.iffa-berater__themen button[aria-pressed="true"] {
  border-color: var(--b-blau);
  background: var(--b-blau);
  color: #fff;
}

.iffa-berater__themen button[aria-pressed="true"] svg {
  color: #fff;
}

/* Verlauf */
.iffa-berater__verlauf {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
  padding: 20px 18px;
  overflow-y: auto;
  list-style: none;
  overscroll-behavior: contain;
}

.iffa-berater__blase {
  max-width: 86%;
  padding: 12px 16px;
  font-size: 16px;
  line-height: 1.55;
  animation: iffa-berater-auf 0.35s ease-out both;
}

.iffa-berater__blase--assistent {
  align-self: flex-start;
  border-radius: 18px 18px 18px 6px;
  background: #f1f3f5;
  color: var(--b-text);
}

.iffa-berater__blase--nutzer {
  align-self: flex-end;
  border-radius: 18px 18px 6px 18px;
  background: var(--b-blau);
  color: #fff;
  font-weight: 700;
}

.iffa-berater__blase a {
  color: var(--b-blau);
  font-weight: 700;
}

@keyframes iffa-berater-auf {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

.iffa-berater__antwort {
  position: relative;
}

.iffa-berater__antwort > * {
  margin: 0 0 0.65em;
}

.iffa-berater__antwort :is(h3, h4) {
  margin-top: 0.4em;
  color: var(--b-blau);
  font-size: 17px;
}

.iffa-berater__antwort table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 14px;
}

.iffa-berater__antwort :is(td, th) {
  padding: 6px 8px;
  border: 1px solid #dee2e6;
}

.iffa-berater__antwort.ist-gekuerzt {
  max-height: 300px;
  overflow: hidden;
}

.iffa-berater__antwort.ist-gekuerzt::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 80px;
  background: linear-gradient(transparent, #f1f3f5);
  content: "";
}

.iffa-berater__mehr {
  margin-top: 6px;
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--b-blau);
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

.iffa-berater__tippt {
  display: inline-flex;
  gap: 5px;
  padding: 4px 2px;
}

.iffa-berater__tippt i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #adb5bd;
  animation: iffa-berater-tippen 1s infinite ease-in-out;
}

.iffa-berater__tippt i:nth-child(2) {
  animation-delay: 0.15s;
}

.iffa-berater__tippt i:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes iffa-berater-tippen {
  0%,
  80%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }

  40% {
    opacity: 1;
    transform: translateY(-4px);
  }
}

/* Antwortmöglichkeiten */
.iffa-berater__auswahl {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 210px;
  padding: 14px 16px 18px;
  overflow-y: auto;
  border-top: 1px solid #edf0f5;
  background: #fafbfd;
}

.iffa-berater__auswahl:empty {
  display: none;
}

.iffa-berater__option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 14px;
  border: 2px solid #cfd6e3;
  border-radius: 999px;
  background: #fff;
  color: var(--b-text);
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s, background 0.2s;
}

.iffa-berater__option:hover {
  border-color: var(--b-blau);
  transform: translateY(-1px);
}

.iffa-berater__option svg {
  flex: none;
  width: 18px;
  height: 18px;
  color: var(--b-blau);
}

.iffa-berater__option.ist-kontakt {
  border-color: var(--b-blau);
  background: var(--b-blau);
  color: #fff;
}

.iffa-berater__option.ist-zurueck {
  border-style: dashed;
  color: var(--b-leise);
}

/* Die Beraterin */
.iffa-berater__person {
  position: relative;
  display: grid;
  justify-items: center;
}

.iffa-berater__person img {
  display: block;
  width: 118%;
  max-width: none;
  height: auto;
  margin-right: -18%;
}

.iffa-berater__sprechblase {
  position: relative;
  justify-self: start;
  max-width: 260px;
  margin: 0 0 -6px;
  padding: 12px 16px;
  border-radius: 18px 18px 18px 6px;
  background: #fff;
  box-shadow: 0 10px 26px rgb(27 35 64 / 12%);
  color: var(--b-text);
  font-size: 16px;
  font-weight: 700;
}

.iffa-berater__kontakt {
  display: grid;
  gap: 2px;
  width: 100%;
  margin-top: -8px;
  padding: 16px 18px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 26px rgb(27 35 64 / 10%);
  color: var(--b-leise);
  font-size: 14px;
}

.iffa-berater__kontakt strong {
  color: var(--b-text);
  font-size: 16px;
}

.iffa-berater__kontakt a {
  color: var(--b-blau);
  font-size: 20px;
  font-weight: 700;
  text-decoration: none;
}

.iffa-berater__liste {
  justify-self: start;
  min-height: 44px;
  padding: 6px 2px;
  border: 0;
  background: none;
  color: var(--b-blau);
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

@media (max-width: 991px) {
  .iffa-berater {
    padding: 56px 16px 40px;
  }

  .iffa-berater__buehne {
    grid-template-columns: 1fr;
  }

  .iffa-berater__chat {
    height: min(620px, 82vh);
  }

  .iffa-berater__person img,
  .iffa-berater__sprechblase {
    display: none;
  }

  .iffa-berater__kontakt {
    margin-top: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .iffa-berater *,
  .iffa-berater *::after {
    animation: none !important;
    transition: none !important;
  }
}
