@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800&display=swap');

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  direction: rtl;
  color: white;
  text-align: center;
  font-family: "Cairo", sans-serif;
  background: linear-gradient(135deg, #ff5e8e, #9b2c5d, #35102a);
  overflow-x: hidden;
}

.login-page {
  display: grid;
  place-items: center;
  padding: 20px;
}

.login-box {
  width: min(430px, 100%);
  padding: 38px 26px;
  border: 1px solid #ffffff7d;
  border-radius: 28px;
  background: #ffffff1c;
  box-shadow: 0 12px 40px #0006;
  backdrop-filter: blur(12px);
}

.login-heart {
  font-size: 48px;
  animation: pulse 1.3s infinite alternate;
}

.login-box h1 {
  margin: 8px 0;
  font-size: 31px;
}

.login-box p {
  color: #ffe4ed;
}

input,
button {
  border: none;
  border-radius: 13px;
  font-family: inherit;
  font-size: 16px;
}

input {
  display: block;
  width: 100%;
  padding: 14px;
  margin: 22px 0 12px;
  outline: none;
  text-align: center;
}

button {
  padding: 13px 22px;
  color: #b51e57;
  background: white;
  font-weight: 800;
  cursor: pointer;
  transition: 0.25s;
}

button:hover {
  background: #ffe0ea;
  transform: scale(1.06);
}

#error {
  min-height: 25px;
  margin: 14px 0 0;
  color: #fff0a6;
}

.hero {
  padding: 70px 20px 35px;
}

.small-title {
  margin: 0;
  color: #ffd9e6;
  font-size: 18px;
}

.hero h1 {
  margin: 8px 0 28px;
  font-size: clamp(30px, 6vw, 55px);
}

.timer {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 13px;
  margin-bottom: 28px;
}

.time-card {
  width: 105px;
  padding: 17px 8px;
  border: 1px solid #ffffff5e;
  border-radius: 20px;
  background: #ffffff21;
  box-shadow: 0 7px 20px #0003;
  backdrop-filter: blur(7px);
}

.time-card span {
  display: block;
  font-size: 34px;
  font-weight: 800;
  line-height: 1;
}

.time-card small {
  display: block;
  margin-top: 8px;
  color: #ffe4ed;
  font-size: 15px;
}

.music-player {
  width: min(430px, 90vw);
  margin: 25px auto 0;
  padding: 18px;
  border: 1px solid #ffffff6b;
  border-radius: 22px;
  background: #ffffff1f;
  box-shadow: 0 8px 20px #0003;
  backdrop-filter: blur(7px);
}

.music-button {
  font-size: 18px;
  box-shadow: 0 6px 18px #0004;
}

.music-controls {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 14px 0;
}

.music-controls button {
  padding: 9px 12px;
  font-size: 13px;
}

.progress-bar {
  width: 100%;
  height: 7px;
  margin: 5px 0;
  cursor: pointer;
  accent-color: #ff3f7d;
}

.music-time {
  display: flex;
  justify-content: space-between;
  margin-top: 7px;
  color: #ffe4ed;
  font-size: 14px;
}

.memories {
  padding: 30px 20px 55px;
}

.memories h2,
.letter-section h2 {
  font-size: 28px;
}

.gallery {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 18px;
}

.gallery img {
  width: min(280px, 85vw);
  height: 360px;
  border: 5px solid white;
  border-radius: 20px;
  object-fit: cover;
  box-shadow: 0 10px 30px #0006;
  transition: 0.3s;
}

.gallery img:hover {
  transform: translateY(-8px) rotate(2deg);
}

.video-box {
  width: min(750px, 92vw);
  margin: 30px auto 0;
  overflow: hidden;
  border: 4px solid white;
  border-radius: 20px;
  background: #160916;
  box-shadow: 0 10px 30px #0006;
}

.video-box video {
  display: block;
  width: 100%;
  max-height: 500px;
}

.letter-section {
  min-height: 480px;
  padding: 15px 20px 40px;
}

.envelope {
  position: relative;
  width: min(340px, 86vw);
  height: 215px;
  margin: 60px auto;
  cursor: pointer;
  perspective: 1000px;
}

.envelope-back {
  position: absolute;
  inset: 0;
  border-radius: 0 0 14px 14px;
  background: #ff9fbd;
  box-shadow: 0 15px 28px #0005;
}

.envelope-front {
  position: absolute;
  z-index: 4;
  inset: 0;
  border-radius: 0 0 14px 14px;
  background: #ffd1df;
  clip-path: polygon(0 0, 50% 53%, 100% 0, 100% 100%, 0 100%);
}

.envelope-flap {
  position: absolute;
  z-index: 6;
  top: 0;
  width: 100%;
  height: 125px;
  background: #ff85ad;
  clip-path: polygon(0 0, 50% 100%, 100% 0);
  transform-origin: top;
  transition: transform 0.8s ease;
}

.seal {
  position: absolute;
  z-index: 7;
  top: 89px;
  left: 50%;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: #d51f59;
  box-shadow: 0 3px 8px #0004;
  transform: translateX(-50%);
  transition: opacity 0.25s;
}

.paper {
  position: absolute;
  z-index: 2;
  right: 17px;
  bottom: 13px;
  left: 17px;
  min-height: 175px;
  padding: 15px 13px;
  border-radius: 10px;
  color: #671435;
  background: #fffafc;
  text-align: right;
  opacity: 0;
  transform: translateY(0);
  transition: transform 0.8s ease, opacity 0.15s ease;
}

.paper h3 {
  margin: 0 0 10px;
  font-size: 17px;
  text-align: center;
}

.paper p {
  margin: 0;
  font-size: 13px;
  line-height: 1.9;
}

.signature {
  margin-top: 10px !important;
  font-weight: 800;
}

.envelope.open .envelope-flap {
  z-index: 1;
  transform: rotateX(180deg);
}

.envelope.open .seal {
  opacity: 0;
}

.envelope.open .paper {
  z-index: 5;
  opacity: 1;
  transform: translateY(-155px);
}

.next-section {
  padding: 25px 20px 70px;
}

.next-section p {
  color: #ffe1eb;
  font-size: 18px;
}

.next-button,
.back-button {
  display: inline-block;
  padding: 15px 25px;
  border-radius: 14px;
  color: #b51e57;
  background: white;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 6px 18px #0004;
  transition: 0.25s;
}

.next-button:hover,
.back-button:hover {
  background: #ffe0ea;
  transform: scale(1.06);
}

.typed-letter-section {
  padding: 25px 20px 50px;
}

.message-card {
  width: min(650px, 92vw);
  margin: auto;
  padding: 35px 25px;
  border: 1px solid #ffffff8a;
  border-radius: 25px;
  color: #6b1740;
  background: #fffafc;
  box-shadow: 0 12px 35px #0005;
  text-align: right;
}

.message-card h2 {
  color: #b51e57;
  text-align: center;
}

.message-card p {
  min-height: 30px;
  font-size: 17px;
  line-height: 2.1;
}

.card-heart {
  color: #e91e63;
  font-size: 34px;
  text-align: center;
  animation: pulse 1.3s infinite alternate;
}

.back-button {
  margin: 0 0 45px;
}

.heart {
  position: fixed;
  z-index: -1;
  bottom: -40px;
  color: #ffd2e1;
  pointer-events: none;
  animation: floatUp linear forwards;
}

@keyframes floatUp {
  to {
    opacity: 0;
    transform: translateY(-115vh) rotate(360deg);
  }
}

@keyframes pulse {
  to {
    transform: scale(1.2);
  }
}

footer {
  padding: 35px 20px;
  color: #ffe1eb;
}