* { box-sizing: border-box; }

body {
  margin: 0;
  background: #ebe6de;
  font-family: Arial, sans-serif;
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.card {
  position: relative;
  width: 360px;
  height: 640px;
  perspective: 1600px;
  background: white;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0,0,0,.15);
}

.page {
  position: absolute;
  inset: 0;
  background: white;
  transform-origin: left;
  transform: rotateY(-100deg);
  transition: transform 1s ease;
  backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.page.active {
  transform: rotateY(0);
  z-index: 2;
}

.page img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* COVER */
.cover button {
  position: absolute;
  bottom: 30px;
  background: #f36b8a;
  color: white;
  border: none;
  padding: 14px 30px;
  border-radius: 30px;
  font-size: 16px;
  cursor: pointer;
}

/* NEXT BUTTON */
.next {
  margin-top: 20px;
  padding: 12px 26px;
  border-radius: 30px;
  border: none;
  background: #111;
  color: white;
  cursor: pointer;
}

/* TEXT EDITOR */
.text-editor {
  position: absolute;
  bottom: 30px;
  width: 85%;
  text-align: center;
}

.text-editor textarea {
  width: 100%;
  height: 140px;
  border-radius: 12px;
  padding: 12px;
  font-size: 15px;
  resize: vertical;
}

/* FINAL TEXT ON CARD */
.card-text {
  position: absolute;
  top: 120px;           /* 🔼 texto em cima */
  max-width: 85%;
  text-align: center;
  color: #f36b8a;
  font-family: "Brush Script MT", cursive;
  font-size: 20px;
  white-space: pre-wrap;
  word-break: break-word;
}

/* PHOTO */
.photo-page .bg {
  position: absolute;
  inset: 0;
  object-fit: cover;
}

.photo-frame {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 240px;
  height: 240px;
  border-radius: 20px;
  overflow: hidden;
  background: white;
  z-index: 2;
}

.photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.upload {
  margin-top: 20px;
  z-index: 3;
  background: white;
  padding: 10px 18px;
  border-radius: 20px;
  font-size: 14px;
  cursor: pointer;
}

.upload input {
  display: none;
}

/* FINAL PAGE */
.final {
  justify-content: center;
  text-align: center;
  padding: 40px;
}

#shareBtn {
  margin-top: 20px;
  background: #f36b8a;
  border: none;
  color: white;
  padding: 12px 26px;
  border-radius: 30px;
  font-size: 15px;
  cursor: pointer;
}
