/**
 * New Tractors — Modais automáticos: "Bem-vindo", "Compartilhe e ganhe" (área logada) e
 * "Entre na comunidade" (login/cadastro). Autocontido: funciona nas duas bases (shell e auth).
 */

html.wl-lock {
  overflow: hidden;
}

.wl-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.wl-overlay[hidden] {
  display: none !important;
}

.wl-backdrop {
  position: absolute;
  inset: 0;
  background-color: rgba(8, 20, 15, 0.55);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  opacity: 0;
  transition: opacity 220ms ease;
}

.wl-card {
  position: relative;
  width: 100%;
  max-width: 400px;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  border-radius: 26px;
  background-color: #FBF9F4;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
  outline: none;
  opacity: 0;
  transform: translateY(14px) scale(0.97);
  transition: opacity 220ms ease, transform 260ms cubic-bezier(0.34, 1.3, 0.64, 1);
}

.wl-overlay.is-open .wl-backdrop,
.wl-overlay.is-open .wl-card {
  opacity: 1;
}

.wl-overlay.is-open .wl-card {
  transform: none;
}

.wl-top {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 26px 22px 18px;
  border-bottom: 1px solid rgba(16, 46, 38, 0.08);
  background: linear-gradient(180deg, #F3F0E6 0%, #FBF9F4 100%);
  text-align: center;
}

.wl-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  background-color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(16, 46, 38, 0.12);
  color: var(--forest-950);
  cursor: pointer;
}

.wl-close svg {
  width: 18px;
  height: 18px;
}

.wl-logo {
  display: block;
  width: 190px;
  height: auto;
  margin: -14px 0 -10px;
}

.wl-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 66px;
  height: 66px;
  margin-top: 4px;
  border-radius: 20px;
  background: linear-gradient(135deg, #2E7A48 0%, #16452F 100%);
  box-shadow: 0 8px 18px rgba(22, 69, 47, 0.3);
  color: #F2CF74;
}

.wl-badge svg {
  width: 32px;
  height: 32px;
}

.wl-title {
  margin-top: 10px;
  font-family: var(--font-display);
  font-size: 23px;
  font-weight: 800;
  line-height: 29px;
  color: var(--forest-950);
}

.wl-body {
  display: flex;
  flex-direction: column;
  padding: 16px 20px 20px;
}

.wl-lead {
  font-size: 14.5px;
  line-height: 20px;
  color: #4A5D52;
  text-align: center;
}

.wl-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  list-style: none;
}

.wl-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid #E6E0D2;
  border-radius: 14px;
  background-color: #F4F0E5;
  font-size: 14px;
  line-height: 19px;
  color: var(--forest-950);
}

.wl-check {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background-color: #DDEBD6;
  color: #2F7A4E;
}

.wl-check svg {
  width: 17px;
  height: 17px;
}

.wl-primary {
  min-height: 52px;
  margin-top: 18px;
  border: none;
  border-radius: 16px;
  background: linear-gradient(135deg, #245E45 0%, #123527 100%);
  box-shadow: 0 10px 22px rgba(18, 53, 39, 0.28);
  color: #FFFFFF;
  font: 800 16px var(--font-display);
  cursor: pointer;
}

.wl-secondary {
  align-self: center;
  margin-top: 14px;
  padding: 6px 12px;
  border: none;
  background: none;
  color: #4A5D52;
  font: 700 14px var(--font-display);
  text-decoration: none;
  cursor: pointer;
}

.wl-divider {
  height: 1px;
  margin: 18px 0 14px;
  background-color: rgba(16, 46, 38, 0.1);
}

.wl-community-title {
  font-size: 13px;
  font-weight: 700;
  color: #6D7B72;
  text-align: center;
}

.wl-community {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.wl-btn-whats,
.wl-btn-tele,
.wl-btn-copy {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  border: none;
  border-radius: 14px;
  color: #FFFFFF;
  font: 700 15px var(--font-display);
  text-decoration: none;
  cursor: pointer;
}

.wl-btn-whats svg,
.wl-btn-tele svg,
.wl-btn-copy svg {
  flex-shrink: 0;
  width: 19px;
  height: 19px;
}

.wl-btn-whats { background-color: #259752; box-shadow: 0 6px 14px rgba(37, 151, 82, 0.28); }
.wl-btn-tele { background-color: #2F93D8; box-shadow: 0 6px 14px rgba(47, 147, 216, 0.28); }
.wl-btn-copy { background-color: #2B6A4B; box-shadow: 0 6px 14px rgba(43, 106, 75, 0.25); }
.wl-btn-copy.is-copied { background-color: #1F7A4D; }

.wl-community-big {
  margin-top: 10px;
}

.wl-community-big .wl-btn-whats,
.wl-community-big .wl-btn-tele {
  min-height: 52px;
}

.wl-link {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding: 11px 14px;
  border: 1px solid #E6E0D2;
  border-radius: 12px;
  background-color: #F4F0E5;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 13.5px;
  color: var(--forest-950);
}

.wl-link svg {
  flex-shrink: 0;
  width: 17px;
  height: 17px;
  color: #6D7B72;
}

.wl-link span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  user-select: all;
}

.wl-close:focus-visible,
.wl-primary:focus-visible,
.wl-secondary:focus-visible,
.wl-btn-whats:focus-visible,
.wl-btn-tele:focus-visible,
.wl-btn-copy:focus-visible {
  outline: 2px solid var(--forest-700);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .wl-backdrop,
  .wl-card {
    transition: none;
  }
}

.wl-list + .wl-community-title {
  margin-top: 18px;
}

/* Banner da campanha "Compartilhe e ganhe" (imagem inteira + X) */
.wl-banner {
  position: relative;
  width: min(100%, 420px, calc((100dvh - 32px) * 0.6711));
  border-radius: 22px;
  outline: none;
  opacity: 0;
  transform: translateY(14px) scale(0.97);
  transition: opacity 220ms ease, transform 260ms cubic-bezier(0.34, 1.3, 0.64, 1);
}

.wl-overlay.is-open .wl-banner {
  opacity: 1;
  transform: none;
}

.wl-banner img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 22px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.wl-banner-close {
  top: 12px;
  right: 12px;
  z-index: 1;
  width: 36px;
  height: 36px;
  background-color: rgba(255, 255, 255, 0.92);
}
