html, body {
    height: 100%;
	width: 100%;
    margin: 0; /* Elimina los márgenes predeterminados del body */
    padding: 0; /* Elimina el padding predeterminado del body */
    font-family: Arial, sans-serif; /* Fuente de ejemplo */
}
body{
    background-color: #D9DEDE;
    
    display: flex;
    justify-content: center; /* Centrado horizontal automático */
    align-items: center;     /* Centrado vertical automático */
    min-height: 100vh;       /* Clave: Asegura que el body ocupe todo el alto de la pantalla */
}
.form-container {
    width: 90%;
    max-width: 420px;
    max-height: 85vh; /* Permite que el contenedor crezca pero no salga de la pantalla */
    min-height: 320px;
    position: relative;
    perspective: 1000px;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Elimina cualquier margin-top antiguo. Flexbox se encarga del centrado */
    margin: 0 auto;
}

.form-card {
    width: 100%;
    height: 100%;
    position: absolute;
    backface-visibility: hidden; /* Hides the back of the element during rotation */
    transition: transform 0.6s; /* Smooth transition for the flip */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    background-color: #fff;
}

.form-front {
    transform: rotateY(0deg);
}

.form-back {
    transform: rotateY(180deg); /* gira la cara trasera */
}

/* esta clase se aplica cuando se da la vuelta ( mirar .js) */
.form-container.flipped .form-front {
    transform: rotateY(-180deg); /* gira la cara frontal hacia atras  */
}

.form-container.flipped .form-back {
    transform: rotateY(0deg); /* trae la cara de atras al frente  */
}

/* estilo basico de los formularios  */
form {
    width: 100%;
    text-align: center;
}

input {
    width: calc(100% - 20px);
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
	background-color: white;
}

button {
    background-color: #007bff;
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

button:hover {
    background-color: #0056b3;
}

p {
	margin: 0;    
    font-size: 14px;
}

a {
    color: #007bff;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Contenedor principal de corazones */
.hearts-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1; /* Importante: por detrás de la tarjeta */
}

/* Estilo base del corazón (usando pseudo-elementos para dibujarlo) */
.heart {
    position: absolute;
    display: block;
    width: 20px;
    height: 20px;
    background-color: #f43f5e; /* Color rosado/rojo */
    opacity: 0.3; /* Semitransparente */
    transform: rotate(45deg);
    bottom: -50px;
    animation: heartsFloat 5s infinite ease-in;
}

.heart::before,
.heart::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: #f43f5e;
    border-radius: 50%;
}

.heart::before {
    top: -10px;
    left: 0;
}

.heart::after {
    left: -10px;
    top: 0;
}

/* Variaciones de posición, tamaño y velocidad para cada corazón */
.heart:nth-child(1) { left: 10%; width: 15px; height: 15px; animation-duration: 8s; animation-delay: 1s; }
.heart:nth-child(2) { left: 30%; width: 25px; height: 25px; animation-duration: 12s; animation-delay: 3s; }
.heart:nth-child(3) { left: 55%; width: 10px; height: 10px; animation-duration: 9s; animation-delay: 0s; }
.heart:nth-child(4) { left: 70%; width: 20px; height: 20px; animation-duration: 10s; animation-delay: 5s; }
.heart:nth-child(5) { left: 85%; width: 18px; height: 18px; animation-duration: 11s; animation-delay: 2s; }
.heart:nth-child(6) { left: 95%; width: 12px; height: 12px; animation-duration: 13s; animation-delay: 4s; }

/* Animación de flotado */
@keyframes heartsFloat {
    0% {
        bottom: -50px;
        transform: rotate(45deg) translateY(0) scale(1);
        opacity: 0.3;
    }
    100% {
        bottom: 100%;
        transform: rotate(45deg) translateY(-300px) scale(0.5);
        opacity: 0;
    }
}






/*estilos de los textos */ 


.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #f472b6;
    margin-top: 0;
    margin-bottom: 12px;
    text-align: center;
    line-height: 1.3;
}

.card-text {
    font-size: 0.95rem;
    color: #475569;
    line-height: 1.5;
    text-align: center;
    margin-top: 0;
    margin-bottom: 16px;
}


.security-box {
    background-color: #f1f5f9;
    border-left: 3px solid #0284c7;
    border-radius: 6px;
    padding: 10px 12px;
    width: 100%;
}

.security-text {
    font-size: 0.85rem;
    color: #334155;
    line-height: 1.4;
    margin: 0 3px 0 3px;
    text-align: left;
}

.security-text strong {
    color: #0369a1;
}

@media (max-width: 600px) {
  body { align-items: flex-start; padding-top: 36px; }
  .form-container { max-width: 95%; padding: 12px; min-height: 420px; }
  .form-card { padding: 18px; border-radius: 12px; }
  .card-title { font-size: 1.15rem; }
  .form-container .form-card input, .form-container .form-card button { font-size: 16px; padding: 12px; }
}

@media (max-width: 420px) {
  .form-container { min-height: 520px; }
  .card-title { font-size: 1.05rem; }
  .card-text { font-size: 0.95rem; }
  .security-text { font-size: 0.85rem; }
}

/* Posicionar estrella sobre la foto */
.photo-item {
  position: relative;
}

/* Mensaje de error en login */
.login-error {
  background: #fee2e2;
  color: #7f1d1d;
  border: 1px solid #fecaca;
  padding: 8px 10px;
  border-radius: 8px;
  margin-bottom: 10px;
  font-size: 0.95rem;
  text-align: center;
}

.star-form {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 5;
}

