/* ======== ESTILOS GERAIS (Momoizin) ======== */
body {
  margin: 0;
  height: 100vh;
  background: #ddd0d0;
  font-family: Arial, sans-serif;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* ======== ECG FUNDO (Momoizin) ======== */
.ecg-bg {
  position: fixed;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0.6;
  transform: translateY(170px); /* move pra baixo como no original */
  z-index: 1;
  pointer-events: none; /* Garante que não bloqueie cliques na carta */
}

.ecg-bg svg {
  width: 120%;
}

#line {
  fill: none;
  stroke: #ff0101;
  stroke-width: 2;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: dash 4s linear infinite;
}

#heart {
  fill: #ff3f3f;
  stroke: #ff0101;
}

@keyframes dash {
  0% { stroke-dashoffset: 1; }
  80% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 0; }
}

/* ======== CONTAINER DA CARTA (Posicionamento central) ======== */
.envelope-wrapper {
    position: absolute;
    top:  30%; /* Centralizado verticalmente próximo ao topo como o antigo login */
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10; /* Acima do ECG */
}

/* ======== ENVELOPE (Estilos Valentines adaptados) ======== */
/* No seu style.css */
#envelope {
    position: relative;
    height: 180px;
    width: 280px;
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
    background-color: #ff748d; /* Mesma cor das laterais do pocket */
    cursor: pointer;
}

.front {
    position: absolute;
    width: 0;
    height: 0;
    z-index: 3;
}

.flap {
    border-top: 98px solid #ff2a22; /* Cor original */
    border-left: 140px solid transparent;
    border-right: 140px solid transparent;
    border-bottom: 82px solid transparent;
    transform-origin: top;
    z-index: 5;
}

.pocket {
    border-left: 140px solid #ff748d;
    border-right: 140px solid #ff748d;
    border-bottom: 90px solid #ff98a7;
    border-top: 90px solid transparent;
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
    z-index: 4; /* 🔥 FICA NA FRENTE DA CARTA */
}

/* ======== CARTA INTERNA (Papel branco expandido) ======== */
.letter {
    position: absolute;
    background-color: white;
    width: 90%;
    height: 100%; /* Altura total inicial */
    top: 5%;
    left: 5%;
    border-radius: 10px;
    z-index: 2;
    transition: all 0.4s ease;
    overflow: hidden; /* Esconde o login quando fechada */
    padding: 10px;
    box-sizing: border-box;
    z-index: 2; /* 🔥 FICA ATRÁS DA POCKET */
}

/* Conteúdo do Login dentro da carta */
.login-content {
    opacity: 0; /* Invisível quando fechado */
    transition: opacity 0.3s 0.6s ease; /* Aparece após a carta subir */
    text-align: center;
    margin-top: 15px; /* Espaço para o flap */
    position: relative;
    z-index: 20;
}

.login-content h1 {
    font-size: 18px;
    color: #333;
    margin-bottom: 10px;
}

.login-content input {
    display: block;
    width: 80%;
    margin: 8px auto;
    padding: 8px;
    border-radius: 5px;
    border: 1px solid #ccc;
    background: #f9f9f9;
    color: #333;
    font-size: 14px;
}

.login-content button {
    background-color: #ff1a1a;
    color: white;
    padding: 8px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    margin-top: 10px;
}

/* ======== ANIMAÇÕES DE ABRIR/FECHAR (Valentines) ======== */
.open .flap {
    transform: rotatex(180deg);
    transition: transform 0.4s ease, z-index 0.6s;
    z-index: 1;
}

.close .flap {
    transform: rotatex(0deg);
    transition: transform 0.4s 0.6s ease, z-index 1s;
    z-index: 5;
}

.open .letter {
    transform: translatey(-150px);
    height: 230px;
    z-index: 2;
    /* Adicione estas linhas abaixo */
    transition: transform 0.4s ease, height 0.4s ease;
    transition-delay: 0.3s; /* Ela espera 0.3s (o tempo da aba) para começar */
}

.open .login-content {
    opacity: 1; /* Mostra o login */
}

.close .letter {
    transform: translatey(0deg);
    height: 90%; /* Ajuste aqui: 97% deve ser suficiente para esconder o branco */
    transition: transform 0.4s ease, z-index 1s, height 0.4s ease;
    z-index: 1;
}

/* ======== CORAÇÕES ANIMADOS (Valentines) ======== */
.hearts {
    position: absolute;
    top: 90px;
    left: 0;
    right: 0;
    z-index: 2;
}

.heart {
    position: absolute;
    left: 0;
    right: 0;
    pointer-events: none; /* 🔥 AQUI */
}

.heart:before, .heart:after {
    position: absolute;
    content: "";
    background: #d00000;
    width: 50px;
    height: 80px;
    left: 50px;
    top: 0;
    border-radius: 50px 50px 0 0;
    transform: rotate(-45deg);
    transform-origin: 0 100%;
}

.heart:after {
    left: 0;
    transform: rotate(45deg);
    transform-origin: 100% 100%;
}

.close .heart {
    opacity: 0;
    animation: none;
}

.a1 { left: 20%; transform: scale(0.6); animation: slideUp 4s linear 1; animation-delay: 0.7s;}
.a2 { left: 55%; transform: scale(1); animation: slideUp 5s linear 1; animation-delay: 0.7s;}
.a3 { left: 10%; transform: scale(0.8); animation: slideUp 7s linear 1; animation-delay: 0.7s;}

@keyframes slideUp {
    0% { top: 0; opacity: 1;}
    100% { top: -600px; opacity: 0;}
}

/* EFEITOS ADICIONAIS (Momoizin) */
.flash {
  position: fixed;
  width: 100%;
  height: 100%;
  background: #ff1a1a;
  opacity: 0;
  pointer-events: none;
  z-index: 2;
}
