/* --- Reset básico --- */
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100vh;
  font-family: 'poppins', system-ui, sans-serif;
  background: linear-gradient(135deg, #fbc2eb, #a6c1ee);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: env(safe-area-inset);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /*overflow: hidden;*/
}

/* --- LOGIN --- */
.login-wrapper {
  position: fixed; /* full screen */
  inset: 0; /* top:0; right:0; bottom:0; left:0; */
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px;
}

.login-card {
  width: 100%;
  max-width: 400px;
  padding: 32px 28px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(14px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.15);
  text-align: center;
  animation: fadeIn 1s ease;
  border: 2px solid #f55151;
}

.login-card h1 {
  font-weight: 800;
  margin-bottom: 2px;
  font-size: 30px;
  color: #222;
}
.login-card h2 {
  font-weight: 500;
  margin:0px;
  color: #222;
}

.subtitle {
  font-size: 14px;
  color: #555;
  margin-bottom: 24px;
}

.login-card input {
  width: 100%;
  padding: 12px 16px;
  border-radius: 14px;
  border: none;
  outline: none;
  font-size: 15px;
  margin-bottom: 20px;
  background: rgba(255,255,255,0.9);
  box-shadow: inset 0 0 5px #ddd;
  border: 1px solid #ffa1a1;
}

.login-card input:focus {
  box-shadow: 0 0 10px #ff7eb3;
}

.login-card button {
  width: 100%;
  padding: 12px;
  border-radius: 90px;
  border: none;
  font-size: 15px;
  font-weight: 600;
  background: linear-gradient(135deg, #ff758c, #ff7eb3);
  color: white;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  user-select: none;
}
.login-card button:hover{
    width: 100%;
    padding: 12px;
    border-radius: 90px;
    border: none;
    font-size: 15px;
    font-weight: 600;
    background: linear-gradient(135deg, #df5a70, #cf5085);
    color: white;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    user-select: none;}
.login-card button:hover,
.login-card button:focus {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.2);
  background: linear-gradient(135deg, #de4c65, #da4f89);
}

.amalia-link {
  display: inline-block;
  margin-top: 16px;
  font-size: 13px;
  font-weight: 600;
  font-style: italic;
  color: #d00404;
  cursor: pointer;
  text-decoration: underline;
  user-select: none;
}
.amalia-link:hover {
  display: inline-block;
  margin-top: 16px;
  font-size: 13px;
  font-weight: 600;
  font-style: italic;
  color: #5d0707;
  cursor: pointer;
  text-decoration: underline;
  user-select: none;
}

/* --- MODAL AMALIA --- */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.modal.hidden {
  display: none;
}

.modal-card {
  background: rgba(255,255,255,0.9);
  padding: 58px 52px;
  border-radius: 22px;
  max-width: 620px;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0,0,0,0.25);
  color: #222;
  font-weight: 500;
  user-select: none;
}

.modal-card button {
  margin-top: 20px;
  padding: 10px 20px;
  border-radius: 90px;
  border: none;
  background: #ff7eb3;
  color: white;
  cursor: pointer;
  font-weight: 600;
  user-select: none;
}
.modal-card button:hover {
  margin-top: 20px;
  padding: 10px 20px;
  border-radius: 90px;
  border: none;
  background: #e65893;
  color: white;
  cursor: pointer;
  font-weight: 600;
  user-select: none;
}

/* --- CARTAS --- */
.cards-wrapper {
  width: 100%;
  max-width: 900px;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: fadeIn 1s ease;
  position: relative;
}

/* Grid cartas */
.cards-grid {
  display: grid;
  gap: 16px;
  width: 100%;
  justify-content: center;
}

/* Mobile: 2 columnas */
@media (max-width: 639px) {
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Tablet: 3 columnas */
@media (min-width: 640px) and (max-width: 1023px) {
  .cards-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Desktop: 4 columnas */
@media (min-width: 1024px) {
  .cards-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Carta individual */
.card {
  aspect-ratio: 3 / 4;
  perspective: 1000px;
  cursor: pointer;
  position: relative;
  border-radius: 20px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.1);
  user-select: none;
}

.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.8s cubic-bezier(.4,.2,.2,1);
  transform-style: preserve-3d;
  border-radius: 20px;
}

/* Carta girada */
.card.flipped .card-inner {
  transform: rotateY(180deg);
}

/* Frente */
.card-front, .card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 20px;
  backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 24px;
  box-sizing: border-box;
  color: #222;
  font-weight: 600;
  font-size: 1.2rem;
  text-align: center;
  background: #fff;
}

/* Frente */
.card-front {
  background: linear-gradient(135deg, #ff758c, #ff7eb3);
  color: white;
  font-weight: 700;
  font-size: 1.5rem;
  position: absolute;
  user-select: none;
}

.card-front .day-label {
  font-size: 1.8rem;
  margin-bottom: 12px;
  font-weight: 800;
  user-select: none;
}

/* Ícono candado para bloqueadas */
.card-front.locked::after {
  content: "🔒";
  position: absolute;
  bottom: 14px;
  right: 14px;
  font-size: 1.8rem;
  opacity: 0.7;
}

/* Reverso */
.card-back {
  background: #fff;
  color: #222;
  transform: rotateY(180deg);
  font-weight: 500;
  font-size: 1rem;
  line-height: 1.3;
  overflow-y: auto;
}

/* Cartas bloqueadas */
.card.locked {
  cursor: not-allowed;
  opacity: 0.6;
}
#fleeingButton {
    /* Required for absolute positioning in JavaScript */ 
    position: absolute; 
    padding: 15px 30px; 
    font-size: 14px; font-weight: bold; color: white; background-color: #ff758c; border: none; border-radius: 90px; cursor: pointer; top: 60px; left: 40px;
}

#fleeingButton:hover {
    background-color: #8d033c;
}

.hidden {
  display: none !important;
}


/*LOGOUT*/
.logout-btn {
  position: fixed;   /* always on top-right */
  top: 20px;
  right: 20px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #ff758c, #ff7eb3);
  color: white;
  cursor: pointer;
  z-index: 10000;    /* always above cards */
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.logout-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0,0,0,0.2);
}

.hidden {
  display: none;
}

/*pass*/
.password-container {
  position: relative;
  width: 100%;
  

}
input#clave {
    display: flex;
}

.password-container input {
  width: 100%;
  padding-right: 40px; /* space for eye */
}

.eye {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  font-size: 16px;
}




/* Mobile touch comfort 
@media (max-width: 480px) {
  #togglePassword {
    right: 12px;
    font-size: 18px;
  }

  .password-wrapper input {
    padding-right: 46px;
  }
}*/

iframe {
  margin: 0 auto 30px auto; /* space below it */
  
}

/* Animación fadeIn */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
