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

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #07182f;
  color: white;
  font-family: 'Cairo', sans-serif;
}

[hidden] {
  display: none !important;
}

.container {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.screen {
  width: 100%;
  max-width: 480px;
  text-align: center;
  animation: fadeIn 1s ease;
}

.heart {
  font-size: 60px;
  color: white;
}

h1, h2 {
  font-family: 'Playfair Display', serif;
  font-weight: 400;
}

.screen p {
  color: #c3d3e8;
}

input {
  display: block;
  width: 100%;
  padding: 15px;
  margin: 25px 0 12px;
  border: 1px solid #aabdd5;
  border-radius: 10px;
  background: #102847;
  color: white;
  font-size: 17px;
  text-align: center;
}

input::placeholder {
  color: #aabdd5;
}

button {
  cursor: pointer;
  font-family: 'Cairo', sans-serif;
}

#unlockBtn {
  width: 100%;
  padding: 14px;
  background: white;
  color: #07182f;
  border: none;
  border-radius: 10px;
  font-weight: bold;
  font-size: 16px;
}

#errorMessage {
  color: #ffb8c0;
}

/* Envelope */

.envelope {
  position: relative;
  display: block;
  width: 280px;
  height: 185px;
  margin: 55px auto;
  padding: 0;
  border: none;
  background: transparent;
}

.envelope-back {
  position: absolute;
  inset: 0;
  background: #dce8f7;
  border-radius: 5px;
}

.letter-preview {
  position: absolute;
  left: 8%;
  bottom: 12px;
  width: 84%;
  height: 140px;
  background: white;
  color: #07182f;
  font-size: 30px;
  padding-top: 25px;
  transition: transform 0.8s;
}

.envelope-front {
  position: absolute;
  inset: 0;
  background: #9eb4d0;
  clip-path: polygon(0 100%, 50% 43%, 100% 100%);
}

.envelope-flap {
  position: absolute;
  inset: 0;
  background: #c4d4e8;
  clip-path: polygon(0 0, 100% 0, 50% 58%);
  transform-origin: top;
  transition: transform 0.8s;
  z-index: 3;
}

.seal {
  position: absolute;
  top: 75px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  width: 36px;
  height: 36px;
  line-height: 36px;
  border-radius: 50%;
  background: #07182f;
  color: white;
  font-size: 23px;
  transition: opacity 0.4s;
}

.envelope.open .envelope-flap {
  transform: rotateX(180deg);
}

.envelope.open .letter-preview {
  transform: translateY(-105px);
}

.envelope.open .seal {
  opacity: 0;
}

/* Letter */

#letterScreen {
  width: 100%;
  max-width: 520px;
  animation: fadeIn 1s ease;
}

.paper {
  background: white;
  color: #102847;
  padding: 35px 25px;
  border-radius: 5px;
  box-shadow: 0 15px 50px #0005;
}

.top-heart {
  color: #9eb4d0;
  font-size: 32px;
}

.paper h2 {
  color: #07182f;
  font-size: 25px;
  text-align: center;
}

.divider {
  width: 65px;
  height: 2px;
  background: #9eb4d0;
  margin: 22px auto 28px;
}

.message {
  direction: rtl;
  text-align: right;
  color: #263d59;
  font-size: 15px;
  line-height: 2.1;
}

.message p {
  opacity: 0;
  transform: translateY(12px);
  transition: 1s;
  margin-bottom: 20px;
}

.message p.show {
  opacity: 1;
  transform: translateY(0);
}

.signature {
  text-align: center;
  margin-top: 35px;
  color: #07182f;
}

.signature h3 {
  font-family: 'Playfair Display', serif;
  font-size: 27px;
}

.footer {
  text-align: center;
  color: #8299b8;
  font-family: 'Playfair Display', serif;
  margin-top: 35px;
}

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