/* Maskot Mas Didik — halaman login, pilih peran, pilih program */

.mascot {
  --mascot-blue: #2A9DDD;
  --mascot-ink: #1f2d3d;
  display: flex;
  align-items: flex-start;
  gap: 18px;
  animation: mascot-in .7s cubic-bezier(.2, .8, .2, 1) both;
}

.mascot__figure {
  position: relative;
  flex: none;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  outline: none;
  isolation: isolate;
  transform-origin: 50% 100%;
  transition: transform .25s ease;
  -webkit-tap-highlight-color: transparent;
}

.mascot__figure img {
  display: block;
  height: 100%;
  width: auto;
  user-select: none;
  animation: mascot-bob 3.6s ease-in-out infinite alternate;
}

/* bayangan pijakan */
.mascot__figure::after {
  content: '';
  position: absolute;
  left: 18%;
  right: 18%;
  bottom: -6px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(15, 40, 80, .28), transparent);
  z-index: -1;
  animation: mascot-shadow 3.6s ease-in-out infinite alternate;
}

.mascot__figure.is-hopping img {
  animation: mascot-hop .5s cubic-bezier(.3, 1.6, .5, 1);
}

.mascot__bubble {
  position: relative;
  max-width: 290px;
  padding: 12px 18px 14px;
  border: 2px solid var(--mascot-blue);
  border-radius: 18px;
  background: #fff;
  color: var(--mascot-ink);
  box-shadow: 0 10px 30px rgba(42, 157, 221, .18);
  transform-origin: 0 40%;
  animation: bubble-in .45s .55s cubic-bezier(.3, 1.4, .5, 1) both;
}

/* ekor balon, default: menunjuk ke kiri (ke wajah maskot) */
.mascot__bubble::before {
  content: '';
  position: absolute;
  left: -9px;
  top: 30px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-left: 2px solid var(--mascot-blue);
  border-bottom: 2px solid var(--mascot-blue);
  transform: rotate(45deg);
}

.mascot__name {
  display: block;
  margin-bottom: 2px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--mascot-blue);
}

.mascot__text {
  display: block;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.45;
  transition: opacity .2s ease, transform .2s ease;
}

.mascot__text.is-swapping {
  opacity: 0;
  transform: translateY(4px);
}

/* ---- varian hero: kolom kiri (desktop) ---- */
.mascot--hero {
  margin-top: 8px;
  justify-content: center;
}

.mascot--hero .mascot__figure {
  height: clamp(220px, 44vh, 400px);
}

.mascot--hero .mascot__bubble {
  margin-top: clamp(24px, 6vh, 56px);
}

@media (hover: hover) {
  .mascot__figure:hover {
    transform: rotate(-3deg) scale(1.02);
  }
}

/* tablet: kolom kiri sempit -> balon di atas maskot */
@media (max-width: 991.98px) {
  .mascot--hero {
    flex-direction: column-reverse;
    align-items: center;
    gap: 16px;
  }

  .mascot--hero .mascot__figure {
    height: clamp(200px, 36vh, 320px);
  }

  .mascot--hero .mascot__bubble {
    margin-top: 0;
    transform-origin: 50% 100%;
  }

  .mascot--hero .mascot__bubble::before {
    left: calc(50% - 8px);
    top: auto;
    bottom: -9px;
    border-left: 0;
    border-right: 2px solid var(--mascot-blue);
  }
}

/* ---- varian mini: di atas form, hanya mobile ---- */
.mascot--mini {
  position: relative;
  z-index: 1;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 300px;
  margin-bottom: 14px;
}

.mascot--mini .mascot__figure {
  height: 116px;
}

.mascot--mini .mascot__bubble {
  flex: 1;
  padding: 8px 12px 10px;
  border-radius: 14px;
  border-width: 0;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .18);
}

.mascot--mini .mascot__bubble::before {
  top: calc(50% - 8px);
  border: 0;
}

.mascot--mini .mascot__name {
  font-size: 10px;
}

.mascot--mini .mascot__text {
  font-size: 13px;
}

@media (min-width: 768px) {
  .mascot--mini {
    display: none;
  }
}

@keyframes mascot-in {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: none; }
}

@keyframes bubble-in {
  from { opacity: 0; transform: scale(.6); }
  to   { opacity: 1; transform: none; }
}

@keyframes mascot-bob {
  from { transform: translateY(0); }
  to   { transform: translateY(-6px); }
}

@keyframes mascot-shadow {
  from { transform: scaleX(1); opacity: 1; }
  to   { transform: scaleX(.88); opacity: .75; }
}

@keyframes mascot-hop {
  0%   { transform: translateY(0) rotate(0); }
  40%  { transform: translateY(-16px) rotate(-4deg); }
  100% { transform: translateY(0) rotate(0); }
}

@media (prefers-reduced-motion: reduce) {
  .mascot,
  .mascot__bubble,
  .mascot__figure img,
  .mascot__figure::after,
  .mascot__figure.is-hopping img {
    animation: none;
  }

  .mascot__figure,
  .mascot__text {
    transition: none;
  }
}
