@import url("https://fonts.googleapis.com/css2?family=Comfortaa:wght@400;600&family=Playfair+Display:wght@600&display=swap");

body {
  background: radial-gradient(circle at top right, #ffdee9 0%, #b5fffc 100%);
  font-family: "Comfortaa", cursive;
  color: #2e2a47;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(
    from 180deg,
    #ffb6c1,
    #ffd3a5,
    #b5fffc,
    #d4a5ff,
    #ffb6c1
  );
  animation: rotate 20s linear infinite;
  opacity: 0.3;
  z-index: -1;
}

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.container {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border-radius: 25px;
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.1);
  padding: 50px 60px;
  max-width: 700px;
  width: 90%;
  text-align: center;
  transition: transform 0.5s ease;
}

.container:hover {
  transform: translateY(-5px) scale(1.02);
}

h1 {
  font-family: "Playfair Display", serif;
  font-size: 44px;
  color: #423c7b;
  text-shadow: 0 2px 5px rgba(173, 129, 255, 0.3);
  margin-bottom: 25px;
  position: relative;
}

h1::after {
  content: "✦";
  color: #ff9fd3;
  position: absolute;
  right: -20px;
  top: -10px;
  font-size: 20px;
  animation: sparkle 2s infinite ease-in-out;
}

@keyframes sparkle {
  0%, 100% { opacity: 0.5; transform: scale(1);}
  50% { opacity: 1; transform: scale(1.3);}
}

.form-container {
  background-color: #ffffffdd;
  border-radius: 18px;
  padding: 20px 25px;
  box-shadow: 0 8px 30px rgba(175, 138, 255, 0.1);
  margin-bottom: 30px;
  transition: all 0.3s ease;
}

form {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.instructions {
  flex: 1 1 70%;
  padding: 15px 22px;
  border-radius: 50px;
  border: 2px solid #d6c4ff;
  font-size: 16px;
  color: #2e2a47;
  outline: none;
  background: rgba(255, 255, 255, 0.7);
  transition: 0.3s ease;
}

.instructions:focus {
  border-color: #b391ff;
  box-shadow: 0 0 10px rgba(179, 145, 255, 0.4);
}

.submit-button {
  flex: 1 1 25%;
  background: linear-gradient(135deg, #a88beb, #f8ceec);
  color: white;
  border: none;
  border-radius: 50px;
  padding: 14px 24px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.submit-button:hover {
  background: linear-gradient(135deg, #9c6df0, #f7a8e8);
  transform: scale(1.08);
  box-shadow: 0 6px 18px rgba(168, 139, 235, 0.4);
}

.poem {
  background: #ffffffcc;
  border-left: 5px solid #a88beb;
  border-radius: 12px;
  padding: 25px 30px;
  font-size: 18px;
  line-height: 1.8;
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.08);
  animation: fadeIn 1.2s ease forwards;
  position: relative;
}

.poem::before {
  position: absolute;
  left: -35px;
  top: -10px;
  font-size: 22px;
  animation: float 3s ease-in-out infinite;
}

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

.poem strong {
  display: block;
  margin-top: 10px;
  color: #9c6df0;
  font-weight: 700;
}

.generating {
  color: #a88beb;
  font-style: italic;
  animation: blink 1.2s infinite steps(5, start);
}

.hidden {
  display: none;
}

footer {
  font-size: 14px;
  margin-top: 25px;
  color: #6f5da5;
  opacity: 0.8;
}

@keyframes blink {
  to {
    visibility: hidden;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
