:root {
  --black: #000;
  --white: #fff;
  --muted: #666;
  --radius: 16px;
  --max-form-width: 380px;
  --gradient: linear-gradient(90deg, #000, #444);
}

/* ======== BOTÃO PRINCIPAL ======== */
.contact-btn {
  background: var(--gradient);
  color: var(--white);
  padding: 14px 34px;
  border-radius: 999px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.5px;
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
  font-size: 15px;
}

.contact-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.contact-btn:active {
  transform: translateY(0);
}

/* ======== OVERLAY ======== */
.popup-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(
    circle at top left,
    rgba(255, 255, 255, 0.15),
    rgba(0, 0, 0, 0.7)
  );
  backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.4s ease forwards;
  z-index: 999;
  padding: 20px;
}

.popup-overlay.active {
  display: flex;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ======== POPUP ======== */
.popup-box {
  position: relative;
  background: rgba(255, 255, 255, 0.98);
  border-radius: var(--radius);
  padding: 40px;
  max-width: 480px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  transform: scale(0.9) translateY(20px);
  opacity: 0;
  animation: popupIn 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

/* ======== FECHAR ======== */
.close-btn {
  position: absolute;
  right: 16px;
  top: 14px;
  border: none;
  background: transparent;
  font-size: 22px;
  cursor: pointer;
  color: var(--muted);
  transition: transform 0.2s, color 0.3s;
}

.close-btn:hover {
  transform: rotate(90deg);
  color: var(--black);
}

/* ======== TÍTULO E TEXTO ======== */
h2 {
  font-size: 22px;
  margin-bottom: 6px;
  color: var(--black);
}

p.lead {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 20px;
}

/* ======== FORM ======== */
.popup-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: stretch;
  width: 100%;
  max-width: var(--max-form-width);
  margin: 0 auto;
}

/* Floating label container */
.field {
  position: relative;
}

.field input,
.field textarea {
  width: 100%;
  padding: 14px 14px 14px 12px;
  border-radius: 10px;
  border: 1px solid #ccc;
  background: #f9f9f9;
  font-size: 14px;
  outline: none;
  transition: all 0.25s ease;
}

.field textarea {
  resize: vertical;
  min-height: 110px;
}

.field input:focus,
.field textarea:focus {
  border-color: #000;
  background: #fff;
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.08);
}

/* Floating label animation */
.field label {
  position: absolute;
  top: 50%;
  left: 14px;
  transform: translateY(-50%);
  font-size: 14px;
  color: #888;
  pointer-events: none;
  transition: all 0.2s ease;
  background: transparent;
  padding: 0 6px;
}

.field input:focus + label,
.field input:not(:placeholder-shown) + label,
.field textarea:focus + label,
.field textarea:not(:placeholder-shown) + label {
  top: -8px;
  font-size: 12px;
  color: #000;
  background: #fff;
}

/* ======== reCAPTCHA ======== */
.g-recaptcha {
  transform: scale(0.94);
  transform-origin: center;
  margin: 8px auto 2px;
}

/* ======== BOTÃO ENVIAR ======== */
.btn-enviar {
  background: var(--gradient);
  color: var(--white);
  border: none;
  border-radius: 10px;
  padding: 12px 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.4s, transform 0.2s;
  width: 100%;
}

.btn-enviar:hover {
  background: linear-gradient(90deg, #111, #666);
  transform: translateY(-2px);
}

.btn-enviar:active {
  transform: translateY(1px);
}

.btn-enviar:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ======== TOAST ======== */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--black);
  color: var(--white);
  padding: 12px 18px;
  border-radius: 8px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.35s ease;
  z-index: 1500;
  font-size: 14px;
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ======== RESPONSIVIDADE ======== */

/* Tablets */
@media (max-width: 768px) {
  .popup-box {
    max-width: 90%;
    padding: 30px;
  }

  h2 {
    font-size: 20px;
  }

  .popup-form {
    gap: 14px;
  }
}

/* Smartphones */
@media (max-width: 480px) {
  .popup-overlay {
    padding: 10px;
  }

  .popup-box {
    padding: 24px 20px;
    max-width: 100%;
    border-radius: 12px;
  }

  h2 {
    font-size: 18px;
  }

  p.lead {
    font-size: 13px;
  }

  .field input,
  .field textarea {
    font-size: 13px;
    padding: 12px;
  }

  .btn-enviar {
    font-size: 14px;
    padding: 12px;
  }

  .g-recaptcha {
    transform: scale(0.84);
  }
}

/* Ecrãs muito grandes */
@media (min-width: 1600px) {
  .popup-box {
    max-width: 600px;
    padding: 50px;
  }

  h2 {
    font-size: 24px;
  }
}
