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

html, body {
  height: 100%;
  scroll-behavior: smooth;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  overflow-x: hidden;
}

section {
  width: 100vw;
  text-align: center;
  position: relative;
  padding: 20px 0;
}

/* Landing */
#landing-section {
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: #111;
  color: white;
  position: relative;
}

#landing-text {
  z-index: 20;
  padding: 20px;
  max-width: 600px;
  text-align: center;
  background: rgba(226, 217, 217, 0.5);
  border-radius: 16px;
  margin-bottom: 20px;
}

#landing-text h1 {
  font-size: 2.8rem;
  font-weight: 900;
  text-shadow: 0 5px 9px rgb(94, 49, 49);
}

#spline-iframe {
  position: absolute;
  top: 0; 
  left: 0;
  width: 100vw;
  height: 100vh;
  border: none;
  z-index: 1;
}

/* Second section */
#country-section {
  background: linear-gradient(to bottom, #AE9068, #050505);
  color: #2f3e46;
  padding: 40px 20px;
}

#country-section h2 {
  font-weight: 800;
  font-size: 2.1rem;
  color: #0f161e;
  margin-bottom: 24px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 28px 32px;
  max-width: 860px;
  margin: 0 auto;
}

.form-card {
  background: #513b3b;
  border-radius: 12px;
  box-shadow: 0 6px 24px #ffbb00;
  padding: 24px 18px 18px 18px;
  display: flex;
  flex-direction: column;
  
}

.form-card.full-width { 
  grid-column: 1 / -1; 
  margin-top: 12px; 
}

.photo-card {
  align-items: center;
  justify-content: center;
}

#photoPreview img, #video {
  margin-top: 12px;
  margin-bottom: 10px;
  border-radius: 50%;
  box-shadow: 0 3px 16px #aaa7;
  width: 90px;
  height: 90px;
  object-fit: cover;
}

#startCameraBtn, #captureBtn {
  background-color: #674ea7;
  color: white;
  border: none;
  border-radius: 7px;
  padding: 6px 14px;
  cursor: pointer;
  font-weight: 600;
  margin: 5px 0 7px 0;
}

.foods-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
  justify-content: center;
  min-height: 40px;
}

.food-item {
  background: #fceabb;
  padding: 6px 14px;
  border-radius: 17px;
  border: 1px solid #ffc093;
  cursor: pointer;
  user-select: none;
  font-size: 1.1em;
  box-shadow: 0 2px 7px #dac0a5;
  transition: background 0.2s, border 0.2s, transform 0.15s;
}

.food-item.active {
  background: #b6e2d3;
  border: 1.5px solid #1db686;
  color: #127659;
  transform: scale(1.1) rotate(-2deg);
}

button[type="submit"] {
  background: #5271ff;
  color: white;
  font-size: 1.18rem;
  padding: 15px 0;
  border-radius: 15px;
  border: none;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(82, 113, 255, 0.4);
  transition: background 0.3s ease;
}

button[type="submit"]:hover {
  background: #3a4ec8;
}

/* Third section */
#lifespan-section {
  position: relative;
  min-height: 100vh;
  padding: 60px 20px;
  color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  background: linear-gradient(to bottom,#100f01,#979592,#6a4406);
}

/* Background for third section (iframe) */
#lifespan-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

#lifespan-bg iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* Container */
#lifespan-container {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1200px;
  display: flex;
  flex-direction: column;
  gap: 40px;
  align-items: center;
}

/* Result Message Banner */
.result-message {
  font-size: 1.8rem;
  font-weight: 700;
  user-select: none;
  text-align: center;
  color: #fff;
  background: linear-gradient(135deg, #be7609, #f7d794);
  padding: 20px 25px;
  border-radius: 18px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.25);
  max-width: 900px;
}

/* Animation Wrapper */
#animation-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  width: 100%;
  min-height: 400px;
  position: relative;
  gap: 0;
}

/* Person wrapper (left) */
#personWrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 2;
}

/* Coffin wrapper (right) */
#coffinWrap {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  z-index: 1;
}

.animated-face {
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 80px;
  color: #392902;
  border-radius: 50%;
  width: 250px;
  height: 250px;
  background: #080707;
  box-shadow: 0 10px 35px rgba(97,67,37,0.5), 0 4px 10px rgba(255,255,255,0.7);
  transition: transform 0.8s ease, background 0.8s ease, opacity 0.5s ease;
  text-align: center;
}

.person-shadow {
  width: 120px;
  height: 40px;
  background: radial-gradient(ellipse at center, #473b2a88 60%, transparent 100%);
  border-radius: 50%;
  margin-top: -30px;
  filter: blur(8px);
  opacity: 0.9;
}

#coffinImg {
  width: 400px;  
  max-width: 100%;
  filter: drop-shadow(0 12px 20px rgba(0,0,0,0.35));
  z-index: 1;
  transition: transform 0.8s ease;
}

/* Controls */
#controls {
  display: flex;
  justify-content: center;
  margin-top: 20px;
  position: relative;
  z-index: 10;
}

#restartBtn {
  background-color: #d2921b;
  color: white;
  border: none;
  border-radius: 24px;
  padding: 14px 30px;
  font-weight: 700;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 6px 16px #191615cc;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.3s ease;
}

#restartBtn.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

#restartBtn:hover {
  background: #d56f0f;
  transform: scale(1.05);
}

/* Message inside coffin */
.animated-message {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg,#ff6b6b,#f7d794);
  padding: 20px;
  border-radius: 15px;
  opacity: 0;
  transition: opacity 0.6s ease;
  z-index: 3;
}

.animated-message.visible { opacity: 1; }

/* Responsive */
@media (max-width: 900px) {
  #animation-wrapper {
    flex-direction: column;
    gap: 40px;
  }
  #personWrap, #coffinWrap {
    bottom: 90px;
  }
  #personWrap .animated-face, #coffinImg {
    width: 180px;
    height: 180px;
  }
  .person-shadow {
    width: 90px;
    height: 25px;
  }
  .result-message {
    font-size: 1.4rem;
    padding: 16px 20px;
  }
}

/* Forms */
label {
  font-weight: 700;
  margin-bottom: 6px;
  display: block;
  text-align: left;
  color: white;
}

input[type="text"], input[type="number"], select, textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1.5px solid #ccc;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

button, input[type="text"], input[type="number"], select, textarea {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: 1rem;
}

/* Footer */
#main-footer {
  background: linear-gradient(90deg, #1c1c1c, #3a3a3a);
  color: #fff;
  padding: 40px 20px;
  text-align: center;
  position: relative;
  bottom: 0;
  width: 100%;
  box-shadow: 0 -4px 15px rgba(0,0,0,0.4);
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
}

.footer-logo h3 {
  font-size: 1.8rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #ff6b6b;
  margin-bottom: 12px;
}
