* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --rosa-claro: #ffe4e8;
  --rosa-pastel: #ffd1dc;
  --rosa-suave: #ffb6c1;
  --rosa-medio: #ff96ab;
  --rosa-intenso: #ff69b4;
  --rosa-fuerte: #ff1493;
  --rosa-oscuro: #c71585;
  --blanco-rosa: #fff5f7;
  --gris-rosa: #e8d5d9;
  --dorado-suave: #ffd700;
  --sombra-suave: rgba(255, 105, 180, 0.15);
  --sombra-media: rgba(255, 105, 180, 0.25);
  --sombra-fuerte: rgba(255, 105, 180, 0.35);
  --texto-principal: #5a4a4e;
  --texto-secundario: #8b7377;
}

body {
  background: linear-gradient(
    135deg,
    var(--rosa-claro) 0%,
    var(--rosa-pastel) 50%,
    var(--rosa-suave) 100%
  );
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  min-height: 100vh;
  padding: 40px 20px;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  overflow-x: hidden;
  position: relative;
  font-family: "Quicksand", sans-serif;
}

/* ============== ESTILOS DE AUTENTICACIÓN Y LOADING ============== */
.auth-screen,
.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    135deg,
    var(--rosa-claro) 0%,
    var(--rosa-pastel) 50%,
    var(--rosa-suave) 100%
  );
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  transition: opacity 0.5s ease;
}

.loading-screen {
  display: none;
}

.loading-screen.hidden,
.auth-screen.hidden {
  display: none;
}

.auth-container,
.loading-container {
  background: white;
  padding: 50px 40px;
  border-radius: 25px;
  box-shadow: 0 20px 60px var(--sombra-fuerte);
  text-align: center;
  max-width: 400px;
  width: 90%;
  border: 5px solid var(--rosa-pastel);
}

.loading-container {
  padding: 60px 40px;
}

.auth-header {
  margin-bottom: 30px;
}

.auth-corazon,
.loading-corazon {
  width: 60px;
  height: 60px;
  background: var(--rosa-intenso);
  transform: rotate(45deg);
  margin: 0 auto 20px;
  position: relative;
  animation: latido 1.5s infinite;
}

.auth-corazon::before,
.auth-corazon::after,
.loading-corazon::before,
.loading-corazon::after {
  content: "";
  position: absolute;
  width: 60px;
  height: 60px;
  background: var(--rosa-intenso);
  border-radius: 50%;
}

.auth-corazon::before,
.loading-corazon::before {
  top: -30px;
}

.auth-corazon::after,
.loading-corazon::after {
  right: 30px;
}

.auth-header h2 {
  font-family: "Playfair Display", serif;
  font-size: 32px;
  color: var(--texto-principal);
  margin-bottom: 10px;
}

.auth-header p,
.loading-container p {
  font-family: "Quicksand", sans-serif;
  color: var(--texto-secundario);
  font-size: 16px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.auth-input {
  padding: 15px 20px;
  border: 3px solid var(--rosa-pastel);
  border-radius: 15px;
  font-family: "Quicksand", sans-serif;
  font-size: 16px;
  transition: all 0.3s ease;
  outline: none;
}

.auth-input:focus {
  border-color: var(--rosa-intenso);
  box-shadow: 0 0 15px var(--sombra-media);
}

.auth-button {
  padding: 15px 30px;
  background: linear-gradient(
    135deg,
    var(--rosa-intenso) 0%,
    var(--rosa-fuerte) 100%
  );
  color: white;
  border: none;
  border-radius: 15px;
  font-family: "Quicksand", sans-serif;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 8px 25px var(--sombra-media);
  position: relative;
}

.auth-button:hover:not(:disabled) {
  transform: translateY(-3px);
  box-shadow: 0 12px 35px var(--sombra-fuerte);
}

.auth-button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.loader {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loader.hidden,
#button-text.hidden {
  display: none;
}

.error-message {
  color: #d32f2f;
  font-family: "Quicksand", sans-serif;
  font-size: 14px;
  display: none;
  background: #ffebee;
  padding: 10px;
  border-radius: 8px;
  margin-top: -5px;
}

.shake {
  animation: shake 0.5s;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-10px);
  }
  75% {
    transform: translateX(10px);
  }
}

.main-content {
  transition: opacity 0.5s ease;
  opacity: 0;
}

.main-content.hidden {
  display: none;
}

/* ============== DECORACIÓN DE FONDO ============== */
.fondo-decoracion {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.corazon-flotante {
  position: absolute;
  width: 20px;
  height: 20px;
  background: var(--rosa-suave);
  transform: rotate(45deg);
  opacity: 0.5;
  animation: flotar 15s infinite ease-in-out;
}

.corazon-flotante::before,
.corazon-flotante::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  background: var(--rosa-suave);
  border-radius: 50%;
}

.corazon-flotante::before {
  top: -10px;
}

.corazon-flotante::after {
  left: 10px;
}

.corazon-flotante:nth-child(1) {
  left: 10%;
  animation-delay: 0s;
}
.corazon-flotante:nth-child(2) {
  left: 30%;
  animation-delay: 2s;
}
.corazon-flotante:nth-child(3) {
  left: 50%;
  animation-delay: 4s;
}
.corazon-flotante:nth-child(4) {
  left: 70%;
  animation-delay: 6s;
}
.corazon-flotante:nth-child(5) {
  left: 90%;
  animation-delay: 8s;
}

@keyframes flotar {
  0% {
    top: -10%;
    transform: rotate(45deg) scale(1);
  }
  50% {
    transform: rotate(45deg) scale(1.2);
  }
  100% {
    top: 110%;
    transform: rotate(45deg) scale(1);
  }
}

/* ============== HEADER PRINCIPAL ============== */
.header-principal {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 40px;
  z-index: 1;
  position: relative;
}

h1 {
  font-family: "Playfair Display", serif;
  text-align: center;
  font-size: 48px;
  color: var(--texto-principal);
  text-shadow: 2px 2px 4px var(--sombra-suave);
  font-weight: 700;
}

/* ============== ESTILOS DE LA CARTA ============== */
.contenedor-carta {
  width: 420px;
  margin: 0 auto 60px auto; 
  z-index: 1;
  position: relative;
  display: flex;
  justify-content: center; 
}

.envoltura-sobre {
  position: relative;
  background: linear-gradient(
    135deg,
    var(--rosa-pastel) 0%,
    var(--rosa-suave) 100%
  );
  box-shadow: 0 10px 40px var(--sombra-media);
  border-radius: 20px;
}

.sobre {
  position: relative;
  width: 420px;
  height: 320px;
  cursor: pointer;
}

.sobre::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 4;
  border-top: 190px solid var(--rosa-medio);
  border-right: 210px solid transparent;
  border-left: 210px solid transparent;
  transform-origin: top;
  transition: all 0.5s ease-in-out 0.7s;
  border-radius: 15px;
  filter: drop-shadow(0 5px 15px var(--sombra-media));
}

.solapa-derecha {
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  clip-path: polygon(100% 0, 0 100%, 100% 100%);
  background: linear-gradient(
    135deg,
    var(--rosa-suave) 0%,
    var(--rosa-intenso) 100%
  );
  border-bottom-right-radius: 15px;
  border-top-right-radius: 15px;
  border-bottom-left-radius: 15px;
}

.solapa-izquierda {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  clip-path: polygon(0 0, 0 100%, 100% 100%);
  background: linear-gradient(
    135deg,
    var(--rosa-intenso) 0%,
    var(--rosa-suave) 100%
  );
  border-top-left-radius: 15px;
  border-bottom-left-radius: 15px;
  border-bottom-right-radius: 15px;
}

.carta {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 100%;
  background: var(--blanco-rosa);
  text-align: center;
  box-shadow: 0 5px 20px var(--sombra-media);
  padding: 25px;
  border-radius: 15px;
  transition: transform 0.5s ease-in-out;
}

.contenido {
  color: var(--texto-principal);
  text-align: left;
  font-size: 14px;
  border: 3px solid var(--rosa-medio);
  border-style: double;
  padding: 20px;
  height: 100%;
  line-height: 1.6;
  cursor: pointer;
  overflow-y: scroll;
  border-radius: 10px;
  background: white;
}

.carta-header {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid var(--rosa-pastel);
}

.carta-header h2 {
  font-family: "Playfair Display", serif;
  color: var(--rosa-fuerte);
  font-size: 24px;
  margin: 0;
}

.contenido strong {
  color: var(--rosa-fuerte);
  font-weight: 700;
}

.contenido em {
  color: var(--rosa-intenso);
  font-style: italic;
}

.contenido p {
  margin-bottom: 15px;
  text-align: justify;
}

.firma {
  margin-top: 25px;
  padding-top: 20px;
  border-top: 2px solid var(--rosa-pastel);
  text-align: center;
}

.firma p {
  margin-bottom: 8px;
}

.corazon {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 35px;
  height: 35px;
  background: linear-gradient(
    135deg,
    var(--rosa-fuerte) 0%,
    var(--rosa-oscuro) 100%
  );
  transform: translate(-50%, 0) rotate(45deg);
  transition: transform 0.5s ease-in-out 1s;
  z-index: 999;
  cursor: pointer;
  box-shadow: 0 0 25px var(--rosa-intenso);
  animation: latido 1.5s infinite;
}

@keyframes latido {
  0%,
  100% {
    transform: translate(-50%, 0) rotate(45deg) scale(1);
  }
  50% {
    transform: translate(-50%, 0) rotate(45deg) scale(1.1);
  }
}

.corazon::before,
.corazon::after {
  content: "";
  position: absolute;
  width: 35px;
  height: 35px;
  background: linear-gradient(
    135deg,
    var(--rosa-fuerte) 0%,
    var(--rosa-oscuro) 100%
  );
  border-radius: 100%;
}

.corazon:before {
  top: -17px;
}

.corazon:after {
  right: 17px;
}

.abierto .sobre::before {
  transform: rotateX(180deg);
  z-index: 0;
}

.abierto .corazon {
  transform: translate(-50%, 0) rotate(90deg) scale(1.2);
  transition-delay: 0.4s;
}

.carta.mostrar-carta {
  transform: translateY(-310px);
  transition: transform 0.5s ease-in-out;
}

.carta.cerrando-carta {
  transform: translateY(-310px);
  transition: transform 0.5s ease-in-out;
}

.carta.abierta {
  z-index: 10000;
}

.envoltura-sobre.desactivar-sobre .sobre::before {
  pointer-events: none;
}

/* ============== SECCIÓN CONTADOR ============== */
.seccion-contador {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 60px 0;
  z-index: 1;
  position: relative;
}

.frase-contador {
  font-family: "Playfair Display", serif;
  font-size: 32px;
  color: var(--texto-principal);
  font-weight: 700;
  text-align: center;
  margin-bottom: 30px;
  text-shadow: 2px 2px 4px var(--sombra-suave);
}

.contador-tiempo {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  justify-content: center;
}

.unidad-tiempo {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: linear-gradient(135deg, var(--blanco-rosa) 0%, white 100%);
  padding: 20px 25px;
  border-radius: 15px;
  box-shadow: 0 8px 25px var(--sombra-media);
  border: 3px solid var(--rosa-pastel);
  min-width: 100px;
  transition: all 0.3s ease;
}

.unidad-tiempo:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 35px var(--sombra-fuerte);
}

.unidad-tiempo .numero {
  font-family: "Quicksand", sans-serif;
  font-size: 42px;
  font-weight: 700;
  color: var(--rosa-fuerte);
  line-height: 1;
  margin-bottom: 8px;
  text-shadow: 2px 2px 4px var(--sombra-suave);
  transition: all 0.3s ease;
}

.unidad-tiempo .etiqueta {
  font-family: "Quicksand", sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--texto-secundario);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.subtitulo-contador {
  font-family: "Quicksand", sans-serif;
  font-size: 16px;
  color: var(--texto-secundario);
  font-style: italic;
}

/* ============== CARRUSEL ============== */
.container-carrusel {
  position: relative;
  width: 1000px;
  height: 600px;
  background: linear-gradient(
    135deg,
    var(--blanco-rosa) 0%,
    var(--rosa-claro) 100%
  );
  box-shadow: 0 20px 60px var(--sombra-fuerte);
  margin: 40px 0;
  border-radius: 25px;
  overflow: hidden;
  border: 5px solid white;
  z-index: 1;
}

.container-carrusel .slide .item {
  width: 200px;
  height: 300px;
  position: absolute;
  top: 50%;
  transform: translate(0, -50%);
  border-radius: 25px;
  box-shadow: 0 15px 40px var(--sombra-media);
  background-position: center;
  background-size: cover;
  display: inline-block;
  transition: 0.5s;
  border: 4px solid white;
  cursor: pointer;
  pointer-events: auto;
}

.slide .item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  border-radius: 22px;
  z-index: 1;
  transition: all 0.3s ease;
}

.slide .item:nth-child(3):hover::before,
.slide .item:nth-child(4):hover::before,
.slide .item:nth-child(5):hover::before {
  background: rgba(255, 255, 255, 0.1);
}

.slide .item:nth-child(1),
.slide .item:nth-child(2) {
  top: 0;
  left: 0;
  transform: translate(0, 0);
  border-radius: 25px;
  width: 100%;
  height: 100%;
  border: none;
}

.slide .item:nth-child(2)::before {
  background: linear-gradient(to bottom, transparent 70%, rgba(0, 0, 0, 0.2));
}

.slide .item:nth-child(1) {
  cursor: default;
  pointer-events: none;
}

.slide .item:nth-child(2) {
  cursor: default;
}

.slide .item:nth-child(3) {
  left: 50%;
}

.slide .item:nth-child(4) {
  left: calc(50% + 220px);
}

.slide .item:nth-child(5) {
  left: calc(50% + 440px);
}

.slide .item:nth-child(n + 6) {
  left: calc(50% + 660px);
  opacity: 0;
}

.slide .item:nth-child(3):hover,
.slide .item:nth-child(4):hover,
.slide .item:nth-child(5):hover {
  transform: translate(0, -50%) scale(1.05);
  box-shadow: 0 20px 50px var(--sombra-fuerte);
}

.item .content {
  position: absolute;
  top: 50%;
  left: 80px;
  width: 450px;
  text-align: left;
  color: #fff;
  transform: translate(0, -50%);
  display: none;
  z-index: 2;
  pointer-events: none;
}

.slide .item:nth-child(2) .content {
  display: block;
}

.content .fecha-badge {
  display: inline-block;
  background: white;
  padding: 10px 25px;
  border-radius: 25px;
  margin-bottom: 20px;
  box-shadow: 0 5px 15px var(--sombra-media);
  opacity: 0;
  animation: animate 1s ease-in-out 0.2s 1 forwards;
}

.content .fecha {
  font-family: "Quicksand", sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--rosa-fuerte);
  margin: 0;
}

.content .name {
  font-family: "Playfair Display", serif;
  font-size: 52px;
  font-weight: bold;
  opacity: 0;
  animation: animate 1s ease-in-out 0.4s 1 forwards;
  text-shadow: 3px 3px 10px rgba(0, 0, 0, 0.8);
  line-height: 1.2;
  margin-bottom: 15px;
}

.content .des {
  font-family: "Quicksand", sans-serif;
  margin-top: 20px;
  font-size: 18px;
  line-height: 1.7;
  opacity: 0;
  animation: animate 1s ease-in-out 0.6s 1 forwards;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.7);
  max-width: 400px;
}

@keyframes animate {
  from {
    opacity: 0;
    transform: translate(0, 100px);
    filter: blur(33px);
  }
  to {
    opacity: 1;
    transform: translate(0);
    filter: blur(0);
  }
}

.indicador-navegacion {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  pointer-events: none;
}

.texto-hint {
  font-family: "Quicksand", sans-serif;
  font-size: 14px;
  color: var(--texto-secundario);
  background: rgba(255, 255, 255, 0.9);
  padding: 8px 20px;
  border-radius: 20px;
  box-shadow: 0 4px 15px var(--sombra-media);
  animation: parpadeo 2s infinite ease-in-out;
}

@keyframes parpadeo {
  0%,
  100% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
}

::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--rosa-claro);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(
    180deg,
    var(--rosa-medio) 0%,
    var(--rosa-intenso) 100%
  );
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(
    180deg,
    var(--rosa-intenso) 0%,
    var(--rosa-fuerte) 100%
  );
}

/* ============== RESPONSIVE ============== */
@media screen and (max-width: 1050px) {
  .container-carrusel {
    width: 90vw;
    max-width: 800px;
    height: 500px;
  }

  .container-carrusel .slide .item {
    width: 180px;
    height: 270px;
  }

  .slide .item:nth-child(3) {
    left: 52%;
  }

  .slide .item:nth-child(4) {
    left: calc(52% + 200px);
  }

  .slide .item:nth-child(5) {
    left: calc(52% + 400px);
  }

  .item .content {
    left: 50px;
    width: 400px;
  }

  .content .name {
    font-size: 42px;
  }

  .content .des {
    font-size: 16px;
  }
}

@media screen and (max-width: 768px) {
  h1 {
    font-size: 38px;
  }

  .contenedor-carta {
    width: 90vw;
    max-width: 380px;
  }

  .sobre {
    width: 100%;
    height: 280px;
  }

  .sobre::before {
    border-top: 165px solid var(--rosa-medio);
    border-right: 45vw solid transparent;
    border-left: 45vw solid transparent;
  }

  .frase-contador {
    font-size: 26px;
    padding: 0 20px;
  }

  .unidad-tiempo {
    padding: 18px 22px;
    min-width: 90px;
  }

  .unidad-tiempo .numero {
    font-size: 36px;
  }

  .unidad-tiempo .etiqueta {
    font-size: 12px;
  }

  .container-carrusel {
    width: 92vw;
    height: 450px;
  }

  .container-carrusel .slide .item {
    width: 150px;
    height: 220px;
  }

  .slide .item:nth-child(3) {
    left: 55%;
  }

  .slide .item:nth-child(4) {
    left: calc(55% + 165px);
  }

  .slide .item:nth-child(5) {
    left: calc(55% + 330px);
  }

  .item .content {
    left: 30px;
    width: 85%;
    top: 45%;
  }

  .content .fecha-badge {
    padding: 8px 18px;
  }

  .content .fecha {
    font-size: 14px;
  }

  .content .name {
    font-size: 32px;
  }

  .content .des {
    font-size: 15px;
  }
}

@media screen and (max-width: 600px) {
  h1 {
    font-size: 32px;
    padding: 0 10px;
  }

  .auth-container,
  .loading-container {
    padding: 40px 25px;
  }

  .auth-header h2 {
    font-size: 26px;
  }

  .auth-corazon,
  .loading-corazon {
    width: 50px;
    height: 50px;
  }

  .auth-corazon::before,
  .auth-corazon::after,
  .loading-corazon::before,
  .loading-corazon::after {
    width: 50px;
    height: 50px;
  }

  .auth-corazon::before,
  .loading-corazon::before {
    top: -25px;
  }

  .auth-corazon::after,
  .loading-corazon::after {
    right: 25px;
  }

  .contenedor-carta {
    width: 95vw;
    max-width: 340px;
  }

  .sobre {
    width: 100%;
    height: 260px;
  }

  .sobre::before {
    border-top: 155px solid var(--rosa-medio);
    border-right: 47.5vw solid transparent;
    border-left: 47.5vw solid transparent;
  }

  .frase-contador {
    font-size: 22px;
    padding: 0 15px;
  }

  .contador-tiempo {
    gap: 8px;
  }

  .unidad-tiempo {
    padding: 15px 18px;
    min-width: 75px;
  }

  .unidad-tiempo .numero {
    font-size: 28px;
  }

  .unidad-tiempo .etiqueta {
    font-size: 10px;
  }

  .subtitulo-contador {
    font-size: 13px;
    padding: 0 20px;
    text-align: center;
  }

  .container-carrusel {
    width: 95vw;
    height: 400px;
    border: 3px solid white;
  }

  .container-carrusel .slide .item {
    width: 120px;
    height: 180px;
    border: 2px solid white;
  }

  .slide .item:nth-child(3) {
    left: 58%;
  }

  .slide .item:nth-child(4) {
    left: calc(58% + 135px);
  }

  .slide .item:nth-child(5) {
    left: calc(58% + 270px);
  }

  .item .content {
    left: 15px;
    width: calc(100% - 30px);
    top: 50%;
  }

  .content .fecha-badge {
    padding: 6px 15px;
    margin-bottom: 12px;
  }

  .content .fecha {
    font-size: 12px;
  }

  .content .name {
    font-size: 24px;
    margin-bottom: 10px;
  }

  .content .des {
    font-size: 13px;
    margin-top: 10px;
    line-height: 1.5;
  }

  .indicador-navegacion {
    bottom: 15px;
  }

  .texto-hint {
    font-size: 11px;
    padding: 6px 12px;
  }
}

@media screen and (max-width: 400px) {
  h1 {
    font-size: 28px;
  }

  .frase-contador {
    font-size: 20px;
  }

  .unidad-tiempo {
    padding: 12px 15px;
    min-width: 65px;
  }

  .unidad-tiempo .numero {
    font-size: 24px;
  }

  .unidad-tiempo .etiqueta {
    font-size: 9px;
  }

  .container-carrusel {
    height: 350px;
  }

  .container-carrusel .slide .item {
    width: 100px;
    height: 150px;
  }

  .slide .item:nth-child(3) {
    left: 60%;
  }

  .slide .item:nth-child(4) {
    left: calc(60% + 115px);
  }

  .slide .item:nth-child(5) {
    left: calc(60% + 230px);
  }

  .content .name {
    font-size: 20px;
  }

  .content .des {
    font-size: 12px;
  }
}
