@import url('https://fonts.googleapis.com/css2?family=Dancing+Script&family=Playfair+Display&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Dancing+Script&display=swap');


.wedding-title {
  position: relative; /* Remove absolute positioning */
  top: unset;
  width: auto;
  text-align: center;
  font-family: 'Dancing Script', cursive;
  font-size: 58px;
  color: #cc3f72;
  z-index: 10;
  opacity: 0;
  text-shadow: 0 0 8px #ffb6c1, 0 0 12px #ffb6c1;
}

/* Opacity-only fade-in */
.fade-opacity {
  
  animation: fadeInOpacity 1.8s ease forwards;
  animation-delay: 1.8s;
}

@keyframes fadeInOpacity {
  from { opacity: 0; }
  to { opacity: 3.5; }
}


/* --- Layered BACKGROUND EFFECTS --- */
body {
  margin: 0;
  padding: 0;
  font-family: 'Playfair Display', serif;
  color: #4b2e2e;
  position: relative;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;

  /* Main background animation */
  background: linear-gradient(-45deg, #fff0f5, #fef6f9, #fdeff5, #fff6f0);
  background-size: 600% 600%;
  animation: gradientFlow 30s ease infinite;
}

@keyframes gradientFlow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Floral overlay */
body::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  /*background: url('/floral-overlay.png') repeat;*/
  background-size: 300px 300px;
  opacity: 0.12;
  z-index: 1;
  pointer-events: none;
}

/* Soft vignette border */
body::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(ellipse at center, transparent 60%, rgba(0, 0, 0, 0.04));
  z-index: 2;
  pointer-events: none;
}

.container{
  position: relative;
  z-index: 1;
  /* overflow: hidden; */
  min-height: 100svh;
  max-height: 100svh;             /* ← 關鍵：限制在視窗高內 */
  overflow-y: auto;               /* ← 內部可滾 */
  -webkit-overflow-scrolling: touch;

  background: rgba(255,255,255,0.92);
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);

  /* fluid by default */
  width: min(680px, 92vw);
  max-width: 680px;
  min-width: auto;

  /* comfy responsive padding */
  padding: clamp(24px, 4vw, 60px) clamp(16px, 4.5vw, 70px)  clamp(20px, 4vw, 50px);

  /* height: use dynamic viewport to avoid iOS 100vh issues */
  min-height: 100svh;
  height: auto;

  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  animation: fadeIn 1.8s ease-out;
  transition: min-height .4s ease, opacity 1.2s ease, transform 1.2s ease;
  overflow-y: auto;
  scroll-behavior: smooth;
  overscroll-behavior: contain;
}
@supports (height: 100dvh) {
  .container{
    min-height: 100dvh;
    max-height: 100dvh;           /* ← 更精準的動態視窗高 */
  }


/* --- Fading entrance --- */
@keyframes fadeIn {
  0% {
    opacity: 0;
    transform: translateY(120px) scale(0.98);
  }
  
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}


/* --- HEADERS / QUOTES / LABELS --- */
.title {
  font-family: 'Playfair Display', serif;
  font-size: 42px;
  color: #b76e79;
  margin-bottom: 10px;
  text-align: center;
}

h2 {
  font-size: 20px;
  margin-bottom: 20px;
  text-align: center;
}

.title-quote-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  padding-top: 30px;
  position: relative;
  z-index: 5;
}

/* --- FORMS --- */
.step-block {
  margin-top: 20px;
  position: relative;
  padding-bottom: 80px;
}

.upload-progress-container {
  width: 100%;
  background-color: #f8e6ef;
  border-radius: 10px;
  height: 24px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  margin-top: 20px;
  position: relative;
}

.upload-progress-bar {
  height: 100%;
  background-color: #cc3f72;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  border-radius: 10px;
  transition: width 0.3s ease-in-out;
  padding-right: 10px;
  box-sizing: border-box;
  color: white;
  font-size: 14px;
  font-weight: bold;
  font-family: 'Playfair Display', serif;
}

.upload-progress-text {
  z-index: 1;
}

input {
  width: 100%;
  padding: 12px;
  margin: 12px 0;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 16px;
}

button {
  background: #d9a7c7;
  border: none;
  padding: 12px 24px;
  color: white;
  font-size: 16px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  margin: 20px auto 0 auto;
  display: block;
}

button:hover {
  background: #b76e79;
  transform: scale(1.05);
}

input[type="file"] {
  background: white;
  padding: 12px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 16px;
  width: 100%;
  color: #333;
}

input[type="file"]::file-selector-button {
  background: #d9a7c7;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.3s ease;
}

input[type="file"]::file-selector-button:hover {
  background: #b76e79;
}

input[type="text"],
textarea {
  width: 100%;
  padding: 12px 14px;
  margin: 10px 0 20px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 16px;
 
  background-color: white;
  box-sizing: border-box;
  resize: none;
  outline: none;
}
.custom-upload-btn {
  display: inline-block;
  padding: 10px 18px;
  background-color: #f8b6d2;
  color: white;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  transition: background-color 0.3s;
}
.custom-upload-btn:hover {
  background-color: #e99fbf;
}
 :root{
    --ml-pink:#f5a1c4;     /* 主色：淡粉 */
    --ml-pink-dark:#e38ab1;/* hover 深粉 */
    --ml-text:#333;
    --ml-muted:#777;
    --ml-white:#fff;
    --ml-shadow:0 6px 20px rgba(0,0,0,.12);
    --ml-radius:14px;
  }

  /* ===== Uploader Wrapper ===== */
  .ml-uploader{
    display:flex;
    flex-direction:column;
    align-items:center;
    gap:12px;
    width:100%;
    max-width:560px;
    margin-inline:auto;
  }

  /* ===== Fancy Choose Button ===== */
  .ml-btn{
    display:inline-block;
    padding:12px 20px;
    background:var(--ml-pink);
    color:var(--ml-white);
    border-radius:var(--ml-radius);
    cursor:pointer;
    font-size:16px;
    line-height:1;
    box-shadow:var(--ml-shadow);
    transition:transform .08s ease, background .25s ease;
    user-select:none;
    text-align:center;
    min-width:260px;
  }
  .ml-btn:hover{ background:var(--ml-pink-dark); }
  .ml-btn:active{ transform:translateY(1px); }
  /* 鍵盤可達性 */
  .ml-btn:focus-visible{
    outline:2px solid #fff;
    box-shadow:0 0 0 4px rgba(229,115,156,.5), var(--ml-shadow);
  }

  /* ===== White file name pill ===== */
  .ml-filebox{
    background:var(--ml-white);
    color:var(--ml-muted);
    border-radius:var(--ml-radius);
    padding:10px 14px;
    min-height:42px;
    min-width:240px;
    max-width:100%;
    box-shadow:var(--ml-shadow);
    text-align:center;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    word-break:break-word;
  }

  /* ===== Submit Button ===== */
  .ml-submit{
    padding:12px 20px;
    background:var(--ml-white);
    color:var(--ml-pink-dark);
    border:2px solid var(--ml-pink);
    border-radius:var(--ml-radius);
    cursor:pointer;
    font-size:16px;
    line-height:1;
    transition:background .25s ease, color .25s ease, transform .08s ease;
    min-width:200px;
  }
  .ml-submit:hover{ background:rgba(245,161,196,.12); }
  .ml-submit:active{ transform:translateY(1px); }
  .ml-submit:focus-visible{
    outline:2px solid #fff;
    box-shadow:0 0 0 4px rgba(229,115,156,.5), var(--ml-shadow);
  }

  /* ===== Hint ===== */
  .ml-hint{
    font-size:13px;
    color:var(--ml-muted);
    margin:6px 0 0;
  }
textarea:focus,
input[type="text"]:focus {
  border-color: #cc3f72;
  box-shadow: 0 0 4px rgba(204, 63, 114, 0.3);
}

progress {
  width: 100%;
  height: 18px;
  appearance: none;
}
progress::-webkit-progress-bar {
  background-color: #f3dfe5;
  border-radius: 10px;
}
progress::-webkit-progress-value {
  background-color: #cc3f72;
  border-radius: 10px;
}

.info-note {
  font-size: 14px;
  text-align: center;
  color: #4b2e2e;
  font-family: 'Playfair Display', serif;
  background-color: rgba(255, 255, 255, 0.75); /* soft white overlay */
  padding: 16px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  margin-top: 20px;
  line-height: 1.6;
}

.language-selector-fixed {
  position: static;
  bottom: 10px;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: center;
  gap: 14px;
  z-index: 10;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.8s ease forwards;
  animation-delay: 1s;
}



.language-button {
  width: 120px;
  padding: 10px;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  cursor: pointer;
  font-family: 'Playfair Display', serif;
  font-weight: bold;
  transition: background 0.3s ease;
}

.language-button.en {
  background-color: #f8d8e0;
  color: #4b2e2e;
}

.language-button.zh {
  background-color: #f2bfd2;
  color: #4b2e2e;
}

.language-button:hover {
  transform: scale(1.05);
  box-shadow: 0 0 8px rgba(204, 63, 114, 0.2);
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


.fade-1 {
  animation: fadeInElement 0.8s ease-out 0.3s forwards;
}
.fade-2 {
  animation: fadeInElement 1s ease-out 0.6s forwards;
}
.fade-3 {
  animation: fadeInElement 1.2s ease-out 0.9s forwards;
}
.fade-4 {
  animation: fadeInElement 1.4s ease-out 1.2s forwards;
}
.fade-1, .fade-2, .fade-3, .fade-4 {
  opacity: 0;
  transform: translateY(40px);
  will-change: transform, opacity;
}

@keyframes fadeInElement {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fade out right */
.fade-out-1 { animation: fadeOutRight 0.4s ease-out 0.3s forwards; }
.fade-out-2 { animation: fadeOutRight 0.5s ease-out 0.3s forwards; }
.fade-out-3 { animation: fadeOutRight 0.6s ease-out 0.3s forwards; }
.fade-out-4 { animation: fadeOutRight 0.7s ease-out 0.3s forwards; }
.fade-out-5 { animation: fadeOutRight 0.8s ease-out 0.3s forwards; }
.fade-out-6 { animation: fadeOutRight 0.9s ease-out 0.3s forwards; }

.fade-in-left-1,
.fade-in-left-2,
.fade-in-left-3,
.fade-in-left-4,
.fade-in-left-5,
.fade-in-left-6 {
  opacity: 0;
  transform: translateX(-200px);
}

/* Animation */
@keyframes fadeInLeft {
  0% {
    opacity: 0;
    transform: translateX(-200px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

.fade-in-left-1 {
  animation: fadeInLeft 0.8s ease-out 0.7s forwards;
}
.fade-in-left-2 {
  animation: fadeInLeft 0.8s ease-out 1s forwards;
}
.fade-in-left-3 {
  animation: fadeInLeft 0.8s ease-out 1.2s forwards;
}
.fade-in-left-4 {
  animation: fadeInLeft 1s ease-out 1.4s forwards;
}
.fade-in-left-5 {
  animation: fadeInLeft 1.2s ease-out 1.6s forwards;
}
.fade-in-left-6 {
  animation: fadeInLeft 1.4s ease-out 1.8s forwards;
}



@keyframes fadeOutRight {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(200px);
  }
}


.form-section.enter-verify,
.form-section.enter-upload,
.form-section.enter-done {
  animation: fadeContainerIn 1.2s ease-out;
}




.app-wrapper {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  position: relative;
  /* overflow: hidden; */
}


.fade-background {
  transition: background-image 1.5s ease, background-color 1.5s ease;
}

.enter-verify,
.enter-upload,
.enter-done {
  animation: fadeContainerIn 1.2s ease-out;
}

@keyframes fadeContainerIn {
  from {
    transform: translateY(60px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.thank-you-heading {
  font-size: 40px;
  font-family: 'Dancing Script', cursive;
  color: #cc3f72;
  text-align: center;
  text-shadow: 0 0 10px rgba(255, 182, 193, 0.6), 0 0 20px rgba(255, 105, 180, 0.4);
  margin-bottom: 10px;
}

.thank-you-subtext {
  font-size: 18px;
  text-align: center;
  color: #8a4f5f;
  font-style: italic;
  text-shadow: 0 0 6px rgba(255, 182, 193, 0.3);
  margin-top: 20px;
}
.info-buttons {
  display: flex;
  justify-content: space-around;
  margin-top: 20px;
  flex-wrap: wrap;
  gap: 10px;
}

@media (max-width: 768px) {
  .container{
    width: 92vw;
    padding: 28px 18px;
    min-height: 100svh;
  }
  .container::after {
    pointer-events: none;         /* ← 不再攔截觸控 */
  }
  .wedding-title{ font-size: 36px; }
  .thank-you-heading{ font-size: 25px; }
  .thank-you-subtext{ font-size: 16px; }
  button{ font-size: 15px; padding: 10px; }

  .step-block { padding-bottom: 140px; }
  .thank-you-heading {
    font-size: 25px;
  }

  .thank-you-subtext {
    font-size: 16px;
  }

  .wedding-title {
    font-size: 36px;
    margin-bottom: 12px;
  }

  .container-bg {
    max-height: 100vh;
    object-fit: cover;
    background-size: cover;
    background-position: center;
 
  }
  
  

  .step-block h2 {
    margin-top: 40px; /* push text down slightly */
  }
  .title {
    font-size: 32px;
  }

  h2 {
    font-size: 18px;
  }

  .quote {
    font-size: 14px;
    margin-bottom: 20px;
    margin-top: 40px;
  }

  input {
    box-sizing: border-box; /* ensures padding is included in width */
    padding-left: 12px;
    padding-right: 12px;
    margin: 12px 0;
    width: 100%;
  }
  
  
  button {
    font-size: 15px;
    padding: 10px;
  }
}
.circle-upload-label {
  display: block;
  width: 120px;
  height: 120px;
  background: #f3dfe5;
  border-radius: 50%;
  text-align: center;
  line-height: 120px;
  color: #aa4a6d;
  font-weight: bold;
  cursor: pointer;
  margin: 0 auto 20px;
  box-shadow: 0 0 6px rgba(0,0,0,0.1);
  transition: background 0.3s ease;
}
.circle-upload-label:hover {
  background: #f7e5ec;
}

/* Shake animation */
.shake-wrapper.shake {
  animation: shake 0.4s ease;
}
@keyframes shake {
  0% { transform: translateX(0); }
  10% { transform: translateX(-8px); }
  30% { transform: translateX(8px); }
  50% { transform: translateX(-6px); }
  70% { transform: translateX(6px); }
  100% { transform: translateX(0); }
}



.error-message {
  color: #cc3f72;
  margin-top: 6px;
  font-size: 14px;
  text-align: center;
  animation: fadeIn 0.3s ease;
}




.language-button-group {
  display: flex;
  gap: 14px;
  justify-content: center;
  align-items: center;
}

@media (max-width: 480px) {
  .language-button-group {
    flex-direction: column;
    gap: 10px;
  }
  .info-buttons {
    flex-direction: column;
    gap: 12px;
    align-items: center;
  }

  .info-buttons button {
    width: 100%;
  }
}}