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

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: radial-gradient(circle at top left, #ffe4f3 0, #e0f2ff 40%, #fefaf1 100%);
  color: #1b2559;
  position: relative;
  overflow-x: hidden;
}

/* Decorative elements */
.decoration {
  position: fixed;
  pointer-events: none;
  z-index: 1;
  font-size: 2.5rem;
  opacity: 0.6;
  animation: gentle-float 6s ease-in-out infinite;
}

.decoration--sun {
  top: 20px;
  right: 30px;
  font-size: 3rem;
  opacity: 0.7;
  animation: sun-rotate 20s linear infinite;
  filter: drop-shadow(0 0 10px rgba(255, 200, 0, 0.5));
}

.decoration--cloud-1 {
  top: 40px;
  left: 20px;
  font-size: 2.2rem;
  animation: cloud-drift 15s ease-in-out infinite;
}

.decoration--cloud-2 {
  top: 80px;
  right: 80px;
  font-size: 2rem;
  animation: cloud-drift 18s ease-in-out infinite 2s;
}

.decoration--cloud-3 {
  top: 60px;
  left: 30%;
  font-size: 1.8rem;
  animation: cloud-drift 20s ease-in-out infinite 4s;
}

.decoration--cloud-4 {
  top: 100px;
  right: 20%;
  font-size: 2.1rem;
  animation: cloud-drift 16s ease-in-out infinite 1s;
}

.decoration--cloud-5 {
  top: 50px;
  left: 60%;
  font-size: 1.9rem;
  animation: cloud-drift 22s ease-in-out infinite 3s;
}

.decoration--balloon-1 {
  top: 150px;
  left: 15px;
  font-size: 2.5rem;
  opacity: 0.8;
  animation: balloon-rise 12s ease-in-out infinite;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.decoration--balloon-2 {
  top: 180px;
  right: 25px;
  font-size: 2.2rem;
  opacity: 0.8;
  animation: balloon-rise 14s ease-in-out infinite 2s;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.decoration--balloon-3 {
  top: 200px;
  left: 25%;
  font-size: 2rem;
  opacity: 0.8;
  animation: balloon-rise 13s ease-in-out infinite 1s;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.decoration--balloon-4 {
  top: 160px;
  right: 15%;
  font-size: 2.3rem;
  opacity: 0.8;
  animation: balloon-rise 15s ease-in-out infinite 3s;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.decoration--balloon-5 {
  top: 190px;
  left: 70%;
  font-size: 2.1rem;
  opacity: 0.8;
  animation: balloon-rise 11s ease-in-out infinite 2.5s;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.balloon-shape {
  width: 1.2em;
  height: 1.5em;
  background: linear-gradient(135deg, #4ade80, #22c55e, #16a34a);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  position: relative;
  box-shadow: 0 4px 8px rgba(34, 197, 94, 0.3);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.balloon-shape::before {
  content: "";
  position: absolute;
  bottom: -0.15em;
  left: 50%;
  transform: translateX(-50%);
  width: 0.3em;
  height: 0.2em;
  background: linear-gradient(135deg, #4ade80, #22c55e);
  border-radius: 0 0 50% 50%;
}

.balloon-string {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 1.5em;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.1));
  border-radius: 2px;
}

.decoration--bird-1 {
  top: 120px;
  left: -50px;
  font-size: 1.8rem;
  opacity: 0.7;
  animation: bird-fly-1 25s linear infinite;
}

.decoration--bird-2 {
  top: 160px;
  left: -50px;
  font-size: 1.6rem;
  opacity: 0.7;
  animation: bird-fly-2 30s linear infinite 5s;
}

.decoration--bird-3 {
  top: 220px;
  left: -50px;
  font-size: 1.7rem;
  opacity: 0.7;
  animation: bird-fly-3 28s linear infinite 10s;
}

.decoration--bird-4 {
  top: 100px;
  right: -50px;
  font-size: 1.8rem;
  opacity: 0.7;
  animation: bird-fly-4 27s linear infinite 3s;
  transform: scaleX(-1);
}

.decoration--tree-1 {
  bottom: 20px;
  left: 10px;
  font-size: 3rem;
  opacity: 0.65;
  animation: tree-sway 8s ease-in-out infinite;
}

.decoration--tree-2 {
  bottom: 20px;
  right: 15px;
  font-size: 2.8rem;
  opacity: 0.65;
  animation: tree-sway 7s ease-in-out infinite 1s;
}

.decoration--flower-1 {
  bottom: 100px;
  left: 50px;
  font-size: 2rem;
  opacity: 0.7;
  animation: flower-bloom 5s ease-in-out infinite;
}

.decoration--flower-2 {
  bottom: 120px;
  right: 60px;
  font-size: 1.8rem;
  opacity: 0.7;
  animation: flower-bloom 6s ease-in-out infinite 1.5s;
}

.decoration--flower-3 {
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.9rem;
  opacity: 0.7;
  animation: flower-bloom 5.5s ease-in-out infinite 0.8s;
}

.decoration--flower-4 {
  bottom: 90px;
  left: 15%;
  font-size: 2rem;
  opacity: 0.75;
  animation: flower-bloom 5.8s ease-in-out infinite 1.2s;
}

.decoration--flower-5 {
  bottom: 110px;
  right: 20%;
  font-size: 1.9rem;
  opacity: 0.75;
  animation: flower-bloom 6.2s ease-in-out infinite 0.5s;
}

.decoration--flower-6 {
  bottom: 95px;
  left: 35%;
  font-size: 2.1rem;
  opacity: 0.75;
  animation: flower-bloom 5.3s ease-in-out infinite 1.8s;
}

.decoration--flower-7 {
  bottom: 105px;
  right: 35%;
  font-size: 1.8rem;
  opacity: 0.75;
  animation: flower-bloom 6s ease-in-out infinite 2.2s;
}

.decoration--flower-8 {
  bottom: 85px;
  left: 70%;
  font-size: 2rem;
  opacity: 0.75;
  animation: flower-bloom 5.7s ease-in-out infinite 1.5s;
}

/* Grass elements */
.grass {
  position: fixed;
  bottom: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.7;
  transform-origin: bottom center;
}

.grass::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  height: 2px;
  background: #15803d;
  border-radius: 2px;
}

.grass--1 {
  left: 5%;
  width: 8px;
  height: 40px;
  background: linear-gradient(to top, #22c55e, #16a34a, #15803d);
  border-radius: 4px 4px 0 0;
  animation: grass-sway 4s ease-in-out infinite;
  box-shadow: 0 0 3px rgba(34, 197, 94, 0.3);
}

.grass--2 {
  left: 12%;
  width: 6px;
  height: 35px;
  background: linear-gradient(to top, #22c55e, #16a34a);
  border-radius: 3px 3px 0 0;
  animation: grass-sway 4.5s ease-in-out infinite 0.5s;
  box-shadow: 0 0 2px rgba(34, 197, 94, 0.3);
}

.grass--3 {
  left: 18%;
  width: 7px;
  height: 45px;
  background: linear-gradient(to top, #22c55e, #16a34a, #15803d);
  border-radius: 3.5px 3.5px 0 0;
  animation: grass-sway 3.8s ease-in-out infinite 1s;
  box-shadow: 0 0 3px rgba(34, 197, 94, 0.3);
}

.grass--4 {
  left: 25%;
  width: 6px;
  height: 38px;
  background: linear-gradient(to top, #22c55e, #16a34a);
  border-radius: 3px 3px 0 0;
  animation: grass-sway 4.2s ease-in-out infinite 0.3s;
  box-shadow: 0 0 2px rgba(34, 197, 94, 0.3);
}

.grass--5 {
  left: 32%;
  width: 8px;
  height: 42px;
  background: linear-gradient(to top, #22c55e, #16a34a, #15803d);
  border-radius: 4px 4px 0 0;
  animation: grass-sway 4.7s ease-in-out infinite 0.8s;
  box-shadow: 0 0 3px rgba(34, 197, 94, 0.3);
}

.grass--6 {
  left: 50%;
  width: 7px;
  height: 40px;
  background: linear-gradient(to top, #22c55e, #16a34a);
  border-radius: 3.5px 3.5px 0 0;
  animation: grass-sway 4.3s ease-in-out infinite 1.2s;
  box-shadow: 0 0 3px rgba(34, 197, 94, 0.3);
}

.grass--7 {
  left: 58%;
  width: 6px;
  height: 36px;
  background: linear-gradient(to top, #22c55e, #16a34a);
  border-radius: 3px 3px 0 0;
  animation: grass-sway 4.6s ease-in-out infinite 0.6s;
  box-shadow: 0 0 2px rgba(34, 197, 94, 0.3);
}

.grass--8 {
  left: 65%;
  width: 8px;
  height: 44px;
  background: linear-gradient(to top, #22c55e, #16a34a, #15803d);
  border-radius: 4px 4px 0 0;
  animation: grass-sway 3.9s ease-in-out infinite 1.5s;
  box-shadow: 0 0 3px rgba(34, 197, 94, 0.3);
}

.grass--9 {
  left: 72%;
  width: 7px;
  height: 39px;
  background: linear-gradient(to top, #22c55e, #16a34a);
  border-radius: 3.5px 3.5px 0 0;
  animation: grass-sway 4.4s ease-in-out infinite 0.9s;
  box-shadow: 0 0 3px rgba(34, 197, 94, 0.3);
}

.grass--10 {
  left: 80%;
  width: 6px;
  height: 37px;
  background: linear-gradient(to top, #22c55e, #16a34a);
  border-radius: 3px 3px 0 0;
  animation: grass-sway 4.1s ease-in-out infinite 0.4s;
  box-shadow: 0 0 2px rgba(34, 197, 94, 0.3);
}

@keyframes gentle-float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes sun-rotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes cloud-drift {
  0%, 100% {
    transform: translateX(0) translateY(0);
  }
  33% {
    transform: translateX(15px) translateY(-5px);
  }
  66% {
    transform: translateX(-10px) translateY(5px);
  }
}

@keyframes tree-sway {
  0%, 100% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(2deg);
  }
  75% {
    transform: rotate(-2deg);
  }
}

@keyframes flower-bloom {
  0%, 100% {
    transform: scale(1) rotate(0deg);
  }
  50% {
    transform: scale(1.15) rotate(5deg);
  }
}

@keyframes grass-sway {
  0%, 100% {
    transform: rotate(0deg) translateX(0);
  }
  25% {
    transform: rotate(3deg) translateX(2px);
  }
  50% {
    transform: rotate(0deg) translateX(0);
  }
  75% {
    transform: rotate(-3deg) translateX(-2px);
  }
}

@keyframes balloon-rise {
  0%, 100% {
    transform: translateY(0) translateX(0);
  }
  25% {
    transform: translateY(-15px) translateX(5px);
  }
  50% {
    transform: translateY(-25px) translateX(-3px);
  }
  75% {
    transform: translateY(-15px) translateX(3px);
  }
}

@keyframes bird-fly-1 {
  0% {
    transform: translateX(0) translateY(0);
  }
  50% {
    transform: translateX(calc(100vw + 100px)) translateY(-20px);
  }
  100% {
    transform: translateX(calc(100vw + 100px)) translateY(-20px);
  }
}

@keyframes bird-fly-2 {
  0% {
    transform: translateX(0) translateY(0);
  }
  50% {
    transform: translateX(calc(100vw + 100px)) translateY(15px);
  }
  100% {
    transform: translateX(calc(100vw + 100px)) translateY(15px);
  }
}

@keyframes bird-fly-3 {
  0% {
    transform: translateX(0) translateY(0);
  }
  50% {
    transform: translateX(calc(100vw + 100px)) translateY(-10px);
  }
  100% {
    transform: translateX(calc(100vw + 100px)) translateY(-10px);
  }
}

@keyframes bird-fly-4 {
  0% {
    transform: scaleX(-1) translateX(0) translateY(0);
  }
  50% {
    transform: scaleX(-1) translateX(calc(-100vw - 100px)) translateY(-15px);
  }
  100% {
    transform: scaleX(-1) translateX(calc(-100vw - 100px)) translateY(-15px);
  }
}

@media (max-width: 640px) {
  .decoration {
    font-size: 1.8rem;
  }
  
  .decoration--sun {
    font-size: 2.2rem;
    top: 10px;
    right: 15px;
  }
  
  .decoration--cloud-1,
  .decoration--cloud-2,
  .decoration--cloud-3,
  .decoration--cloud-4,
  .decoration--cloud-5 {
    font-size: 1.5rem;
  }
  
  .decoration--balloon-1,
  .decoration--balloon-2,
  .decoration--balloon-3,
  .decoration--balloon-4,
  .decoration--balloon-5 {
    font-size: 1.6rem;
  }
  
  .decoration--bird-1,
  .decoration--bird-2,
  .decoration--bird-3,
  .decoration--bird-4 {
    font-size: 1.3rem;
  }
  
  .decoration--tree-1,
  .decoration--tree-2 {
    font-size: 2rem;
  }
  
  .decoration--flower-1,
  .decoration--flower-2,
  .decoration--flower-3,
  .decoration--flower-4,
  .decoration--flower-5,
  .decoration--flower-6,
  .decoration--flower-7,
  .decoration--flower-8 {
    font-size: 1.5rem;
  }
  
  .grass--1,
  .grass--2,
  .grass--3,
  .grass--4,
  .grass--5,
  .grass--6,
  .grass--7,
  .grass--8,
  .grass--9,
  .grass--10 {
    width: 4px;
    height: 25px;
  }
}

.page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  position: relative;
  z-index: 2;
}

.login__card,
.home {
  background: #ffffff;
  border-radius: 24px;
  box-shadow: 0 24px 60px rgba(40, 80, 160, 0.18);
  padding: 24px;
  max-width: 480px;
  width: 100%;
  position: relative;
  overflow: hidden;
  z-index: 2;
}

.home::before {
  content: "";
  position: absolute;
  inset: -40%;
  background:
    radial-gradient(circle at 0 0, rgba(255, 214, 165, 0.35), transparent 55%),
    radial-gradient(circle at 100% 0, rgba(197, 255, 214, 0.3), transparent 55%),
    radial-gradient(circle at 0 100%, rgba(186, 201, 255, 0.45), transparent 55%);
  opacity: 0.7;
  pointer-events: none;
}

.home > * {
  position: relative;
}

.login__title,
.home__title {
  font-size: 1.8rem;
  margin: 0 0 8px;
}

.home__name {
  color: #ff7a59;
}

.login__subtitle,
.home__subtitle {
  margin: 0 0 24px;
  color: #52608f;
}

.login__buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border-radius: 999px;
  border: none;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.2s ease;
}

.btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.btn--google {
  background: #ffffff;
  color: #1b2559;
  box-shadow: 0 8px 20px rgba(15, 52, 96, 0.1);
}

.btn--facebook {
  background: #1877f2;
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(24, 119, 242, 0.35);
}

.btn--primary {
  background: #ff7a59;
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(255, 122, 89, 0.45);
}

.btn--secondary {
  background: #ffffff;
  color: #ff7a59;
  box-shadow: 0 8px 20px rgba(27, 37, 89, 0.08);
}

.btn:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 25px rgba(27, 37, 89, 0.16);
}

.home__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.home__header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.home__language-selector {
  position: relative;
}

.language-select {
  appearance: none;
  background: #ffffff;
  border: 1px solid #d0d6ff;
  border-radius: 999px;
  padding: 6px 32px 6px 12px;
  font-size: 0.875rem;
  font-weight: 500;
  color: #1b2559;
  cursor: pointer;
  transition: all 0.2s ease;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%231b2559' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 12px;
}

.language-select:hover {
  border-color: #ff7a59;
  box-shadow: 0 2px 8px rgba(255, 122, 89, 0.15);
}

.language-select:focus {
  outline: none;
  border-color: #ff7a59;
  box-shadow: 0 0 0 3px rgba(255, 122, 89, 0.1);
}

.home__content {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.home__info {
  background: rgba(255, 255, 255, 0.8);
  border-radius: 18px;
  padding: 12px 14px;
  font-size: 0.9rem;
  color: #3f4a7f;
  border: 1px dashed rgba(154, 165, 250, 0.7);
}

.home__tip {
  margin: 0;
}

.voice-panel {
  background: linear-gradient(135deg, #ffcfdf, #b0f3f1);
  border-radius: 24px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 18px 40px rgba(255, 122, 89, 0.35);
  position: relative;
  overflow: hidden;
}

.voice-panel::after {
  content: "🎈";
  position: absolute;
  font-size: 2.2rem;
  right: 10px;
  top: 10px;
  opacity: 0.8;
  animation: float 4s ease-in-out infinite;
}

.voice-panel__status {
  margin-top: 12px;
  color: #1b2559;
}

.voice-panel__timer {
  margin: 8px 0 0;
  font-weight: 600;
}

.controls {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.avatar-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff7b2, #ff9a9e);
  box-shadow: 0 8px 20px rgba(255, 154, 158, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  animation: avatar-bob 3s ease-in-out infinite;
}

.avatar-face {
  width: 70%;
  height: 70%;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-eye {
  position: absolute;
  width: 6px;
  height: 8px;
  border-radius: 999px;
  background: #29346b;
  top: 40%;
}

.avatar-eye--left {
  left: 32%;
}

.avatar-eye--right {
  right: 32%;
}

.avatar-mouth {
  position: absolute;
  width: 40%;
  height: 10px;
  border-radius: 999px;
  border-bottom: 3px solid #ff7a59;
  bottom: 26%;
}

.dialog-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 10;
}

.dialog-backdrop.hidden {
  display: none;
}

.dialog {
  background: #ffffff;
  border-radius: 20px;
  padding: 20px;
  max-width: 420px;
  width: 100%;
}

.dialog__title {
  margin: 0 0 8px;
  font-size: 1.4rem;
}

.dialog__text {
  margin: 0 0 16px;
  color: #52608f;
}

.dialog__form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.field__label {
  font-size: 0.9rem;
}

.field__input {
  border-radius: 999px;
  border: 1px solid #d0d6ff;
  padding: 8px 12px;
  font-size: 1rem;
}

.voice-panel__animation {
  width: 120px;
  height: 120px;
  margin: 0 auto;
  position: relative;
  filter: drop-shadow(0 10px 25px rgba(255, 255, 255, 0.6));
}

.mic-circle {
  position: absolute;
  inset: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.85);
  opacity: 0.7;
}

.mic-circle--1 {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 18px rgba(255, 255, 255, 0.9);
}

.mic-circle--2 {
  width: 70px;
  height: 70px;
  animation: pulse 1.6s infinite;
}

.mic-circle--3 {
  width: 100px;
  height: 100px;
  animation: pulse 1.6s infinite 0.3s;
}

.voice-panel__animation--active .mic-circle--2,
.voice-panel__animation--active .mic-circle--3 {
  animation-play-state: running;
  border-color: rgba(255, 255, 255, 0.9);
}

/* Red when listening to the child */
.voice-panel__animation--listening .mic-circle--1 {
  background: #ff4b5c;
  box-shadow: 0 0 20px rgba(255, 75, 92, 0.9);
}

.voice-panel__animation--listening .mic-circle--2,
.voice-panel__animation--listening .mic-circle--3 {
  border-color: rgba(255, 75, 92, 0.85);
}

/* Green when AI is responding */
.voice-panel__animation--ai .mic-circle--1 {
  background: #00c982;
  box-shadow: 0 0 20px rgba(0, 201, 130, 0.9);
}

.voice-panel__animation--ai .mic-circle--2,
.voice-panel__animation--ai .mic-circle--3 {
  border-color: rgba(0, 201, 130, 0.85);
}

.voice-panel__animation:not(.voice-panel__animation--active)
  .mic-circle--2,
.voice-panel__animation:not(.voice-panel__animation--active)
  .mic-circle--3 {
  animation-play-state: paused;
}

@keyframes pulse {
  0% {
    transform: translate(-50%, -50%) scale(0.9);
    opacity: 0.5;
  }
  70% {
    transform: translate(-50%, -50%) scale(1.1);
    opacity: 0.1;
  }
  100% {
    transform: translate(-50%, -50%) scale(0.9);
    opacity: 0.5;
  }
}

@keyframes float {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
  100% {
    transform: translateY(0);
  }
}

@keyframes avatar-bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

@media (min-width: 640px) {
  .login__card,
  .home {
    padding: 32px;
  }
}

/* Dialog steps */
.dialog-step {
  display: block;
}

.dialog-step.hidden {
  display: none;
}

/* Topics grid */
.topics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 16px;
  margin-top: 16px;
  max-height: 400px;
  overflow-y: auto;
}

.topic-card {
  background: #f8f9ff;
  border: 2px solid #d0d6ff;
  border-radius: 16px;
  padding: 12px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
  overflow: hidden;
}

.topic-card::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 122, 89, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.4s ease, height 0.4s ease;
}

.topic-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(27, 37, 89, 0.15);
  border-color: #a8b4ff;
  background: #ffffff;
}

/* Selected topic state (multi-select) */
.topic-card--selected {
  border-color: #ff7a59;
  background: #fff5f0;
  box-shadow: 0 0 0 2px rgba(255, 122, 89, 0.25),
    0 10px 25px rgba(255, 122, 89, 0.35);
  transform: translateY(-3px) scale(1.05);
  animation: topic-select 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.topic-card--selected::before {
  width: 200px;
  height: 200px;
}

.topic-card--deselecting {
  animation: topic-deselect 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes topic-select {
  0% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-5px) scale(1.08);
  }
  100% {
    transform: translateY(-3px) scale(1.05);
  }
}

@keyframes topic-deselect {
  0% {
    transform: translateY(-3px) scale(1.05);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

.topic-thumbnail {
  width: 100%;
  height: 100px;
  object-fit: cover;
  border-radius: 12px;
  background: #e8ebff;
}

.topic-title {
  margin: 0;
  font-size: 0.9rem;
  text-align: center;
  color: #1b2559;
  font-weight: 600;
}

.topics-loading,
.topics-error {
  text-align: center;
  padding: 20px;
  color: #52608f;
  grid-column: 1 / -1;
}

.topics-confirm-btn {
  display: block;
  margin: 24px auto 0;
  width: auto;
  min-width: 200px;
}

@media (max-width: 640px) {
  .topics-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
  }
  
  .topic-thumbnail {
    height: 80px;
  }
  
  .topic-title {
    font-size: 0.85rem;
  }
}

/* Subscription Page Styles */
.page--subscription,
.page--payment {
  min-height: 100vh;
  padding: 20px 16px;
}

.subscription,
.payment {
  max-width: 600px;
  width: 100%;
  margin: 0 auto;
}

.subscription__header,
.payment__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.subscription__back {
  color: #52608f;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.subscription__back:hover {
  color: #ff7a59;
}

.subscription__card,
.payment__card {
  background: #ffffff;
  border-radius: 24px;
  box-shadow: 0 24px 60px rgba(40, 80, 160, 0.18);
  padding: 32px;
  position: relative;
  overflow: hidden;
}

.subscription__title,
.payment__title {
  font-size: 1.8rem;
  margin: 0 0 8px;
  text-align: center;
}

.subscription__subtitle {
  margin: 0 0 32px;
  color: #52608f;
  text-align: center;
}

.subscription__section-title {
  font-size: 1.2rem;
  margin: 0 0 16px;
  color: #1b2559;
  font-weight: 600;
}

.subscription__packages {
  margin-bottom: 32px;
}

.packages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.package-card {
  background: #ffffff;
  border: 2px solid #e8ebff;
  border-radius: 16px;
  padding: 16px 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.package-card:hover {
  border-color: #ff7a59;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 122, 89, 0.2);
}

.package-card--selected {
  border-color: #ff7a59;
  background: #fff5f3;
  box-shadow: 0 4px 12px rgba(255, 122, 89, 0.3);
}

.package-card__minutes {
  font-size: 1.5rem;
  font-weight: 700;
  color: #ff7a59;
}

.package-card__label {
  font-size: 0.875rem;
  color: #52608f;
}

.package-card__price {
  font-size: 0.75rem;
  color: #1b2559;
  font-weight: 600;
  margin-top: 4px;
}

.subscription__custom {
  margin-bottom: 32px;
}

.custom-input-group {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.custom-input-group .field__input {
  flex: 1;
  max-width: 200px;
}

.custom-input-group__label {
  color: #52608f;
  font-weight: 500;
}

.subscription__pricing-note {
  font-size: 0.875rem;
  color: #52608f;
  margin: 0;
}

.subscription__buyer-info {
  margin-bottom: 32px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.field__label {
  font-weight: 600;
  color: #1b2559;
  font-size: 0.95rem;
}

.field__input {
  padding: 12px 16px;
  border: 2px solid #e8ebff;
  border-radius: 12px;
  font-size: 1rem;
  color: #1b2559;
  transition: all 0.2s ease;
  background: #ffffff;
}

.field__input:focus {
  outline: none;
  border-color: #ff7a59;
  box-shadow: 0 0 0 3px rgba(255, 122, 89, 0.1);
}

.field__error {
  color: #ff4444;
  font-size: 0.875rem;
  display: none;
}

.field__error[style*="block"] {
  display: block;
}

.subscription__summary {
  background: #f8f9ff;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
}

.summary-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  color: #52608f;
}

.summary-item:last-child {
  margin-bottom: 0;
}

.summary-item--total {
  padding-top: 12px;
  border-top: 2px solid #e8ebff;
  font-size: 1.1rem;
  font-weight: 600;
  color: #1b2559;
}

.summary-item strong {
  color: #ff7a59;
  font-size: 1.2rem;
}

.btn--large {
  width: 100%;
  padding: 16px;
  font-size: 1.1rem;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Payment Page Styles */
.payment__card {
  text-align: center;
}

.payment__icon {
  font-size: 4rem;
  margin-bottom: 16px;
}

.payment__message {
  background: #f8f9ff;
  border-radius: 12px;
  padding: 24px;
  margin: 24px 0;
}

.payment__message-text {
  font-size: 1.1rem;
  color: #52608f;
  line-height: 1.6;
  margin: 0;
}

@media (max-width: 640px) {
  .subscription__card,
  .payment__card {
    padding: 24px;
  }

  .subscription__title,
  .payment__title {
    font-size: 1.5rem;
  }

  .packages-grid {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
  }

  .package-card {
    padding: 12px 8px;
  }

  .package-card__minutes {
    font-size: 1.2rem;
  }

  .package-card__price {
    font-size: 0.7rem;
  }

  .custom-input-group .field__input {
    max-width: 100%;
  }

  .payment__icon {
    font-size: 3rem;
  }

  .payment__message-text {
    font-size: 1rem;
  }
}

/* Time up message */
.time-up-message {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 18px;
  padding: 20px;
  text-align: center;
  border: 1px dashed rgba(154, 165, 250, 0.7);
}

.time-up-message p {
  margin: 0 0 16px;
  color: #3f4a7f;
}

.time-up-message.hidden {
  display: none;
}


