/* ============================================ */
/* COMPONENTS — peças reutilizáveis              */
/* botões, cards, forms, nav, cursor             */
/* ============================================ */


/* ============================================ */
/* CUSTOM CURSOR                                 */
/* (decorativo — escondido em touch e mobile)    */
/* ============================================ */
/* opacity: 0 inicial evita o flash dos elementos no canto superior
   esquerdo durante o reload (defer adia o JS, mas o DOM já existe).
   JS adiciona .ready no primeiro mousemove e o cursor aparece. */
.cursor {
  position: fixed;
  width: 8px; height: 8px;
  background: var(--sage-deep);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: width 0.3s var(--ease-out), height 0.3s var(--ease-out), background 0.3s var(--ease-out), opacity 0.2s ease;
  mix-blend-mode: multiply;
  opacity: 0;
}

.cursor-follower {
  position: fixed;
  width: 32px; height: 32px;
  border: 1.5px solid var(--sage-deep);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  transition: width 0.4s var(--ease-out), height 0.4s var(--ease-out), opacity 0.3s ease;
  opacity: 0;
}

.cursor.ready { opacity: 1; }
.cursor-follower.ready { opacity: 0.4; }
.cursor-follower.ready.expand { opacity: 0.15; }

.cursor.expand {
  width: 40px; height: 40px;
  background: var(--terracotta);
}

.cursor-follower.expand {
  width: 80px; height: 80px;
}

@media (hover: none), (max-width: 768px) {
  .cursor, .cursor-follower { display: none; }
}


/* ============================================ */
/* NAV — header sticky com toggle mobile         */
/* ============================================ */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 1.5rem 0;
  transition: all 0.4s var(--ease-out);
}

nav.scrolled {
  background: rgba(251, 249, 244, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  padding: 1rem 0;
  border-bottom: 1px solid rgba(122, 152, 136, 0.1);
}

.nav-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  /* Quando o nav scrolla e encolhe (padding 1.5rem → 1rem), a imagem
     mantém a altura — alt-text serve a screen readers e o aria-label
     do <a> fornece o nome acessível. */
}

.nav-logo img {
  display: block;
  height: 48px;
  width: auto;
  transition: height 300ms var(--ease-out);
}

nav.scrolled .nav-logo img {
  height: 40px;
}

.nav-links {
  display: flex;
  gap: 2.5rem;
  list-style: none;
  align-items: center;
}

.nav-links a {
  color: var(--ink);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 400;
  position: relative;
  transition: color 0.3s ease;
}

.nav-links a:not(.nav-cta)::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--sage-deep);
  transition: width 0.4s var(--ease-out);
}

.nav-links a:not(.nav-cta):hover::after { width: 100%; }
.nav-links a:not(.nav-cta):hover { color: var(--sage-deep); }

.nav-cta {
  background: var(--ink);
  color: var(--white-warm) !important;
  padding: 0.7rem 1.5rem;
  border-radius: 100px;
  transition: all 0.4s var(--ease-out);
  overflow: hidden;
  position: relative;
}

.nav-cta::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 0; height: 0;
  background: var(--sage-deep);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.5s var(--ease-out), height 0.5s var(--ease-out);
  z-index: -1;
}

.nav-cta:hover::before { width: 200%; height: 200%; }

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--ink);
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
}


/* ============================================ */
/* BUTTONS                                       */
/* ============================================ */
.btn-primary {
  background: var(--ink);
  color: var(--white-warm);
  padding: 1.05rem 2.2rem;
  border-radius: 100px;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  position: relative;
  overflow: hidden;
  transition: transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out);
  border: none;
  cursor: pointer;
  z-index: 1;
  min-height: 44px;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 0; height: 0;
  background: var(--sage-deep);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s var(--ease-out), height 0.6s var(--ease-out);
  z-index: -1;
}

.btn-primary:hover::before { width: 250%; height: 250%; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.btn-primary svg { transition: transform 0.4s var(--ease-out); }
.btn-primary:hover svg { transform: translateX(4px); }

.btn-secondary {
  background: transparent;
  color: var(--ink);
  padding: 1.05rem 2.2rem;
  border-radius: 100px;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  border: 1.5px solid rgba(26, 38, 32, 0.15);
  transition: all 0.4s var(--ease-out);
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 44px;
}

.btn-secondary:hover {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--white-warm);
}


/* ============================================ */
/* FORMS — genéricos (escopo: qualquer form)     */
/* ============================================ */
.form-group {
  margin-bottom: 1.3rem;
  position: relative;
}

.form-group label {
  display: block;
  font-size: 0.83rem;
  color: var(--ink);
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.95rem 1.1rem;
  border: 1.5px solid rgba(90, 122, 106, 0.15);
  border-radius: 14px;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--white-warm);
  transition: all 0.3s ease;
  min-height: 44px;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--sage-deep);
  box-shadow: 0 0 0 4px rgba(90, 122, 106, 0.08);
}

.form-group textarea {
  resize: vertical;
  min-height: 110px;
  font-family: inherit;
}

.form-group input[aria-invalid="true"],
.form-group textarea[aria-invalid="true"] {
  border-color: #b03a3a;
  box-shadow: 0 0 0 4px rgba(176, 58, 58, 0.08);
}

.form-error {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.78rem;
  color: #b03a3a;
  min-height: 1em;
}

.form-submit {
  width: 100%;
  background: var(--ink);
  color: var(--white-warm);
  padding: 1.1rem;
  border: none;
  border-radius: 100px;
  font-family: inherit;
  font-size: 0.98rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.4s var(--ease-out);
  position: relative;
  overflow: hidden;
  z-index: 1;
  min-height: 44px;
}

.form-submit::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 0; height: 0;
  background: var(--sage-deep);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s var(--ease-out), height 0.6s var(--ease-out);
  z-index: -1;
}

.form-submit:hover::before { width: 250%; height: 250%; }
.form-submit:hover { transform: translateY(-2px); }
.form-submit:disabled { opacity: 0.6; cursor: not-allowed; }

/* Honeypot anti-spam: invisível para humanos, alcançável para bots. */
.form-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-status {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  font-size: 0.9rem;
  line-height: 1.45;
}

.form-status:empty {
  display: none;
}

.form-status--success {
  background: rgba(90, 122, 106, 0.12);
  color: var(--sage-deep);
  border: 1px solid rgba(90, 122, 106, 0.25);
}

.form-status--error {
  background: rgba(176, 58, 58, 0.08);
  color: #b03a3a;
  border: 1px solid rgba(176, 58, 58, 0.2);
}

.form-status a {
  color: inherit;
  text-decoration: underline;
  font-weight: 500;
}

/* WhatsApp floating action button — sage-deep para alinhar à paleta editorial. */
.whatsapp-fab {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  width: 56px;
  height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--sage-deep);
  color: var(--white-warm);
  border-radius: 50%;
  box-shadow: 0 12px 32px rgba(26, 38, 32, 0.25);
  z-index: 200;
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out), background 0.3s var(--ease-out);
  animation: whatsapp-fab-in 0.6s var(--ease-out) 0.8s both;
}

.whatsapp-fab svg {
  display: block;
}

@media (hover: hover) {
  .whatsapp-fab:hover {
    transform: translateY(-3px) scale(1.05);
    background: var(--ink);
    box-shadow: 0 16px 40px rgba(26, 38, 32, 0.35);
  }
}

.whatsapp-fab:focus-visible {
  outline: 2px solid var(--sage-deep);
  outline-offset: 4px;
}

@media (min-width: 968px) {
  .whatsapp-fab {
    right: 2rem;
    bottom: 2rem;
    width: 64px;
    height: 64px;
  }
}

@keyframes whatsapp-fab-in {
  from { opacity: 0; transform: scale(0.6); }
  to   { opacity: 1; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .whatsapp-fab {
    animation: none;
  }
  .whatsapp-fab:hover {
    transform: none;
  }
}
