:root {
  --baby-blue: #a9cfe0;
  --baby-blue-deep: #5f8fa6;
  --terracotta: #c9714f;
  --terracotta-deep: #9c4f34;
  --cream: #fdf8f3;
  --vh: 1vh;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html, body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: pan-x pan-y;
}

body {
  margin: 0;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100dvh;
  height: calc(var(--vh, 1vh) * 100);
  font-family: 'Poppins', sans-serif;
  color: var(--cream);
  overscroll-behavior: none;
  -webkit-overflow-scrolling: none;
}

/* Camada da foto de fundo */
.bg-photo {
  position: fixed;
  inset: 0;
  z-index: -3;
  background-image: url('/img/casal.jpg');
  background-size: cover;
  background-position: center 30%;
  background-repeat: no-repeat;
  background-color: var(--baby-blue-deep);
}

/* Camada de cor sobre a foto, nos tons do casamento */
.bg-overlay {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(180deg, rgba(20, 30, 35, 0.35) 0%, rgba(20, 30, 35, 0.15) 35%, rgba(20, 30, 35, 0.55) 100%),
    linear-gradient(155deg, rgba(95, 143, 166, 0.55) 0%, rgba(95, 143, 166, 0.1) 40%, rgba(156, 79, 52, 0.15) 65%, rgba(156, 79, 52, 0.55) 100%);
}

.screen {
  position: relative;
  z-index: 1;
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: env(safe-area-inset-top, 16px) env(safe-area-inset-right, 20px) env(safe-area-inset-bottom, 12px) env(safe-area-inset-left, 20px);
  text-align: center;
  gap: clamp(10px, 2.5vh, 24px);
}

.wrapper {
  max-width: 640px;
  width: 100%;
  animation: fade-up 1s ease both;
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.35em;
  font-size: clamp(0.6rem, 2vw, 0.78rem);
  color: var(--baby-blue);
  margin: 0 0 clamp(6px, 1.5vh, 12px);
  font-weight: 500;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.35);
}

.names {
  font-family: 'Playfair Display', serif;
  font-weight: 600;
  font-size: clamp(2.1rem, 9vw, 4.2rem);
  margin: 0;
  line-height: 1.1;
  color: var(--cream);
  text-shadow: 0 3px 18px rgba(0, 0, 0, 0.4);
}

.names .amp {
  font-style: italic;
  color: var(--terracotta);
  padding: 0 0.25em;
  font-weight: 400;
}

.date {
  margin: clamp(10px, 2vh, 18px) 0 0;
  font-size: clamp(0.78rem, 2.4vw, 1rem);
  letter-spacing: 0.03em;
  color: var(--cream);
  opacity: 0.92;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
}

.divider {
  margin: clamp(14px, 3vh, 28px) 0;
  color: var(--terracotta);
  font-size: 1.4rem;
  opacity: 0.9;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.3);
}

.countdown {
  display: flex;
  justify-content: center;
  gap: clamp(8px, 2.2vw, 22px);
  flex-wrap: nowrap;
}

.unit {
  background: rgba(253, 248, 243, 0.08);
  backdrop-filter: blur(1px);
  -webkit-backdrop-filter: blur(1px);
  border: 1px solid rgba(253, 248, 243, 0.2);
  border-radius: 16px;
  padding: clamp(10px, 2.2vh, 18px) clamp(8px, 3vw, 16px);
  min-width: 64px;
  flex: 1 1 0;
  max-width: 100px;
  box-shadow: 0 10px 30px rgba(20, 20, 20, 0.15);
}

.value {
  display: block;
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.5rem, 6.5vw, 2.6rem);
  font-weight: 600;
  color: var(--cream);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.label {
  display: block;
  margin-top: 4px;
  font-size: clamp(0.55rem, 1.8vw, 0.68rem);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--baby-blue);
}

.message {
  margin: clamp(14px, 3vh, 24px) 0 0;
  font-style: italic;
  font-size: clamp(0.85rem, 2.6vw, 1.05rem);
  color: var(--cream);
  opacity: 0.95;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.3);
}

.footer {
  position: relative;
  z-index: 1;
  padding-bottom: env(safe-area-inset-bottom, 0);
  font-size: clamp(0.6rem, 1.8vw, 0.72rem);
  letter-spacing: 0.1em;
  color: var(--baby-blue);
  text-transform: uppercase;
  opacity: 0.9;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.3);
}

@media (max-height: 560px) {
  .eyebrow { margin-bottom: 4px; }
  .divider { margin: 10px 0; }
  .message { margin-top: 10px; }
}

.leave-message-btn {
  margin: clamp(16px, 3vh, 26px) auto 0;
  display: block;
  cursor: pointer;
  font-family: 'Poppins', sans-serif;
  font-size: clamp(0.75rem, 2.2vw, 0.88rem);
  font-weight: 500;
  color: var(--cream);
  background: rgba(253, 248, 243, 0.1);
  border: 1px solid rgba(253, 248, 243, 0.35);
  border-radius: 999px;
  padding: 10px 22px;
  backdrop-filter: blur(1px);
  -webkit-backdrop-filter: blur(1px);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.3);
  transition: background 0.2s ease;
}

.leave-message-btn:hover,
.leave-message-btn:focus-visible {
  background: rgba(253, 248, 243, 0.2);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(20, 30, 35, 0.6);
  backdrop-filter: blur(2px);
}

.modal-overlay[hidden] {
  display: none;
}

.modal-card {
  position: relative;
  width: 100%;
  max-width: 380px;
  background: var(--cream);
  color: #22303a;
  border-radius: 18px;
  padding: 28px 24px 22px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  font-family: 'Poppins', sans-serif;
  animation: fade-up 0.3s ease both;
}

.modal-card h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  margin: 0 0 16px;
  color: var(--terracotta-deep);
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: none;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  color: #6b6b6b;
  padding: 4px;
}

#messageForm {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#messageForm label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.82rem;
  color: #3a3a3a;
}

#messageForm input[type="text"],
#messageForm textarea {
  font-family: 'Poppins', sans-serif;
  font-size: 0.92rem;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #d8d8d8;
  resize: vertical;
}

#messageForm input[type="text"]:focus,
#messageForm textarea:focus {
  outline: 2px solid var(--baby-blue-deep);
  outline-offset: 1px;
}

.hp-field {
  position: absolute !important;
  left: -9999px !important;
  width: 1px;
  height: 1px;
  opacity: 0;
}

#messageForm button[type="submit"] {
  cursor: pointer;
  margin-top: 4px;
  background: var(--terracotta);
  color: var(--cream);
  border: none;
  border-radius: 10px;
  padding: 11px 16px;
  font-size: 0.92rem;
  font-weight: 500;
}

#messageForm button[type="submit"]:disabled {
  opacity: 0.6;
  cursor: default;
}

.form-feedback {
  margin: 4px 0 0;
  font-size: 0.8rem;
  color: var(--terracotta-deep);
  min-height: 1em;
}
