*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Nunito Sans", sans-serif;
  background-color: #fcf9fc;
  min-height: 100dvh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 32px 20px 80px;
  gap: 14px;
  max-width: 420px;
  margin: 0 auto;
}

/* Top bar */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo-text {
  font-size: 20px;
  font-weight: 600;
  color: #3a2e8c;
}
.live-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #e0dcf5;
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  color: #3a2e8c;
}
.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ccc;
  transition: background 0.4s;
}
.live-dot.connected {
  background: #5b4fcf;
  animation: pulse 1.5s infinite;
}
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}

/* Ripple */
.ripple-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 0;
}
.ripple-ring {
  position: relative;
  width: 140px;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ring {
  position: absolute;
  border-radius: 50%;
  background: rgba(91, 79, 207, 0.1);
}
.ring-1 {
  width: 140px;
  height: 140px;
}
.ring-2 {
  width: 104px;
  height: 104px;
}
.ripple-inner {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #5b4fcf;
  position: relative;
  z-index: 1;
  transition: background 0.5s;
}

/* Icon row */
.icons-row {
  display: flex;
  gap: 10px;
}
.icon-pill {
  flex: 1;
  aspect-ratio: 1;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ddd;
  opacity: 0.45;
  transition:
    transform 0.2s,
    background 0.4s,
    opacity 0.4s;
}
.icon-pill.active {
  opacity: 1;
}
.icon-img {
  display: block;
  width: 50%;
  height: 50%;
  background-color: #888;
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  transition: background-color 0.4s;
}
#iconCaptions .icon-img {
  -webkit-mask-image: url("/assets/message-square-text.svg");
  mask-image: url("/assets/message-square-text.svg");
}
#iconSound .icon-img {
  -webkit-mask-image: url("/assets/volume-2.svg");
  mask-image: url("/assets/volume-2.svg");
}
#iconVisual .icon-img {
  -webkit-mask-image: url("/assets/eye.svg");
  mask-image: url("/assets/eye.svg");
}
#iconHaptic .icon-img {
  -webkit-mask-image: url("/assets/target.svg");
  mask-image: url("/assets/target.svg");
}
#iconRegulation .icon-img {
  -webkit-mask-image: url("/assets/waves-horizontal.svg");
  mask-image: url("/assets/waves-horizontal.svg");
}

#iconCaptions.active {
  background: #f1eaf7;
}
#iconCaptions.active .icon-img {
  background-color: #4a1cb4;
}
#iconSound.active {
  background: #eceee9;
}
#iconSound.active .icon-img {
  background-color: #0d8c45;
}
#iconVisual.active {
  background: #fceae5;
}
#iconVisual.active .icon-img {
  background-color: #e76a11;
}
#iconHaptic.active {
  background: #f1eaf7;
}
#iconHaptic.active .icon-img {
  background-color: #4a1cb4;
}
#iconRegulation.active {
  background: #f1eaf7;
}
#iconRegulation.active .icon-img {
  background-color: #4a1cb4;
}
.icon-pill.pulse {
  animation: iconPulse 0.6s ease;
}
@keyframes iconPulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.25);
  }
  100% {
    transform: scale(1);
  }
}

/* Alert card */
.alert-card {
  padding: 16px 0;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex: 1;
  min-height: fit-content;
}
.alert-body {
  flex: 1;
}
.intro-screen {
  text-align: center;
  opacity: 0;
  transition: opacity 1s;
}
.intro-screen.visible {
  opacity: 1;
}
.intro-title {
  font-size: 48px;
  font-stretch: 100%;
  font-weight: 550;
  color: #000;
  line-height: 1.2;
}
.intro-body {
  font-size: 28px;
  font-stretch: 85%;
  font-weight: 550;
  color: #000;
  line-height: 1.2;
  white-space: pre-line;
}
.alert-title {
  font-size: 28px;
  font-stretch: 85%;
  font-weight: 550;
  color: #000;
  line-height: 1.2;
  text-align: center;
  white-space: pre-line;
  opacity: 0;
  transition: opacity 1s;
}
.alert-title.visible {
  opacity: 1;
}
.alert-bar-wrap {
  display: none;
  margin-top: 8px;
  height: 4px;
  background: rgba(91, 79, 207, 0.2);
  border-radius: 4px;
  overflow: hidden;
}
.alert-bar {
  height: 100%;
  background: #5b4fcf;
  border-radius: 4px;
  width: 0%;
  transition: width 0.12s linear;
}
.alert-countdown {
  font-size: 12px;
  color: #5b4fcf;
  font-weight: 500;
  margin-top: 6px;
  text-align: right;
}

/* Connected card */
.connected-card {
  background: white;
  border-radius: 16px;
  border: 1px solid #e0ddf5;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.connected-icon .icon-img {
  -webkit-mask-image: url("/assets/users-round.svg");
  mask-image: url("/assets/users-round.svg");
  background-color: #4f21b6;
  width: 34px;
  height: 34px;
}
.connected-text {
  font-size: 20px;
  font-stretch: 85%;
  color: #000000;
  font-weight: 550;
}

/* Alert caption — anchored above icons row, independent of main text */
.alert-caption {
  font-size: 24px;
  color: #5b4fcf;
  line-height: 1.2;
  display: none;
  text-align: center;
  opacity: 0;
  transition: opacity 1s;
  margin-bottom: 24px;
}
.alert-caption.visible {
  opacity: 1;
}

/* Buttons */
.next-btn {
  display: block;
  margin: 20px auto 0;
  padding: 10px 32px;
  background: #5b4fcf;
  color: #fff;
  font-family: "Nunito Sans", sans-serif;
  font-size: 16px;
  font-weight: 600;
  border: none;
  border-radius: 24px;
  cursor: pointer;
  transition: background 0.2s;
}
.next-btn:active {
  background: #3a2e8c;
}

.btn-row {
  display: flex;
  gap: 10px;
  margin-top: auto;
}

/* Bottom nav */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 420px;
  margin: 0 auto;
  background-color: #fcf9fc;
  z-index: 10;
  display: flex;
  justify-content: space-around;
  border-top: 1px solid #d8d5f0;
  padding-top: 12px;
  padding-bottom: 12px;
}
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 500;
  color: #4f21b6;
  letter-spacing: 0.05em;
}
.nav-icon .icon-img {
  background-color: #4f21b6;
  width: 34px;
  height: 34px;
}
.nav-item:nth-child(1) .icon-img {
  -webkit-mask-image: url("/assets/circle-user-round.svg");
  mask-image: url("/assets/circle-user-round.svg");
}
.nav-item:nth-child(2) .icon-img {
  -webkit-mask-image: url("/assets/circle-dashed.svg");
  mask-image: url("/assets/circle-dashed.svg");
}
.nav-item:nth-child(3) .icon-img {
  -webkit-mask-image: url("/assets/info.svg");
  mask-image: url("/assets/info.svg");
}

/* Animations */

/* Background color fades */

@keyframes fadeToLilac {
  0%,
  100% {
    background-color: var(--fade-start, #fcf9fc);
  }
  50% {
    background-color: #ecdefe;
  }
}

body.fade-to-lilac {
  animation: fadeToLilac 10s ease-in-out forwards;
}

@keyframes fadeToBlue {
  0%,
  100% {
    background-color: var(--fade-start, #ecdefe);
  }
  50% {
    background-color: #cdd3f3;
  }
}

body.fade-to-blue {
  animation: fadeToBlue 10s ease-in-out forwards;
}

@keyframes fadeToPink {
  0%,
  100% {
    background-color: var(--fade-start, #cdd3f3);
  }
  50% {
    background-color: #efcdf3;
  }
}

body.fade-to-pink {
  animation: fadeToPink 10s ease-in-out forwards;
}

/* Ripple pulse animations */

@keyframes ripplePulseSubtle {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.25);
  }
}

@keyframes ripplePulseStrong {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.75);
  }
}

body.ripple-pulse-subtle .ripple-ring {
  animation: ripplePulseSubtle 3.33s ease-in-out infinite;
}
body.ripple-pulse-strong .ripple-ring {
  animation: ripplePulseStrong 2s ease-in-out infinite;
}

/* Ripple vibration — simulates phone haptic */

@keyframes rippleVibrate {
  0% {
    transform: translate(0, 0);
  }
  15% {
    transform: translate(-5px, 1px);
  }
  30% {
    transform: translate(5px, -1px);
  }
  45% {
    transform: translate(-4px, 1px);
  }
  60% {
    transform: translate(4px, 0);
  }
  75% {
    transform: translate(-5px, -1px);
  }
  90% {
    transform: translate(3px, 1px);
  }
  100% {
    transform: translate(0, 0);
  }
}

body.ripple-vibrate .ripple-ring {
  animation: rippleVibrate 0.24s linear 21;
}
