body {
  margin: 0;
  padding: 0;
  font-family: "EB Garamond", serif;
  background-color: #fcf9f2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  text-align: center;
  color: #333;
  background-image: url(/imgs/bg\ Kopie\ 2.JPG);
  background-position: center;
  box-sizing: border-box;
}

body.lang-de {
  font-family: "Tangerine", cursive;
  font-style: normal; /* WICHTIG: Verhindert, dass Tangerine doppelt kursiv und damit unleserlich wird */
  font-weight: 700;
}
body.lang-de .card h3 {
  font-family: "Tangerine", cursive;
  font-size: 30px;
}
body.lang-de .card p {
  font-family: "Tangerine", cursive;
  font-size: 30px;
}
body.lang-de #countdown-title {
  font-family: "Tangerine", cursive;
  font-size: 30px;
}
body.lang-de .time-box span {
  font-family: "Tangerine", cursive;
  font-size: 40px;
  line-height: 35px;
}
body.lang-de .maps-btn {
  font-family: "Tangerine", cursive;
  font-size: 25px;
}

#login-screen {
  background: white;
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  max-width: 400px;
  width: 90%;
  margin: auto; 
  box-sizing: border-box;
  margin-top: 200px;
}

h1 {
  color: #727457;
  margin-bottom: 60px;
}

select,
input,
button {
  width: 100%;
  padding: 12px;
  margin: 10px 0;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 16px;
  box-sizing: border-box;
}

button {
  background-color: #727457;
  color: white;
  border: none;
  cursor: pointer;
  font-weight: bold;
  transition: background-color 0.3s;
}

#error-msg {
  color: #e74c3c;
  display: none;
  margin-top: 10px;
  font-size: 20px;
}

.custom-toggle {
  position: relative;
  display: flex;
  width: 100%;
  height: 44px;
  background-color: transparent;
  border: 2px solid #727457;
  border-radius: 30px;
  margin: 0 auto 25px auto;
  cursor: pointer;
  align-items: center;
  overflow: hidden;
}

.toggle-slider {
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 100%;
  background-color: #727457;
  border-radius: 30px;
  transition: transform 0.3s ease;
  z-index: 1;
}

.custom-toggle.is-de .toggle-slider {
  transform: translateX(100%);
}

.toggle-text {
  flex: 1;
  text-align: center;
  z-index: 2;
  font-weight: bold;
  font-size: 16px;
  color: #999;
  user-select: none;
  transition: color 0.3s ease;
  font-family: "EB Garamond", serif;
  font-size: 20px;
  font-weight: 100;
}

.toggle-text.active {
  color: white;
}

#envelope-text {
  color: #727457;
  font-size: 60px;
  margin-bottom: 140px;
  text-shadow: white 4px 5px;
  z-index: 20;
  font-weight: 100;
}

#invitation-screen {
  display: none;
  flex-direction: column;
  align-items: center;
  padding: 50px 0;
  width: 100%;
  box-sizing: border-box;
}

.briefumschlag-container {
  position: relative;
  display: inline-block;
  cursor: pointer;
  max-width: 400px;
  width: 100%;
  margin: 0 auto;
  transition: margin-bottom 0.8s ease;
  box-sizing: border-box;
  padding-top: 200px;
}

.briefumschlag-container .bild-geschlossen {
  width: 100%;
  display: block;
  transition: opacity 0.5s ease-in-out;
  position: relative;
  z-index: 2;
}

.briefumschlag-container .bild-offen {
  position: absolute;
  top: -40px;
  left: 0;
  width: 100%;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
  z-index: 1;
}

.briefumschlag-container.open .bild-offen {
  opacity: 1;
}

.briefumschlag-container.open .bild-geschlossen {
  opacity: 0;
}

.briefumschlag-container.open {
  margin-bottom: 350px;
}

.letter {
  position: absolute;
  top: 140px;
  left: -15px;
  width: calc(100% + 30px);
  z-index: 0;
  display: flex;
  gap: 15px;
  transform: translateY(0);
  opacity: 0;
  pointer-events: none;
  transition:
    transform 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.1s,
    opacity 0.5s ease 0.1s;
  padding-bottom: 50px;
}

.briefumschlag-container.open .letter {
  transform: translateY(140px);
  opacity: 1;
  pointer-events: auto;
  z-index: 3;
}

.column {
  display: flex;
  flex-direction: column;
  gap: 15px;
  width: 50%;
}

.column:last-child {
  margin-top: 30px;
}

.h-card-1 {
  height: 130px;
}

.h-card-2 {
  height: 320px;
}

.h-card-3 {
  height: 250px;
}

.h-card-4 {
  height: 200px;
}

.h-card-1 .card.expanded {
  width: 370px;
  height: 488px;
}

.h-card-2 .card.expanded {
  width: 270px;
  height: 484px;
}

.h-card-3 .card.expanded {
  width: 300px;
  height: 340px;
}

/* === DIE REPARIERTE GLEIT-ANIMATION === */
.h-card-1,
.h-card-2,
.h-card-3,
.h-card-4 {
  position: relative;
  opacity: 0;
  top: -180px; 
  transition:
    top 1.7s cubic-bezier(0.25, 1, 0.5, 1),
    opacity 1.5s ease; 
}

.briefumschlag-container.open .h-card-1 {
  opacity: 1;
  top: 0;
  transition-delay: 0.3s;
}
.briefumschlag-container.open .h-card-2 {
  opacity: 1;
  top: 0;
  transition-delay: 0.5s;
}
.briefumschlag-container.open .h-card-3 {
  opacity: 1;
  top: 0;
  transition-delay: 0.7s;
}
.briefumschlag-container.open .h-card-4 {
  opacity: 1;
  top: 0;
  transition-delay: 0.9s;
}
/* ===================================== */

.card-wrapper {
  position: relative;
  width: 100%;
}

.card {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #fff;
  padding: 15px 10px;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  color: #727457;
  border: 1px solid #e9e9e9;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  cursor: pointer;
  box-sizing: border-box;
  transition: box-shadow 0.3s ease;
  z-index: 1;
}

.card:hover {
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.card h3 {
  margin: 0 0 20px 0;
  font-size: 22px;
  font-family: "EB Garamond", serif;
  padding-top: 20px;
  font-weight: 100;
}

.card.expanded #c1-title {
  display: none;
}

.h-card-1 .extra-info {
  border-top: none;
  padding-top: 0;
}

.card p {
  margin: 0;
  font-size: 22px;
}

.card img {
  width: 85%;
  height: auto;
  border-radius: 4px;
  margin: 8px 0;
}

.extra-info {
  display: none;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #ddd;
  font-size: 14px;
  width: 100%;
}

.close-btn {
  display: none;
  position: absolute;
  top: 10px;
  right: 10px;
  color: #727457;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  line-height: 25px;
  text-align: center;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  z-index: 101;
}

.card.expanded {
  z-index: 100;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  cursor: default;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  overflow-y: auto;

  position: fixed !important;
  top: 35% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  margin: 0 !important;
  max-width: 90vw !important;
  max-height: 85vh !important;
}

.card.expanded .extra-info,
.card.expanded .close-btn {
  display: block;
}

.countdown-card {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: white;
  padding: 15px 10px;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  border: 1px solid #e9e9e9;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  box-sizing: border-box;
}

.countdown-card img {
  width: 80px;
  position: absolute;
  left: 43%; 
  margin-left: -72px;
  top: 55px;
}

#countdown-title {
  color: #727457;
  font-weight: 100;
  margin: 0 0 10px 0;
  font-family: "EB Garamond", serif;
  font-size: 22px;
}

.countdown-card p {
  color: #727457;
  font-weight: 100;
  padding-bottom: 0px;
}

.time-box span {
  font-size: 40px;
  font-weight: bold;
  font-family: "Tangerine", cursive;
  background: #727457;
  padding: 7px 10px;
  border-radius: 6px;
  min-width: 40px;
  display: inline-block;
}

#days {
  color: #fff;
}

.time-box p {
  margin: 8px 0 0 0 !important;
  font-size: 11px !important;
  font-family: Arial, sans-serif !important;
  color: #999;
}

.infinity-icon {
  width: 62px !important;
  height: auto !important;
  filter: brightness(0) invert(1) !important;
  vertical-align: middle !important;
  display: inline-block !important;
  margin: 0 !important;
  position: static !important;
}

.site-footer {
  width: 100%;
  text-align: center;
  z-index: 1;
  margin-top: auto;
  padding: 83px 0 96px 0;
  box-sizing: border-box;
}

.site-footer p {
  margin: 0;
  font-family: Arial, sans-serif;
  font-size: 18px;
  letter-spacing: 1px;
  color: white;
}

.site-footer a {
  color: white;
  text-decoration: none;
  font-weight: bold;
  transition: color 0.3s ease;
}

.site-footer a:hover {
  color: #3dcfb6;
  text-decoration: underline;
}

.maps-btn {
  display: inline-block;
  background-color: #727457;
  color: white !important;
  text-decoration: none;
  padding: 10px 20px;
  margin-top: 15px;
  border-radius: 6px;
  font-family: "EB Garamond", serif;
  font-weight: bold;
  font-size: 14px;
  transition:
    background-color 0.3s ease,
    transform 0.2s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

.maps-btn:hover {
  background-color: #5d5f46;
  transform: scale(1.02);
}

.ampersand-gr {
  font-family: "Playfair Display", serif;
  font-style: italic;
  font-size: 26px;
  display: inline-block;
  margin: 5px 0;
}

@media (max-width: 480px) {
  #invitation-screen {
    padding-left: 30px;
    padding-right: 30px;
  }

  .h-card-1 {
    height: 160px;
  }
  .h-card-2 {
    height: 300px;
  }
  .h-card-3 {
    height: 200px;
  }
  .h-card-4 {
    height: 200px;
  }

  .h-card-1 .card.expanded {
    width: 370px !important;
    height: 480px !important;
  }
  .h-card-2 .card.expanded {
    width: 280px !important;
    height: 490px !important;
  }
  .h-card-3 .card.expanded {
    width: 277px !important;
    height: 330px !important;
  }

  .countdown-card img {
        position: absolute !important;
        top: 68px !important;
        left: 48% !important;
        margin-left: -68px !important;
        width: 60px !important;
    }
}

@media (max-width: 400px) {
  body {
    background-size: cover;
  }
  #login-screen {
    padding: 30px 20px;
  }

  #invitation-screen {
    padding-left: 30px;
    padding-right: 30px;
  }

  h1 {
    margin-bottom: 30px;
    font-size: 24px;
  }
  #envelope-text {
    font-size: 44px;
    margin-bottom: 90px;
  }
  .briefumschlag-container.open {
    margin-bottom: 460px;
  }

  .card h3 {
    font-size: 18px;
    padding-top: 5px;
    font-weight: 100;
    margin: 0;
  }
  .card p {
    font-size: 18px;
  }

  #countdown-title {
    font-size: 16px;
  }

.countdown-card img { 
        position: absolute !important;
        top: 52px !important;
        left: 60% !important; 
        margin-left: -74px !important;
        width: 60px !important;
    }

  .time-box span {
    font-size: 40px;
    padding: 4px 6px;
    margin: 5px;
  }
  .card img {
    width: 90%;
  }

  .h-card-1 {
    height: 140px;
  }
  .h-card-2 {
    height: 270px;
  }
  .h-card-3 {
    height: 180px;
  }
  .h-card-4 {
    height: 180px;
  }

  .h-card-1 .card.expanded {
    width: 332px !important;
    height: 451px !important;
  }
  .h-card-2 .card.expanded {
    width: 272px !important;
    height: 505px !important;
  }
  .h-card-3 .card.expanded {
    width: 286px !important;
    height: 343px !important;
  }

  .close-btn {
    top: 12px;
    right: 12px;
    width: 30px;
    height: 30px;
    line-height: 30px;
    font-size: 14px;
  }
  .briefumschlag-container .bild-offen {
    padding-top: 100px;
  }
  .site-footer {
    padding: 0px 0 20px 0;
  }
  .site-footer p {
    font-size: 13px;
  }

  body.lang-de .maps-btn {
    font-size: 23px;
  }
  body.lang-de .card h3 {
    font-size: 26px;
  }
  body.lang-de .card p {
    font-size: 26px;
  }
  body.lang-de #countdown-title {
    font-size: 26px;
  }
  body.lang-de .time-box span {
    font-size: 26px;
  }
}